Afterglowscreensavers

Langton's Ant Screensaver

Langton's Ant is a cellular automaton where one ant follows two rules — turn right on a white square and flip it black, turn left on a black square and flip it white. From a blank grid it produces real chaotic scribbles for about 10,000 steps, then locks into an endless diagonal "highway" pattern forever.

Live preview

Langton's Ant screensaver — One ant, two rules, an endless highway.

Press ESC to leave fullscreen. Settings are saved in your browser only.

How the Langton's Ant screensaver works

A single ant sits on an infinite grid of white cells. Each step it looks at the cell beneath it: on white, it turns 90° right, flips the cell to black, and moves forward; on black, it turns 90° left, flips the cell to white, and moves forward.

Those two rules are the entire program — there is no other logic, no randomness, and no plan.

For roughly the first 10,000 steps the ant's path looks genuinely chaotic and symmetric, building strange little clusters.

Then, reliably, it locks into a repeating 104-step cycle that builds a diagonal "highway" of black and white cells extending outward forever.

Chris Langton's ant and the limits of prediction

The ant was invented in 1986 by Chris Langton. It runs on a square grid of black and white cells: a single agent reads the cell beneath it, turns, flips the cell and steps forward, according to a fixed table. Everything about its behaviour follows deterministically from the starting grid.

What makes it famous is that, on an empty grid, the early path often looks simple and symmetric, then turns messy, and finally settles into a repeating 104-step pattern called the highway. Every finite starting configuration that has been tried ends up building the highway, which suggests it is an attractor, but nobody has proved that this always happens. What has been proved, by Bunimovich and Troubetzkoy in 1992, is that the ant’s path is unbounded from any starting configuration.

The rule is also computationally rich. Gajardo and colleagues built a construction in which one ant’s trajectory computes any boolean circuit, so it can emulate logic gates. Variants by Turk and Propp use more colours, each assigned a left or right turn applied in cycle: Langton’s original is named RL, and LLRR grows symmetrically.

A worked example

Watch the counter climb: for the first few thousand steps the trail looks like scattered noise. Then a diagonal staircase pattern emerges from the mess and starts marching steadily toward one corner — that's the highway, and once it appears it never breaks.

Settings & tips

Frequently asked questions

Why does it look random at first?
The two rules genuinely produce chaotic, hard-to-predict paths for around the first 10,000 steps before order emerges.
Does the highway pattern always appear?
Yes — it's a proven property of this rule set starting from a blank grid; order always emerges eventually.
Is a key needed?
No — it's a pure local computation with no network calls.
Is it free?
Yes — free, no download, in your browser.
Has anyone proved the highway always appears?
No. Every finite starting configuration tested ends in the highway, but a proof for all configurations is still missing. It has been proved that the ant’s path is unbounded from any starting configuration.
Can the ant do real computation?
In a sense. A construction by Gajardo and colleagues uses one ant’s trajectory to compute any boolean circuit, so the system can emulate logic gates.

← All Generative screensavers