Put stones on a board. Each turn, every stone counts the stones around it. With too few it dies alone, with too many it's crowded out, and an empty point with exactly three stones around it gets a new stone. From four rules like these come blinkers, gliders that crawl across the board, and guns that fire them forever.
Tap a point to place or take away a stone. Every board also works from the keyboard: Tab to it, move with the arrow keys (Shift moves further), and press Space to place or take away a stone. In whichever station you're using, N steps forward and B steps back, and on the big board P plays and pauses.
Station 1
Eight neighbors, four rules
Every point on the board has eight neighbors: the points above, below, beside it, and on the four diagonals. A stone is a living cell. Each step, every point counts its living neighbors and follows one of the rules beside the board, and every point changes at the same moment. Turn on the counts, tap any point to see which rule it follows, and press Step.
A living cell with fewer than 2 living neighbors dies, as if lonely.
A living cell with 2 or 3 living neighbors stays alive.
A living cell with more than 3 living neighbors dies, as if crowded.
An empty point with exactly 3 living neighbors gets a new stone.
Every other empty point stays empty.
Try
Station 2
Count the neighbors, not the board
You could store the whole board and check every point on it, empty or not. This page keeps only a list of the living cells, as row and column pairs, and works out the next step from that list in three moves. Each living cell names its eight neighbors. Count how often each point was named. Keep the points named 3 times, and the living ones named 2 times. A point's count is exactly its number of living neighbors, because only living cells do the naming. Press Next to watch it happen one move at a time. Station 3 lines the same step up in eight languages, and Station 4 runs it on a much bigger board.
The living
Name neighbors
Count
Keep
Next generation
Start from
Station 3
One idea, eight languages
Here is Station 2's step written eight ways. Each one takes a set of living cells and makes the same three moves: name the neighbors, count them, keep the 3s and the living 2s. None of them loops over the board, checks for edges, or keeps a second board to write into. Pick a part of the step to light it up in all eight at once, or use the same buttons beside any language without scrolling back up. Each language gets a note on how it does that part.
Highlight
Data in, data out.step takes a set and returns a new one. It reads nothing else and changes nothing, so every board on this page shares it, and the Back buttons work by keeping the old sets.
The rules fit in one line. Four rules become n == 3 or (n == 2 and alive), in every language here.
One test says a lot. Step a blinker twice and you're back where you started: step(step(blinker)) == blinker. Each of the eight versions passes it.
The data structure does the work. As the blog post puts it, The wrong data structure has to be supported by code. The right data structure supports the code. Open the whole-board version below to see the code it saves.
Compare: a whole-board version
Store every point as a 0 or a 1 and the step has to visit every one of them, empty or not, and check each neighbor against the edges so the counting doesn't run off the board. It still returns a new board, so it's just as pure. It also needs a board size chosen up front, and a glider that reaches the edge stops being a glider.
Station 4
Gliders, guns, and long lives
Same rules, same step function, on a board big enough to watch patterns travel. Pick a pattern and press Play, or drag across the board to draw your own. A few cells can keep busy for thousands of generations. The board is only a window: cells that drift past its edge keep living, and zooming out shows them again.
Speed
Zoom
Things to notice
Every point changes at once. The step function reads the old list and builds a brand new one, so no point ever sees a neighbor that has already changed. Update the board in place, one point at a time, and the points you reach later would count neighbors from two different generations.
There's no code for dying. Look at Station 2's Keep move. Only the points that live are kept, and everything else is left out. A living cell with no living neighbors is never even named, so it disappears without being checked.
Only the living take up room. Because the list holds living cells and nothing else, the board has no size. A glider can fly as far as it likes. On the big board, cells that get hundreds of points past the window are let go so a gun can run all day without slowing down, which is the one place this page bends the rules.
Nothing in the rules says move. Each rule talks about one point and its neighbors, yet the glider's five cells rebuild themselves one point over every 4 generations. Movement is something you see in the pattern, not something any cell does.
Birth is picky. An empty point needs exactly 3 living neighbors. With 2 it stays empty and with 4 it stays empty. Try Station 1's Block: every empty point around it has at most 2 living neighbors, so it never grows.
Small seeds, long lives. The R-pentomino is 5 cells and takes 1103 generations to settle. There's no shortcut for knowing what a pattern will do: in general the only way to find out is to run it and watch.
A little history
A rule hunted for by hand. John Horton Conway, a mathematician at Cambridge, started trying rules for cells on a grid in 1968. He wanted patterns that seemed able to grow forever but where that would be hard to prove. He worked them out on a Go board with stones for the living cells, which was slow and easy to get wrong.
The glider. Richard K. Guy spotted the first glider in 1969, while Conway's group was following the R-pentomino.
Martin Gardner's column. Life reached the world in Gardner's Mathematical Games column in Scientific American in October 1970. Conway offered $50 to the first person who could settle whether any pattern grows without limit before the end of the year.
The gun. In November 1970 a team at MIT led by Bill Gosper won the prize with the glider gun in Station 4. It fires a new glider every 30 generations, so it never stops growing.
Computers joined in early. The first interactive Life program ran on a PDP-7, written by M. J. T. Guy and S. R. Bourne.
Life can compute. In Winning Ways for Your Mathematical Plays (1982), Elwyn Berlekamp, Conway, and Guy showed that gliders, guns, and patterns that eat gliders can be wired together into a computer. So Life can work out anything a computer can.
Mixed feelings. Conway came to dislike that Life overshadowed work he thought deeper, though he stayed proud of it. He died on 11 April 2020, of COVID-19.
The code on this page. Christophe Grand wrote the two-function Clojure version in 2011. Stephen Ball translated it to Elixir for this page's first version, a Phoenix LiveView app, and walks through it in Conway's Game of Life: A Functional Approach. This version is the same idea in JavaScript, running in your browser.
Elwyn R. Berlekamp, John H. Conway, and Richard K. Guy, Winning Ways for Your Mathematical Plays, vol. 2 (Academic Press, 1982), chapter 25, "What Is Life?"
Pattern names and shapes follow LifeWiki. The generation counts in Station 4's notes were checked by running each pattern with this page's step function.