Esempio n. 1
0
 def test_day_eight(self):
     input = download_input(8)
     assert day8.part_one(input) == 1560
     assert day8.part_two(input) == [
         [1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0],
         [1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0],
         [1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0],
         [1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0],
         [1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0],
         [0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0],
     ]
Esempio n. 2
0
def day8_part_one():
    day8.part_one(DATA_DAY8, 25, 6)
Esempio n. 3
0
 def test_p1_empty(self):
     self.assertEqual(day8.part_one(r'""'), 2)
Esempio n. 4
0
 def test_p1_hex(self):
     self.assertEqual(day8.part_one(r'"\x27"'), 5)
Esempio n. 5
0
 def test_p1_aaa(self):
     self.assertEqual(day8.part_one(r'"aaa\"aaa"'), 3)
Esempio n. 6
0
 def test_p1_abc(self):
     self.assertEqual(day8.part_one(r'"abc"'), 2)
Esempio n. 7
0
 def test_part_one(self):
     input = ['123456789012']
     assert part_one(input, 3, 2) == 1