First try on day 8

master
Arne Wischer 6 years ago
parent d4d07b133c
commit 6cd82b1dae
  1. 20
      days/day8.py
  2. 1
      days/input/day8_input

@ -0,0 +1,20 @@
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()

@ -0,0 +1 @@
123456789012
Loading…
Cancel
Save