19 lines
521 B
Python
19 lines
521 B
Python
|
|
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()
|