This is a simple Python module implementing Conway's Game of Life, with a curses-based UI.
The game runs on a torus (i.e. the edges of the screen are connected). Default size is 100x100.
From GitHub:
$ git clone https://github.com/wlof/gameoflife
$ cd gameoflife
$ sudo python setup.py install
If you're running Windows, you will need to install the unofficial curses library. Download it from http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses.
If you want to use the slightly faster NumPy/SciPy implementations, you will of course have to install these libraries: http://www.scipy.org/scipylib/download.html
After installation, run the game using:
gameoflife
There a few arguments you can use:
usage: gameoflife [--impl {normal,light,numpy,numpy-light}] [--width WIDTH]
[--height HEIGHT] [--prob PROB] [--color {auto,yes,no}]
[--version] [--help]
Conway's Game of Life
optional arguments:
--impl {normal,light,numpy,numpy-light}, -i {normal,light,numpy,numpy-light}
game implementation
--width WIDTH, -w WIDTH
grid width
--height HEIGHT, -h HEIGHT
grid height
--prob PROB, -p PROB initial population probability
--color {auto,yes,no}, -c {auto,yes,no}
use colors
--version show program's version number and exit
--help show this help message and exit
Suggestions and bug reports are greatly appreciated:
https://github.com/wlof/gameoflife/issues
There are four different implementations that you can use (with the --impl
command line argument):
The cells are represented as follows:
*
: the cell will die of isolation in the next generationo
: the cell will survive in the next generationO
: the cell will die of overcrowding in the next generationAdditionally, the color of each cell indicates its age:
During the game, you may use the following keys: