add: day 10
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user