Back to the blog
Development / DEVELOPMENT NOTES

Conway’s Game of Life in JavaScript

A cellular automaton with a grid, two cell states, and patterns that evolve from one generation to the next.

Conway’s Game of Life is a cellular automaton. Its universe is described as a two-dimensional grid in which each cell is either alive or dead.

This project implements it in JavaScript to observe how a set of local rules produces patterns that change over time.

From one generation to the next

A cell’s next state depends on its neighbours. To produce a complete generation, every decision must use the same previous state rather than a mixture of updated and pending cells.

A browser implementation uses a finite representation. The grid’s size and the way its boundaries behave are part of that adaptation of the model.

Observe before changing

Try different starting arrangements and watch them evolve. The source code connects the visible changes to the board’s representation and update process.

Source code

Explore the project on GitHub

Written by Sergio Soriano

Development, curiosity, and shared projects.

About Sergio Soriano