Exemplo n.º 1
0
 def test_one(self):
     test_string = """
         5 9 2 8
         9 4 7 3
         3 8 6 5
     """
     self.assertEqual(solution_part_two(test_string), 9)
Exemplo n.º 2
0
 def test_one(self):
     problem_input = "\n".join([
         "abcde",
         "fghij",
         "klmno",
         "pqrst",
         "fguij",
         "axcye",
         "wvxyz",
     ])
     self.assertEqual(solution_part_two(problem_input), "fgij")
Exemplo n.º 3
0
    def test_one(self):
        program_input = """pbga (66)
xhth (57)
ebii (61)
havc (66)
ktlj (57)
fwft (72) -> ktlj, cntj, xhth
qoyq (66)
padx (45) -> pbga, havc, qoyq
tknk (41) -> ugml, padx, fwft
jptl (61)
ugml (68) -> gyxo, ebii, jptl
gyxo (61)
cntj (57)"""
        self.assertEqual(solution_part_two(program_input), 60)
Exemplo n.º 4
0
 def test_three(self):
     self.assertEqual(solution_part_two(10), 11)
Exemplo n.º 5
0
 def test_two(self):
     problem_input = "\n".join(["+3", "+3", "+4", "-2", "-4"])
     self.assertEqual(10, solution_part_two(problem_input))
Exemplo n.º 6
0
 def test_three(self):
     self.assertEqual(solution_part_two("ne,ne,s,s"), 2)
Exemplo n.º 7
0
 def test_one(self):
     self.assertEqual(solution_part_two([0, 3, 0, 1, -3]), 10)
Exemplo n.º 8
0
 def test_one(self):
     self.assertEqual(
         solution_part_two("2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2"), 66)
Exemplo n.º 9
0
 def test_one(self):
     self.assertEqual(solution_part_two("ne,ne,ne"), 3)
Exemplo n.º 10
0
 def test_6(self):
     self.assertEqual(solution_part_two(players=30, largest_marble=5807), 37305)
Exemplo n.º 11
0
 def test_one(self):
     self.assertEqual(solution_part_two(TEST_INPUT), 10)
Exemplo n.º 12
0
 def test_4(self):
     self.assertEqual(solution_part_two(players=17, largest_marble=1104), 2764)
Exemplo n.º 13
0
 def test_5(self):
     self.assertEqual(solution_part_two(players=21, largest_marble=6111), 54718)
Exemplo n.º 14
0
 def test_3(self):
     self.assertEqual(solution_part_two(players=13, largest_marble=7999), 146373)
Exemplo n.º 15
0
 def test_2(self):
     self.assertEqual(solution_part_two(players=10, largest_marble=1618), 8317)
Exemplo n.º 16
0
 def test_1(self):
     self.assertEqual(solution_part_two(players=9, largest_marble=25), 32)
Exemplo n.º 17
0
 def test_three(self):
     problem_input = "\n".join(["-6", "+3", "+8", "+5", "-6"])
     self.assertEqual(5, solution_part_two(problem_input))
Exemplo n.º 18
0
 def test_one(self):
     self.assertEqual(solution_part_two("abcde fghij"), 1)
Exemplo n.º 19
0
 def test_four(self):
     problem_input = "\n".join(["+7", "+7", "-2", "-7", "-4"])
     self.assertEqual(14, solution_part_two(problem_input))
Exemplo n.º 20
0
 def test_two(self):
     self.assertEqual(solution_part_two("abcde xyz ecdab"), 0)
Exemplo n.º 21
0
 def test_one(self):
     self.assertEqual(solution_part_two(3), 1222153)
Exemplo n.º 22
0
 def test_three(self):
     self.assertEqual(solution_part_two("a ab abc abd abf abj"), 1)
Exemplo n.º 23
0
    def test_one(self):
        program_input = """b inc 5 if a > 1
a inc 1 if b < 5
c dec -10 if a >= 1
c inc -20 if c == 10"""
        self.assertEqual(solution_part_two(program_input), 10)
Exemplo n.º 24
0
 def test_four(self):
     self.assertEqual(solution_part_two("iiii oiii ooii oooi oooo"), 1)
Exemplo n.º 25
0
 def test_two(self):
     self.assertEqual(solution_part_two("ne,ne,sw,sw"), 2)
Exemplo n.º 26
0
 def test_one(self):
     self.assertEqual(solution_part_two(7), 10)
Exemplo n.º 27
0
 def test_four(self):
     self.assertEqual(solution_part_two("se,sw,se,sw,sw"), 3)
Exemplo n.º 28
0
 def test_one(self):
     problem_input = "\n".join(["+1", "-1"])
     self.assertEqual(0, solution_part_two(problem_input))
Exemplo n.º 29
0
 def test_five(self):
     self.assertEqual(solution_part_two("oiii ioii iioi iiio"), 0)
Exemplo n.º 30
0
 def test_two(self):
     self.assertEqual(solution_part_two(5), 10)