コード例 #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],
     ]
コード例 #2
0
def day8_part_one():
    day8.part_one(DATA_DAY8, 25, 6)
コード例 #3
0
ファイル: test_day8.py プロジェクト: fgahr/aoc2015
 def test_p1_empty(self):
     self.assertEqual(day8.part_one(r'""'), 2)
コード例 #4
0
ファイル: test_day8.py プロジェクト: fgahr/aoc2015
 def test_p1_hex(self):
     self.assertEqual(day8.part_one(r'"\x27"'), 5)
コード例 #5
0
ファイル: test_day8.py プロジェクト: fgahr/aoc2015
 def test_p1_aaa(self):
     self.assertEqual(day8.part_one(r'"aaa\"aaa"'), 3)
コード例 #6
0
ファイル: test_day8.py プロジェクト: fgahr/aoc2015
 def test_p1_abc(self):
     self.assertEqual(day8.part_one(r'"abc"'), 2)
コード例 #7
0
ファイル: test_day8.py プロジェクト: Tohaker/AdventOfCode2019
 def test_part_one(self):
     input = ['123456789012']
     assert part_one(input, 3, 2) == 1