Skip to content

A simple implementation of Conway's Game of Life in Python

Notifications You must be signed in to change notification settings

prateek-joshi/Game-of-Life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 

Repository files navigation

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

About

A simple implementation of Conway's Game of Life in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages