public function __invoke()
 {
     $input = file_get_contents(__DIR__ . "/../../input/Day8/Puzzle1");
     $instructions = explode(PHP_EOL, $input);
     $total = 0;
     foreach ($instructions as $instruction) {
         $entry = new ListEntry($instruction);
         $total += $entry->countNumberOfCharsInStringCodeWhenEscaped() - $entry->countNumberOfCharsInStringCode();
     }
     echo "Answer: " . $total;
 }
示例#2
0
 /**
  * Deletes an existing row .
  *
  * @param ListEntry $entry The row to delete
  */
 public function deleteRow($entry)
 {
     $entry->delete();
 }