Field card
File: langtons-ant.html
Pattern: emergence as sudden order in time — a two-rule automaton that scribbles apparent chaos
for ~10,000 steps and then, unannounced, locks into a periodic "highway" and drives off forever. The
Byrne grammar at its barest: a flipped square is solid black on bare paper, the actor is yellow.
Companions: busy-beaver.html and collatz.html (the emergence-
in-time trio); the Truchet series for the same "no local step knows the global shape".
The brief that produced it
Langton's Ant as a studio study. One idea: a tiny deterministic rule produces long chaos and then spontaneous order — the highway — with nothing in the rules to announce it. Let the reader play, step, and jump straight to the moment it happens. Black-on-paper, a yellow ant, watch the road appear. Then (added after a conversation about whether every start highways): make the starting field a choice — blank, paint your own, or a random patch — so the reader can test it by hand.
Three start modes (one embeddable file)
A CONFIG = { mode, lockMode } at the top of the script picks the start; set lockMode:true to hide
the selector for a fixed embed. So the same file ships three ways:
blank — the classic empty grid (highway at ~step 9,976);
paint — click cells to draw a finite starting field, then run;
random — autoseed a finite patch; "new field" reseeds.
When unlocked, a blank/paint/random selector lets one instance do all three.
Source of truth
Simulated live with the standard rule (white → turn right, flip black, step; black → turn left, flip white, step). The emergent facts were verified by simulation before framing: from the blank grid the highway begins at ~step 9,976, repeats with period 104, and drifts by (2, 2) per cycle.
Because the onset is not fixed once you allow other starting fields, the widget detects the highway live by its signature — three or more consecutive 104-step periods that each translate by the same (±2, ±2). On the blank grid that detector reproduces the ~9,976 onset (verified: it pauses at ~10,400, i.e. onset + 4 cycles); on painted/random fields it finds each field's own onset (e.g. 11,856 for a small painted L, 3,640–9,672 for assorted random patches).
The view auto-fits the black cells, then follows the ant once the structure outgrows a readable zoom — so the chaotic core frames first and the blue highway keeps being drawn at legible size.
Honesty check
Two different statements, kept distinct: it is a proved theorem (Cohen–Kong / Bunimovich–Troubetzkoy) that from any finite starting field the ant's trajectory is always unbounded — it can never be trapped in a finite region. But that the escape takes the form of the highway is an empirical observation, not proved inevitable for every finite start (and on infinite backgrounds the highway can be prevented). The paint/random modes lean into exactly this: finite scribbles still always find a highway in practice, but the widget's prose says "in practice", not "always", and the thread-back draws the proved-vs-observed line explicitly so the study never overclaims.
Design choices worth keeping
The reveal is the interaction. "Jump to the highway" + play is the whole pedagogy: chaos, then a road, with the phase readout flipping from scribbling to the highway. Playing from the start auto-pauses once a blue road section is visible (a few cycles past the detected onset) so you catch the transition and see why it stopped, then you press play again to drive on the highway forever.
Colour separates the two regimes. Cells flipped during the chaotic phase are ink black; cells laid once the highway begins are Byrne blue — so the ordered road visibly peels away from the disordered blob. Colour is state (chaos vs highway), never decoration; the ant stays yellow.
Camera that fits then follows. While the structure is small it auto-fits; once it outgrows a readable zoom the view follows the ant, so the blue road keeps being laid down at a legible size instead of shrinking to nothing.
Accessible by construction:
sr-onlytelling of the rule and the lesson; keyboard parity (space plays, right steps, R resets); the phase/step readout states what's happening in words.Thread-back: "is this order inevitable, or could it scribble forever?" opens the Cohen–Kong unboundedness result vs the open status of the highway.
What it teaches the studio
The Truchet plates show emergence in space; Busy Beaver and Collatz show it in time as length and as open halting. Langton adds the fourth face: spontaneous order — chaos that abruptly organises itself — from a rule you could explain to a child. And it sharpens the studio's honesty habit into a single clean distinction the card insists on: unbounded is proved; the highway is observed.