Board

Board class to represent the game board

Methods

init

Parameters

namedescriptiondefault

self

m

n

init

str

return the str representation of a Board object * represents a live cell, and a space represents a dead one

Parameters

namedescriptiondefault

self

population

population — the number of live cells on the board

Parameters

namedescriptiondefault

self

count_live_neighbours

count the live neighbours of a cell

Parameters

namedescriptiondefault

self

x

y

next_cell_state

Parameters

namedescriptiondefault

self

x

y

next_board_state

return board configuration for the next state

Parameters

namedescriptiondefault

self

advance_state

update the board configuration with the config for the next state

Parameters

namedescriptiondefault

self

has_live_cells

return whether there are any live cells or not

Parameters

namedescriptiondefault

self

Last updated