You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
485 B
20 lines
485 B
import unittest
|
|
import os
|
|
|
|
|
|
class Day8(unittest.TestCase):
|
|
inputfile = os.path.join(os.path.dirname(__file__), "input/day8_input")
|
|
|
|
def test_day8a(self):
|
|
width = 3
|
|
height = 2
|
|
with open(self.inputfile) as fp:
|
|
img = [int(k) for k in str(fp.readline())]
|
|
|
|
layers = [img[b:e] for b, e in zip([0, 6], [6, 12])]
|
|
for l in layers:
|
|
print(l.count(0))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
Day8().test_day8a()
|
|
|