Game of Life
Conway's Game of Life running live: a 150 × 150 board stored as one list, stepped ten times a second by an action, drawn as a heatmap.
Conway's Game of Life is a cellular automaton on a square grid. Every cell is alive or dead, and all cells update together, once per generation, from the count of their eight neighbours: a dead cell with exactly three live neighbours is born, a live cell with two or three neighbours survives, and every other cell dies or stays dead. These three rules, with no player and no randomness, produce gliders that travel, oscillators that blink forever, guns that emit an endless stream of gliders, and patterns that compute anything a computer can.
This document keeps the whole 150 \times 150 board in one list S of N^2 cells, in row-major order, so the cell at (x, y) is S[1 + x + Ny] . The neighbour count n is built without any loop: rotating the list by one position lines every cell up with its horizontal neighbour, rotating by N lines it up with its vertical neighbour, and rotating by N \pm 1 with a diagonal one. Eight rotations added together give every cell's live-neighbour count at once, and the wrap-around of the rotation makes the board a torus, so a glider leaving the right edge re-enters on the left. The action cell rewrites S from n ten times a second with a single piecewise rule; the heatmap reads the board back through the list index and paints live cells black.
The opening board is a Gosper glider gun, the first pattern found to grow without bound, caught at generation 120 so its stream of gliders is already on its way. At the end of the stream an eater, a small still pattern, absorbs each glider and stays as it was, so the whole picture repeats exactly every 30 generations. The document opens on this part of the board; zoom out to see the rest. Pause the action to freeze a generation, or edit the list to plant your own pattern. After Fabrice Neyret's Desmos graph 2lzec8zwrz.
JavaScript is required to view the interactive plot.