A (mostly) object-oriented implementation of John Horton Conway's Game of Life (1970) as a graphical user interface. The Game of Life is a Turing complete cellular automaton, with evolution determined entirely by its initial state. This implementation is written in Python, using the Pygame library.
Game of Life is a cellular automaton that involves a universe of square cells, arranged in a grid. A cell can either be alive or dead, and interacts with neighbours, in all 8 directions (Moore neighbourhood). At each time step, each cell follows these rules:
- A live cell with less than 2 alive neighbours dies (starvation)
- A live cell with 2 or 3 alive neighbours remains alive
- A live cell with more than 3 alive neighbours dies (overpopulation)
- A dead cell with exactly 3 alive neighbours becomes live (reproduction)
Currently, this version of Game of Life only allows for random initial seeds; future versions will support user input to customise the initial state.
Prerequisites are viewable in requirements.txt
.
Clone with:
git clone https://github.com/talhaahussain/Game-of-Life-GUI.git gameoflife
cd gameoflife/
Install prerequisites with:
pip install -r requirements.txt
Run with:
cd src/
python gameoflife.py
Boids-GUI - (in development)