Ejemplo n.º 1
0
 def test_one(self):
     test_string = """
         5 1 9 5
         7 5 3
         2 4 6 8
     """
     self.assertEqual(solution_part_one(test_string), 18)
Ejemplo n.º 2
0
 def test_one(self):
     problem_input = "\n".join([
         "abcdef",
         "bababc",
         "abbcde",
         "abcccd",
         "aabcdd",
         "abcdee",
         "ababab",
     ])
     self.assertEqual(solution_part_one(problem_input), 12)
Ejemplo 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_one(program_input), "tknk")
Ejemplo n.º 4
0
 def test_one(self):
     self.assertEqual(solution_part_one([0, 3, 0, 1, -3]), 5)
Ejemplo n.º 5
0
 def test_one(self):
     self.assertEqual(solution_part_one("ne,ne,ne"), 3)
Ejemplo n.º 6
0
 def test_three(self):
     self.assertEqual(solution_part_one("ne,ne,s,s"), 2)
Ejemplo n.º 7
0
 def test_one(self):
     self.assertEqual(
         solution_part_one("2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2"), 138)
Ejemplo n.º 8
0
 def test_one(self):
     self.assertEqual(solution_part_one(TEST_INPUT), 24)
Ejemplo n.º 9
0
 def test_three(self):
     problem_input = "\n".join(["-1", "-2", "-3"])
     self.assertEqual(-6, solution_part_one(problem_input))
Ejemplo n.º 10
0
 def test_two(self):
     self.assertEqual(solution_part_one(12), 3)
Ejemplo n.º 11
0
 def test_one(self):
     self.assertEqual(solution_part_one(1), 0)
Ejemplo n.º 12
0
 def test_four(self):
     self.assertEqual(solution_part_one(1024), 31)
Ejemplo n.º 13
0
 def test_three(self):
     self.assertEqual(solution_part_one(23), 2)
Ejemplo n.º 14
0
 def test_one(self):
     self.assertEqual(solution_part_one(a=65, b=8921), 588)
Ejemplo n.º 15
0
 def test_one(self):
     self.assertEqual(solution_part_one(PROBLEM_INPUT), 240)
Ejemplo n.º 16
0
 def test_one(self):
     self.assertEqual(solution_part_one("aa bb cc dd ee"), 1)
Ejemplo n.º 17
0
 def test_two(self):
     self.assertEqual(solution_part_one("aa bb cc dd aa"), 0)
Ejemplo n.º 18
0
 def test_3(self):
     self.assertEqual(solution_part_one(players=13, largest_marble=7999), 146373)
Ejemplo n.º 19
0
 def test_one(self):
     problem_input = "\n".join(["+1", "+1", "+1"])
     self.assertEqual(3, solution_part_one(problem_input))
Ejemplo n.º 20
0
 def test_4(self):
     self.assertEqual(solution_part_one(players=17, largest_marble=1104), 2764)
Ejemplo n.º 21
0
 def test_one(self):
     self.assertEqual(solution_part_one(3), 638)
Ejemplo n.º 22
0
 def test_5(self):
     self.assertEqual(solution_part_one(players=21, largest_marble=6111), 54718)
Ejemplo 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_one(program_input), 1)
Ejemplo n.º 24
0
 def test_6(self):
     self.assertEqual(solution_part_one(players=30, largest_marble=5807), 37305)
Ejemplo n.º 25
0
 def test_four(self):
     self.assertEqual(solution_part_one("se,sw,se,sw,sw"), 3)
Ejemplo n.º 26
0
 def test_1(self):
     self.assertEqual(solution_part_one(players=9, largest_marble=25), 32)
Ejemplo n.º 27
0
 def test_two(self):
     self.assertEqual(solution_part_one("ne,ne,sw,sw"), 0)
Ejemplo n.º 28
0
 def test_2(self):
     self.assertEqual(solution_part_one(players=10, largest_marble=1618), 8317)
Ejemplo n.º 29
0
 def test_three(self):
     self.assertEqual(solution_part_one("aa bb cc dd aaa"), 1)
Ejemplo n.º 30
0
 def test_one(self):
     self.assertEqual(solution_part_one([0, 2, 7, 1]), 5)