add: day 10

This commit is contained in:
Charles
2024-12-10 21:03:22 -08:00
parent 05b61fffb9
commit f467526323
2 changed files with 45 additions and 11 deletions
+18
View File
@@ -0,0 +1,18 @@
import pygame
pygame.init()
screen = pygame.display.set_mode((570, 570))
with open("/home/charles/Downloads/input", 'r') as inputFile:
lines = [
[int(n) for n in line]
for line in inputFile.read().split('\n')
]
lines.pop()
for x in range(len(lines)):
for y in range(len(lines)):
val = lines[x][y]
screen.fill((0, 25 * val, 0), pygame.Rect(x * 10, y * 10, 10, 10))
pygame.display.flip()
pygame.image.save(screen, "day10vis.jpeg")
pygame.quit()