Skip to content

Commit

Permalink
Fix GameOfLifeColor to test augmented assigns (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
a5kin committed Mar 25, 2019
1 parent a047730 commit 92abe4c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions examples/game_of_life.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,11 @@ class access, not via ``super``.
"""
GameOfLife.absorb(self)
red_sum = core.IntegerVariable()
for i in range(len(self.buffers)):
red_sum += self.neighbors[i].buffer.red + 1
green_sum = core.IntegerVariable()
for i in range(len(self.buffers)):
green_sum += self.neighbors[i].buffer.green + 1
blue_sum = core.IntegerVariable()
for i in range(len(self.buffers)):
red_sum += self.neighbors[i].buffer.red + 1
green_sum += self.neighbors[i].buffer.green + 1
blue_sum += self.neighbors[i].buffer.blue + 1
self.main.red = red_sum * self.main.state
self.main.green = green_sum * self.main.state
Expand Down

0 comments on commit 92abe4c

Please sign in to comment.