예제 #1
0
 def test_pass2(self):
     data = puzzle.parse(read_file("11", "1"))
     result = puzzle.solve2(data)
     for y in range(len(result)):
         for x in range(len(result[y])):
             if result[y][x] == 1:
                 sys.stdout.write("#")
             else:
                 sys.stdout.write(" ")
             sys.stdout.write("\n")
     self.assertEqual(True, True)
예제 #2
0
 def test_pass(self):
     data = puzzle.parse(read_file("11", "1"))
     result = puzzle.solve(data)
     print(f"Solution: {len(result.keys())}")
     self.assertEqual(True, True)
예제 #3
0
 def test_day5_part1(self):
     file_data = parse("../../05/input.txt")
     got = solve1(file_data, [1])
     want = [0, 0, 0, 0, 0, 0, 0, 0, 0, 5821753]
     self.assertEqual(want, got)
예제 #4
0
 def test_day5_part2(self):
     file_data = parse("../../05/input.txt")
     got = solve1(file_data, [5])
     want = [11956381]
     self.assertEqual(want, got)
예제 #5
0
 def test_part1(self):
     file_data = parse("../../07/input.txt")
     [max_val, max_seq] = amplify_once_find_max_seq(file_data)
     self.assertEqual(max_val, 13848)
예제 #6
0
 def test_part2(self):
     file_data = parse("../../07/input.txt")
     [max_val, max_seq] = amplify_loop_max_seq(file_data)
     self.assertEqual(max_val, 12932154)
예제 #7
0
 def test_part2(self):
     file_data = parse("../../09/input.txt")
     outputs = solve1(file_data, [2])
     self.assertEqual(outputs, [33343])
예제 #8
0
 def test_part1(self):
     file_data = parse("../../09/input.txt")
     outputs = solve1(file_data, [1])
     self.assertEqual(outputs, [3780860499])
예제 #9
0
 def test_part2(self):
     program = parse("../../11/input.txt")
     robot = PainterRobot(program)
     grid = robot.run_and_return_grid(initial_color=1)
     num_painted = len(list(grid.keys()))
     self.assertEqual(num_painted, 249)
예제 #10
0
 def test_solver_b(self):
     self.assertEqual(solver_b(parse(test_string)), 26)
예제 #11
0
 def test_solver_a(self):
     self.assertEqual(solver_a(parse(test_string)), 37)