cellular_automata.conways_game_of_life

Conway’s Game of Life implemented in Python. https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

Attributes

BLINKER

GLIDER

images

Functions

generate_images(→ list[PIL.Image.Image])

Generates a list of images of subsequent Game of Life states.

new_generation(→ list[list[int]])

Generates the next generation for a given state of Conway's Game of Life.

Module Contents

cellular_automata.conways_game_of_life.generate_images(cells: list[list[int]], frames: int) list[PIL.Image.Image]

Generates a list of images of subsequent Game of Life states.

cellular_automata.conways_game_of_life.new_generation(cells: list[list[int]]) list[list[int]]

Generates the next generation for a given state of Conway’s Game of Life. >>> new_generation(BLINKER) [[0, 0, 0], [1, 1, 1], [0, 0, 0]]

cellular_automata.conways_game_of_life.BLINKER = [[0, 1, 0], [0, 1, 0], [0, 1, 0]]
cellular_automata.conways_game_of_life.GLIDER = [[0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0,...
cellular_automata.conways_game_of_life.images