Skip to content
Snippets Groups Projects
Commit 2f51008a authored by Dolleans Geoffrey's avatar Dolleans Geoffrey
Browse files

tkinter 8/many

parent 3f5bf72f
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ from game_of_life.generate_universe import *
from game_of_life.generation import *
from game_of_life.survival import *
from game_of_life.add_seed import *
from game_of_life.Affichage_universe import *
import random as rd
fenetre = Tk()
......@@ -18,6 +19,7 @@ ligne_texte.pack()
def create_a_grid():
"""create the grid for the graphic interface"""
global universe
print("création de la grille")
universe = generate_universe((100,100))
width = game_of_life.winfo_width()
heigth = game_of_life.winfo_height()
......@@ -44,14 +46,14 @@ def update_grid():
for x in range(len(universe)):
for y in range (len(universe[0])):
if universe[x][y] == 0:
if naissance(universe[x][y]) == 1:
if naissance(universe,(x,y)) == 1:
"colorier la case zones[x][y] en vert"
canvas.itemconfig(zones[x][y], fill="green")
else:
"colorier la case zones[x][y] en banc"
canvas.itemconfig(zones[x][y], fill="white")
else:
if survival(universe[x][y]) == 0:
if survival(universe,(x,y)) == 0:
"colorier la case zones[x][y] en rouge"
canvas.itemconfig(zones[x][y], fill="red")
else:
......@@ -90,6 +92,4 @@ create_a_grid()
canvas.bind("<Button-1>", create_cell_on_click)
fenetre.mainloop()
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