Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 1.47 KB

README.md

File metadata and controls

40 lines (24 loc) · 1.47 KB

Game of Life

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.

Rules

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.

Implementation

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.

Cloning the repository

git clone https://github.com/prateek-joshi/Game-of-Life.git

Requirements

matplotlib==3.3.4
numpy==1.20.1

Running the application

cd Game-of-Life\Game-of-Life
python main.py