示例#1
0
def test_day10_part1():
    assert day10.part1('''.#..#
.....
#####
....#
...##''') == ((3, 4), 8)
    assert day10.part1('''......#.#.
#..#.#....
..#######.
.#.#.###..
.#..#.....
..#....#.#
#..#....#.
.##.#..###
##...#..#.
.#....####''') == ((5, 8), 33)
    assert day10.part1('''#.#...#.#.
.###....#.
.#....#...
##.#.#.#.#
....#.#.#.
.##..###.#
..#...##..
..##....##
......#...
.####.###.''') == ((1, 2), 35)
    assert day10.part1('''.#..#..###
####.###.#
....###.#.
..###.##.#
##.##.#.#.
....###..#
..#.#..#.#
#..#.#.###
.##...##.#
.....#.#..''') == ((6, 3), 41)
    assert day10.part1('''.#..##.###...#######
##.############..##.
.#.######.########.#
.###.#######.####.#.
#####.##.#.##.###.##
..#####..#.#########
####################
#.####....###.#.#.##
##.#################
#####.##.###..####..
..######..##.#######
####.##.####...##..#
.#####..#.######.###
##...#.##########...
#.##########.#######
.####.#.###.###.#.##
....##.##.###..#####
.#.#.###########.###
#.#.#.#####.####.###
###.##.####.##.#..##''') == ((11, 13), 210)
示例#2
0
def test_ast_count():
    lines = ['.#..#','.....','#####','....#','...##']
    (field,x,y) = day10.genField(lines)
    v = day10.genVectors(max(x,y))
    (ba, num) = day10.part1(field,v)
    assert ba == 3+4j
    assert num == 8
示例#3
0
    def test_second_example(self):
        f = 'day10-test2.txt'
        input_list: List[int] = common.read_list(f)
        input_list = day10.prep_list(input_list)

        answer: int = day10.part1(input_list)

        self.assertEqual(220, answer)
示例#4
0
def test_destoyer():
    lines = ['.#....#####...#..','##...##.#####..##','##...#...#.#####.','..#.....#...###..','..#.#.....#....##']
    (field,x,y) = day10.genField(lines)
    v = day10.genVectors(max(x,y))
    (ba, num) = day10.part1(field,v)
    print(ba)
    la = day10.part2(field,v,ba,36)
    assert la == (14+3j)
示例#5
0
    def test_part1_example1(self):
        input_list = [
            ".#..#",
            ".....",
            "#####",
            "....#",
            "...##",
        ]

        result = day10.part1(input_list)
        self.assertEqual(8, result)
示例#6
0
 def test_part1(self):
     length = 256
     inputs = parse_nums("../input.txt")
     p1_ans = part1(length, inputs)
     self.assertEqual(p1_ans, 2928)
示例#7
0
 def test_part1_input(self):
     result = day10.part1(aoc.read_input('day10.input'))
     self.assertEqual(result, '\n'.join(self.input_solution))
示例#8
0
def test_part1(puzzle_input, answer):
    assert part1(puzzle_input) == answer
示例#9
0
 def test_part1_2(self):
     grid = parse("../input_small2.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 5)
     self.assertEqual(y, 8)
     self.assertEqual(count, 33)
示例#10
0
 def test_part1_example_small(self):
     self.assertEqual(7 * 5,
                      day10.part1("../inputs/day10_example_small.txt"))
示例#11
0
 def test_part1_example1(self):
     result = day10.part1(self.example)
     self.assertEqual(result, '\n'.join(self.example_solution))
示例#12
0
def test_part1_sample(sample_data):
    assert part1(sample_data) == 35
示例#13
0
 def test_part1_5(self):
     grid = parse("../input_small5.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 11)
     self.assertEqual(y, 13)
     self.assertEqual(count, 210)
示例#14
0
def test_day10_part1a():
    assert day10.part1(day10_1) == 7 * 5
示例#15
0
 def test_part1_3(self):
     grid = parse("../input_small3.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 1)
     self.assertEqual(y, 2)
     self.assertEqual(count, 35)
def test_10_1_examples():
    examples = []
    for (inp, out) in examples:
        assert out == day10.part1(inp)
示例#17
0
 def test_part1_1(self):
     grid = parse("../input_small.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 3)
     self.assertEqual(y, 4)
     self.assertEqual(count, 8)
示例#18
0
 def test_part1_main(self):
     grid = parse("../input.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 11)
     self.assertEqual(y, 11)
     self.assertEqual(count, 221)
示例#19
0
def test_part1():
    assert part1() == 1935
示例#20
0
 def test_part1_example_large(self):
     self.assertEqual(22 * 10,
                      day10.part1("../inputs/day10_example_large.txt"))
示例#21
0
def test_day10_part1b():
    assert day10.part1(day10_2) == 22 * 10
示例#22
0
 def test_part1_4(self):
     grid = parse("../input_small4.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 6)
     self.assertEqual(y, 3)
     self.assertEqual(count, 41)
示例#23
0
def test_part1_input(input_data):
    assert part1(input_data) == 2343
示例#24
0
 def test_part1_example5(self):
     result = day10.part1(self.input_list_example5)
     self.assertEqual(210, result)
def test_day10_part_1():
    number_list = [int(i) for i in test_input_data]
    assert day10.part1(number_list) == 220
示例#26
0
 def test_part1_input(self):
     result = day10.part1(aoc.read_input('day10.input'))
     self.assertEqual(269, result)
示例#27
0
 def test_part1(self):
     self.assertEqual(1917, day10.part1("../inputs/day10.txt"))
示例#28
0
def test_day10_part1():
    data1 = int_array_from_list("10.txt", test=True)
    data2 = int_array_from_list("10b.txt", test=True)
    assert day10.part1(data1) == (7 * 5)
    assert day10.part1(data2) == (22 * 10)
示例#29
0
def test_part1():
    assert part1(test_input) == 26397
示例#30
0
 def test_part1_larger_example(self):
     self.assertEqual(day10.part1(self.exampleInputLrg), 220)