def setUp(self):
        self.d = parse_input("""e => H
e => O
H => HO
H => OH
O => HH""")
        self.starting_path = ['e']
    def test_example(self):
        test_input = """H => HO
H => OH
O => HH"""
        expected = {
            'H': ['HO', 'OH'],
            'O': ['HH']
        }
        self.assertEqual(expected, parse_input(test_input))
 def test_puzzle(self):
     trans_dict = parse_input(INPUT_TRANSFORMATION_STRING)
     result = get_num_combinations(INPUT_MOLECULE, trans_dict)
     print result
Exemplo n.º 4
0
def part_1(instructions):
    proc = Day19Processor(*parse_input(instructions))
    while proc.step_prog():
        # print(proc.prog_counter, proc.registers)
        if proc.prog_counter == 30:
            return proc.registers[5]
Exemplo n.º 5
0
 def test_parses_input_data(self):
     initial_molecule, replacements = parse_input(self.input_data)
     self.assertEqual(replacements, self.replacements)
     self.assertEqual(initial_molecule, self.initial_molecule)
Exemplo n.º 6
0
 def test_parses_input_data(self):
     initial_molecule, replacements = parse_input(self.input_data)
     self.assertEqual(replacements, self.replacements)
     self.assertEqual(initial_molecule, self.initial_molecule)