python implementation of Conway's Game of Life. Tested on python 3.6
The game consist in a matrix of cells that can be either activate or inactive. Each step cells update by the following rules:
- For a cell that is active:
- Each cell with one or no active neighbors becomes inactive, as if by solitude.
- Each cell with four or more active neighbors becomes inactive, as if by overpopulation.
- Each cell with two or three active neighbors survives active.
- For a cell that is inactive
- Each cell with active three neighbors becomes active.
Usage:
pythonw app.py -s NUM_ROWS NUM_COLUMNS -ws WINDOW_WIDHT WINDOW_HEIGTH
pythonw app.py -f /path/to/file.json # initiallices from a previously saved state
You can toggle the state of a cell clicking on it.
space
: stepa
: toggle autoplays
: save the current state of the cells to a json filer
: restart the game, deactivating all the cellsq
: quit
- pygame
- numpy