Game of Life
An interactive pygame implementation of Conway's Game of Life
Installation
Clone the repo and navigate into it.
git clone https://github.com/ethanavatar/Game-of-Life.git
cd Game-of-Life/
Install pygame if you don't have it already,
python -m pip install pygame
Usage
Run the main module using:
python main.py
A window will open with an initial state and start simulating immediately.
You can also use:
SPACE
to pause the simulationESCAPE
to clear the current boardR
to create a new random boardLEFT MOUSE
to add or remove cellsPERIOD
to pause and step one generation at a time
By default, the window is 1200x1200 pixels, the game board is 200x200 cells. It also runs as fast as it can unless the FPS cap is set manually. These constants are stored at the top of the App.py
file if you feel like changing them.
TODO
- undo
Long Term
- Allow for easier loading of initial states, as well as premade rules
- Allow for easier changing of the simulation's rules
- Make it faster for bigger board sizes
- Store the cells that changed between generations so the loop isnt going over cells that will be dead for a long time.