Simple implementation of Conway's Game of Life using Pygame and Numpy
You need to install the requirements (numpy and pygame). It's recommended that you do this inside a Python virtual environment:
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
You can run the game as follows:
./gol.py
Note that the game starts paused and with a blank board. See below.
- Use the left mouse click to toggle cells.
- Use the mouse wheel to speed up/slow down time.
- Press ESC to quit.
You can configure a few options using the command line. Running ./gol.py --help
will print a list of the supported arguments:
> ./gol.py --help
usage: gol.py [-h] [--rows ROWS] [--cols COLS] [--theme {default,grid,heatmap,heatmapgrid}] [--resx RESX] [--resy RESY]
optional arguments:
-h, --help show this help message and exit
--rows ROWS Number of rows in the board
--cols COLS Number of columns in the board
--theme {default,grid,heatmap,heatmapgrid}
Theme
--resx RESX Vertical resolution
--resy RESY Horizontal resolution
You can select among a few themes: