Local rules, arbitrary worlds.
Three families of cellular automata in one page. Conway's Life on a crisp grid, Wolfram's eight-bit rules drawn as a triangle of evolving rows, and Gray–Scott reaction–diffusion as smooth analog organic. Same idea, three lenses on emergence — the fact that nothing but a neighbourhood rule, run many times, can produce patterns indistinguishable from animal markings, weather, or computation itself.
Three lenses on emergence
§ 02 · Notesrule 30 is so chaotic it was once used as a random number generator in Mathematica. Class 4 — rule 110 — is provably universal.Implementation notes — rules, neighbourhoods, and time-stepping
Life is a 120 × 72 toroidal grid of bytes, double-buffered.
Each step counts the eight Moore neighbours per cell and applies
B3/S23. The canvas is filled by an ImageData
buffer at native cell resolution then scaled up with
image-rendering: pixelated so the grid stays crisp.
Wolfram elementary rules treat the row as a 1-D toroidal
lattice. For each cell, the triple (left, self, right)
indexes one of eight rule bits — the rule number's binary expansion.
We draw the entire triangle row-by-row into a single
ImageData the size of the canvas; the whole image is one
DOM blit.
Gray–Scott integrates
∂U/∂t = Dᵤ ∇²U − UV² + F(1−U) and
∂V/∂t = Dᵥ ∇²V + UV² − (F+k)V with the discrete
five-point Laplacian (weight 1 for orthogonal neighbours,
0.05 diagonal — actually a nine-point stencil), explicit
Euler at Δt = 1. Several substeps run per animation
frame so the chemistry looks fluid at sixty hertz.
Every preset is just a pair of feed and kill values: spots at
(0.037, 0.065), stripes at (0.040, 0.060),
mitosis at (0.0367, 0.0649), coral at
(0.054, 0.062), maze at (0.029, 0.057),
and the famous U-skate world at (0.062, 0.0609).