diff --git a/src/conway/gameoflife.py b/src/conway/gameoflife.py index 430355b..c07af59 100644 --- a/src/conway/gameoflife.py +++ b/src/conway/gameoflife.py @@ -96,6 +96,16 @@ def get_anime(size=100, steps=100, start="random"): anime = PlotlyAnimation(state, steps) return anime.animation +def get_starting_board(size, start=random): + # TODO: implement other starting options like e.g. glider + if start == "random": + return State(size, size, "random") + else: + return State(size, size, None) + +def start(size = 100, start="random"): + board = get_starting_board(size, start) + return PlotlyAnimation(board, size) def main(): # state = State(20, 20, [(0, 1), (1, 2), (2, 0), (2, 1), (2, 2)])