diff --git a/item_40_consider_coroutines.py b/item_40_consider_coroutines.py index bd5d511..d92b940 100644 --- a/item_40_consider_coroutines.py +++ b/item_40_consider_coroutines.py @@ -353,13 +353,13 @@ def assign(self, y, x, state): def live_a_generation(grid, sim): progeny = Grid(grid.height, grid.width) item = next(sim) - while item is (not TICK): + while item is not TICK: if isinstance(item, Query): state = grid.query(item.y, item.x) item = sim.send(state) else: progeny.assign(item.y, item.x, item.state) - item.next(sim) + item = next(sim) return progeny @@ -380,7 +380,6 @@ def live_a_generation(grid, sim): # --------- # --------- - # Now I can progress this grid forward one generation at a time. You can see # how the glider moves down and to the right on the grid based on the simple # rules from the game_logic function.