The Game of Life, also known simply as Life, is a cellular automaton. It is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves.
The Game of Life consists of a two dimensional grid (usually squares) consisting of cells, which are in either of two states: alive, or dead. Each cell interacts with its adjacent neighbours; at each step in time, the following transitions can occur:
1 Any live cell with two or three live neighbours survives.
2. Any dead cell with three live neighbours becomes a live cell.
3. All other live cells die in the next generation. Similarly, all other dead cells stay dead.
This has been implemented by plotting the grid as a heatmap using the matplotlib module. The plot also displays the iteration number as well as the number of active (living) cells on the grid at each iteration.
git clone https://github.com/prateek-joshi/Game-of-Life.git
matplotlib==3.3.4
numpy==1.20.1
cd Game-of-Life\Game-of-Life
python main.py