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)); }
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); }