A single ant follows two absurdly simple rules and wanders in apparent chaos for ~10,000 steps โ then, out of nowhere, it locks into a periodic "highway" and marches off forever. Generalise the turn rule to any string over {L,R,N,U} for a whole zoo of multi-colour behaviours.
The ant is a tiny Turing machine: the grid is its infinite tape, each cell a symbol, and the ant is the read/write head. At every step it reads the colour under it, writes a new colour, turns, and moves โ a fixed transition table with no memory of its own.
Classic RL looks random for ~10k steps, yet it always escapes into a 104-step periodic highway that drifts diagonally forever. It's a proven theorem that the ant's trajectory is always unbounded โ but the highway emerging from the chaos has never been predicted analytically. Trivial local rules, genuinely surprising global order.
Type any string over L (left), R (right), N (no turn), U (u-turn). Its length = number of cell colours. A cell of colour i applies the i-th instruction, then increments to colour i+1 (mod n). Each colour gets its own hue.
Space play/pause ยท S step ยท C clear.
Run 10k computes 10,000 steps with no per-step drawing, then paints once โ the fastest way to reach the highway. Crank Steps/frame to run live at thousands of steps per second.