This commit is contained in:
Sebastian Seedorf
2022-12-10 12:39:25 +01:00
parent a4adcd4968
commit 077d10fe86
3 changed files with 169 additions and 0 deletions

14
day10/part2.py Normal file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env python3
lines = (x.strip() for x in open("input.txt"))
sprite = 0
crt = ''
for line in lines:
crt += '#' if sprite <= len(crt) % 40 < sprite + 3 else ' '
if line[0] == 'a':
crt += '#' if sprite <= len(crt) % 40 < sprite + 3 else ' '
sprite += int(line[5:])
for i in range(6):
print(crt[i*40:i*40+40])