We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aebda9f commit 208c6e0Copy full SHA for 208c6e0
cellular_automata/conways_game_of_life.py
@@ -30,8 +30,7 @@ def new_generation(cells: list[list[int]]) -> list[list[int]]:
30
cells[x][y] for x in range(i - 1, i + 2) for y in range(j - 1, j + 2)
31
if 0 <= x < len(cells) and 0 <= y < len(row) and (x != i or y != j)
32
)
33
- next_gen[i][j] = 1 if cell == 1 and 2 <= neighbours <= 3 or cell == 0 \
34
- and neighbours == 3 else 0
+ next_gen[i][j] = 1 if cell == 1 and 2 <= neighbours <= 3 or cell == 0 and neighbours == 3 else 0
35
return next_gen
36
37
def generate_images(cells: list[list[int]], frames: int) -> list[Image.Image]:
0 commit comments