Пример #1
0
 public function __invoke()
 {
     $parser = new InstructionsParser();
     $parsed = $parser->parse($this->loadInput("Day19/Puzzle1"));
     $runner = new ReplacementRunner($parsed['replacements']);
     $possibles = $runner->possibleReplacements($parsed['molecule']);
     $this->write("Number of possibles: " . count($possibles));
 }
Пример #2
0
 public function __invoke()
 {
     $parser = new InstructionsParser();
     $parsed = $parser->parse($this->loadInput("Day19/Puzzle1"));
     $runner = new ReplacementRunner($parsed['replacements']);
     $steps = $runner->minimumNumberStepsForBuildingMolecule($parsed['molecule']);
     $this->write("Steps: " . $steps);
 }