The Game of Life is a cellular automaton devised by the British mathematician John Conway in 1970. The game is a zero-player game, meaning that its evolution is determined by its initial state. The Game of Life is played on a two-dimensional orthogonal grid of square "cells." Each cell has 2 states, either alive or dead, and also interacts with each of its 8 neighbors. Its neighbors are the cells that are horizontally, vertically, and diagonally adjacent to the cell. At each step in time, the following transitions take place...
Any live cell with fewer than two live neighbors dies, as if by underpopulation.
Any live cell with two or three live neighbors lives on to the next generation.
Any live cell with more than three live neighbors dies, as if by overpopulation.
Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.