/Conways_Game_of_Life

Figuring out how mathematical game "Life" works with React Hooks, Immer.

Primary LanguageJavaScript

Conway's Game of Life Challenge

image

About

This is about Conway's brainchild, a fantastic solitaire pastime he calls "life". Because of its analogies with the rise, fall and alternations of a society of living organisms, it belongs to a growing class of what are called "simulation games"--games that resemble real-life processes.

The basic idea is to start with a simple configuration of counters (organisms), one to a cell, then observe how it changes as you apply Conway's "genetic laws" for births, deaths, and survivals.

image

Conways genetic laws are delightfully simple. First note that each cell of the checkerboard (assumed to be an infinite plane) has eight neighboring cells, four adjacent orthogonally, four adjacent diagonally. The rules are:

1. Births

Each empty cell adjacent to exactly three neighbors--no more, no fewer--is a birth cell. A counter is placed on it at the next move. 1

2. Survivals.

Every counter with two or three neighboring counters survives for the next generation. 2

3. Deaths.

Each counter with four or more neighbors dies (is removed) from overpopulation. Every counter with one neighbor or none dies from isolation.

3

Prototype

Made with Figma. Helps to the process of building component's and view of the game.

prototype

Diagram Flow

Made with LudidChart. You can find the link here. automatcellsdiagramflow

Demo

Mobile

mobilegif

Desktop

automatcellsgif

Used Technologies
Resources