Skip to content
Snippets Groups Projects
Commit 2440abd0 authored by Boujerfaoui Yassine's avatar Boujerfaoui Yassine
Browse files

Changements inconnus

parent 998c0ee1
No related branches found
No related tags found
No related merge requests found
......@@ -29,9 +29,9 @@ def create_a_grid():
zones.append([])
for y in range(len(universe[0])):
if universe[x][y]==1:
zones[x].append(canvas.create_rectangle(x*width/100,(x+1)*width/100,y*width/100,(y+1)*width/100), fill="black")
zones[x].append(canvas.create_rectangle(x*width,(x+1)*width,y*width,(y+1)*width), fill="black")
else:
zones[x].append(canvas.create_rectangle(x*width/100,(x+1)*width/100,y*width/100,(y+1)*width/100, fill="white"))
zones[x].append(canvas.create_rectangle(x*width,(x+1)*width,y*width,(y+1)*width, fill="white"))
def update_grid():
"""met la grille a jours """
......@@ -57,8 +57,8 @@ def update_grid():
def create_cell_on_click(event):
"""créer une cellule vivante la ou l'utilisateur clique"""
global universe
x = event.x//(game_of_life.winfo_width()/100)
y = event.y//(game_of_life.winfo_height()/100)
x = event.x//(game_of_life.winfo_width())
y = event.y//(game_of_life.winfo_height())
universe[x][y] = 1
def add_seed_tk():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment