Game of Life implementation inspired by Łukasz Langa's talk on EuroPython 2023.
Current implementation differs in that:
- it's simple, ASCII-art & terminal-based
- each evolutionary step of the game is visible in the terminal history
- a seed (initial board) can be passed in as a user input
That makes the game fun and easy to experiment with.
-
Clone the repo
-
Install the package locally in editable mode
$ make install-package
- Run the Game of Life with the sensible defaults
$ gol
- Use command line options to adjust the gameplay as needed
$ gol --seed docs/seeds/basic.txt \
--speed=10 \
--color-live=green \
--color-dead=white
- Get help
$ gol --help
A board seed can be provided as a file using --seed path/to/a/file
CLI option. The seed file must be a text file representing 2D
array. Dead cells represented by value 0
, live cells by the value
1
. Elements in a row separated by a single space character.
When the seed file is passed in, --size
option is ignored and
adjusted to the share of the seed array automatically.
See an example seed file in the repo.