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.
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.
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
- Ant / trail color recolours the flipped cells and the ant's marker.
- Steps / frame speeds up or slows down how fast the ant moves.
- The grid reseeds once the highway has run far enough to leave the visible area.
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.