Пример #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
Пример #2
0
 def test_part1_example1(self):
     content = dedent("""
         #########
         #[email protected]#
         #########
         """)
     grid, starting_point = parse(content)
     self.assertEqual(part1(grid, starting_point), 8)
Пример #3
0
 def test_part1_exampe1(self):
     example_input = [
         "#########",
         "#[email protected]#",
         "#########",
     ]
     result = day18.part1(example_input)
     self.assertEqual(8, result)
Пример #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)
Пример #5
0
 def test_part1_example2(self):
     content = dedent("""
         ########################
         #[email protected].#
         ######################.#
         #d.....................#
         ########################
         """)
     grid, starting_point = parse(content)
     self.assertEqual(part1(grid, starting_point), 86)
Пример #6
0
 def test_part1_example2(self):
     example_input = [
         "########################",
         "#[email protected].#",
         "######################.#",
         "#d.....................#",
         "########################",
     ]
     result = day18.part1(example_input)
     self.assertEqual(86, result)
Пример #7
0
 def test_part1_example3(self):
     example_input = [
         "########################",
         "#...............b.C.D.f#",
         "#.######################",
         "#[email protected]#",
         "########################",
     ]
     result = day18.part1(example_input)
     self.assertEqual(132, result)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #12
0
def test_part1(puzzle_input, answer):
    assert part1(puzzle_input) == answer
Пример #13
0
 def test_part1_input(self):
     result = day18.part1(aoc.read_input('day18.input'))
     self.assertEqual(5964, result)
Пример #14
0
def test_part1_input(input_data):
    assert part1(input_data) == 701339185745
Пример #15
0
def test_day18_part1(expression, value):
    assert day18.part1(expression) == value
Пример #16
0
 def test_part1_example(self):
     result = day18.part1(self.example_input)
     self.assertEqual(1147, result)
Пример #17
0
def test_18_1_examples():
    examples = []
    for (inp, out) in examples:
        assert out == day18.part1(inp)