Langton's Ant

Two rules, one ant, infinite complexity. Watch deterministic chaos resolve, after ~10,000 steps, into a perfect repeating highway — one of the most striking emergent phenomena in mathematics. Explore multi-colour turmite variants, zoom in, and skip ahead thousands of steps.

Rule: RL
Steps: 0
Ant: (200, 200)
Dir: N
Rule preset
Steps/frame
50
Zoom
1.0×
Actions

Drag to pan · mouse-wheel to zoom · white pixel = current ant position.

The Two Rules

At a WHITE cell: turn 90° right, flip cell to BLACK, step forward.
At a BLACK cell: turn 90° left,  flip cell to WHITE, step forward.

The ant starts at the centre facing North on an all-white grid. These two lines of rule produce behaviour so complex that it was conjectured for years that a clean long-term structure was impossible.

Phase 1: Chaos (~0–500)

The ant wanders unpredictably near the starting cell, building an irregular black-and-white island with no obvious structure.

Phase 2: Build-up (~500–10k)

A growing, seemingly random tangle. The step count at which the highway first appears varies but is always within ~10,000 for the standard rule on an infinite grid.

Phase 3: Highway (10k+)

The ant locks into a diagonal corridor that repeats with exact period 104, advancing 2 cells diagonally each cycle — an eternal, perfect structure from simple chaos.

Turing Completeness

Multi-colour generalisations are Turing-complete: any computation can be encoded as a turmite rule. The 2-colour classic ant is a universal computer candidate.

Rule Variants Reference

RuleColoursBehaviour
🐜 RL (Classic)2Chaotic wandering → deterministic highway after ~10,000 steps (period 104)
🌿 RLLLLRRRLLL11Fractal growth structure; highly complex self-similar region boundaries
🔷 LLRR4Fills half-plane, symmetric diagonal wedge pattern; no highway observed
🔶 RRLL4Symmetric bilateral tiling; mirror-image wedge from both sides
🌀 LRRRRRLLR9Highly complex, space-filling; classified as type Δ (irregular growth)
△ RLR3Triangle-based rotational symmetry; grows outward in hexagonal-ish pattern

The Highway in Detail

The classic Langton's Ant highway was identified empirically by Langton in 1986 and proved rigorously to persist indefinitely (given sufficient space) by various authors. The key insight is that the ant constructs a specific 5×5-cell glider-like structure that it then pushes along the diagonal. The glider has exactly 104-step period and translates by (2,−2) per cycle, meaning average speed 2√2 / 104 ≈ 0.027 cells per step.

Highway onset conjecture: For any finite configuration on an infinite grid with only finitely many black cells, the ant eventually enters a highway. This is believed true but remains unproven in general — one of the simplest-to-state open problems in mathematics.

Connection to Cellular Automata & Complexity

ConceptConnection to Langton's Ant
Conway's Game of LifeBoth are 2D deterministic CAs with universal computation capability; Life uses neighbourhood rules, the Ant uses a mobile agent
Wolfram Rule 110Simplest known 1D Turing-complete CA; Langton's Ant is the 2D mobile-agent analogue
Turing MachinesAn ant on a 1D tape with 2 colours recovers exactly a 2-state 2-symbol Turing machine; Langton extends this to 2D
Penrose TilingsRRLL and LLRR variants produce quasi-periodic patterns reminiscent of substitution tilings
Self-organised criticalityThe highway emergence is an example of self-organisation: global order arises spontaneously from local rules without external guidance

Frequently Asked Questions

Why does the highway always go diagonally?
The highway direction is determined by the exact configuration of black cells when the ant "discovers" it. On a symmetric all-white starting grid the glider structure that leads to the highway happens to propagate at 45° to the grid axes. Different starting configurations (or different rule strings) can produce highways in any of the four diagonal directions.
What are the coloured cells in multi-colour mode?
In multi-colour turmites, cells cycle through n colour states (0, 1, 2, …, n−1) instead of just black/white. Each colour maps to a turn direction given by the rule string character (R, L, U, or N). The ant increments the colour at each visited cell. With 11 colours (RLLLLRRRLLL) the ant traces an intricate fractal-like boundary that keeps growing indefinitely.
Can the ant ever return to all-white?
With the classic RL rule and a finite grid, the ant eventually visits every cell and repeatedly flips them — the grid state never settles. On an infinite grid, the number of black cells grows without bound after the highway is established, so the all-white state cannot recur (time-reversal symmetry is broken because the rule is not invertible in general for multi-colour variants, though the RL rule is bijective).

Related Simulations & Articles