Skip to content

Commit

Permalink
animate the glider on the gui
Browse files Browse the repository at this point in the history
  • Loading branch information
nitsanavni committed Nov 10, 2023
1 parent 4a2e6bc commit 63b28b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@ def __init__(self, game_of_life,width=10,height=10):
self.root = tk.Tk()
self.root.title("Game of Life")
self.cell_size = 10
self.frame_duration = 400
self.cells = {}
self.create_widgets()

def show(self):
self.root.after(self.frame_duration, self.advance_turn)
self.root.mainloop()

def advance_turn(self):
self.game.advance()
self.update_cells()
self.root.after(self.frame_duration, self.advance_turn)

def create_widgets(self):
for x in range(self.width):
Expand Down

0 comments on commit 63b28b7

Please sign in to comment.