Draw completed.

This commit is contained in:
KikooDX 2020-05-30 17:07:01 +02:00
parent 2bbf6166c0
commit a14c93b5c3
1 changed files with 10 additions and 1 deletions

11
gol.py
View File

@ -6,7 +6,17 @@ C_WHITE = (255, 255, 255)
mat_height = 32
mat_width = 32
mat = [[randint(0, 1) for _ in range(mat_width)] for _ in range(mat_height)]
x = 0
y = 0
for line in mat:
for cell in line:
if cell:
set_pixel(x, y, C_BLACK)
x += 1
x = 0
y += 1
while True:
show_screen()
mat_rem = [list(e) for e in mat]
for y in range(mat_height):
for x in range(mat_width):
@ -27,4 +37,3 @@ while True:
if state != was_state:
mat[y][x] = state
set_pixel(x, y, (C_BLACK if state else C_WHITE))
show_screen()