Example #1
0
def test_day18_part1():
    assert day18.part1('''#########
#[email protected]#
#########''') == 8
    assert day18.part1('''########################
#[email protected].#
######################.#
#d.....................#
########################''') == 86
    assert day18.part1('''########################
#...............b.C.D.f#
#.######################
#[email protected]#
########################''') == 132
    assert day18.part1('''#################
#i.G..c...e..H.p#
########.########
#j.A..b...f..D.o#
########@########
#k.E..a...g..B.n#
########.########
#l.F..d...h..C.m#
#################''') == 136
    assert day18.part1('''########################
#@..............ac.GI.b#
###d#e#f################
###A#B#C################
###g#h#i################
########################''') == 81
Example #2
0
 def test_part1_example1(self):
     content = dedent("""
         #########
         #[email protected]#
         #########
         """)
     grid, starting_point = parse(content)
     self.assertEqual(part1(grid, starting_point), 8)
Example #3
0
 def test_part1_exampe1(self):
     example_input = [
         "#########",
         "#[email protected]#",
         "#########",
     ]
     result = day18.part1(example_input)
     self.assertEqual(8, result)
Example #4
0
 def test_part1_example3(self):
     content = dedent("""
         ########################
         #...............b.C.D.f#
         #.######################
         #[email protected]#
         ########################
         """)
     grid, starting_point = parse(content)
     self.assertEqual(part1(grid, starting_point), 132)
Example #5
0
 def test_part1_example2(self):
     content = dedent("""
         ########################
         #[email protected].#
         ######################.#
         #d.....................#
         ########################
         """)
     grid, starting_point = parse(content)
     self.assertEqual(part1(grid, starting_point), 86)
Example #6
0
 def test_part1_example2(self):
     example_input = [
         "########################",
         "#[email protected].#",
         "######################.#",
         "#d.....................#",
         "########################",
     ]
     result = day18.part1(example_input)
     self.assertEqual(86, result)
Example #7
0
 def test_part1_example3(self):
     example_input = [
         "########################",
         "#...............b.C.D.f#",
         "#.######################",
         "#[email protected]#",
         "########################",
     ]
     result = day18.part1(example_input)
     self.assertEqual(132, result)
Example #8
0
 def test_part1_example5(self):
     example_input = [
         "########################",
         "#@..............ac.GI.b#",
         "###d#e#f################",
         "###A#B#C################",
         "###g#h#i################",
         "########################",
     ]
     result = day18.part1(example_input)
     self.assertEqual(81, result)
Example #9
0
 def test_part1_example5(self):
     content = dedent("""
         ########################
         #@..............ac.GI.b#
         ###d#e#f################
         ###A#B#C################
         ###g#h#i################
         ########################
         """)
     grid, starting_point = parse(content)
     self.assertEqual(part1(grid, starting_point), 81)
Example #10
0
 def test_part1_example4(self):
     content = dedent("""
         #################
         #i.G..c...e..H.p#
         ########.########
         #j.A..b...f..D.o#
         ########@########
         #k.E..a...g..B.n#
         ########.########
         #l.F..d...h..C.m#
         #################
         """)
     grid, starting_point = parse(content)
     self.assertEqual(part1(grid, starting_point), 136)
Example #11
0
 def test_part1_example4(self):
     example_input = [
         "#################",
         "#i.G..c...e..H.p#",
         "########.########",
         "#j.A..b...f..D.o#",
         "########@########",
         "#k.E..a...g..B.n#",
         "########.########",
         "#l.F..d...h..C.m#",
         "#################",
     ]
     result = day18.part1(example_input)
     self.assertEqual(136, result)
Example #12
0
def test_part1(puzzle_input, answer):
    assert part1(puzzle_input) == answer
Example #13
0
 def test_part1_input(self):
     result = day18.part1(aoc.read_input('day18.input'))
     self.assertEqual(5964, result)
Example #14
0
def test_part1_input(input_data):
    assert part1(input_data) == 701339185745
Example #15
0
def test_day18_part1(expression, value):
    assert day18.part1(expression) == value
Example #16
0
 def test_part1_example(self):
     result = day18.part1(self.example_input)
     self.assertEqual(1147, result)
def test_18_1_examples():
    examples = []
    for (inp, out) in examples:
        assert out == day18.part1(inp)