🐜 Langton's Ant

Langton's Ant is a two-dimensional Turing machine with surprisingly complex emergent behaviour from just two rules: when on a white cell, turn right 90°, flip the cell to black, move forward; when on a black cell, turn left 90°, flip the cell to white, move forward (RL rule). After an initial chaotic phase (~10,000 steps), the ant spontaneously builds a periodic diagonal highway that repeats every 104 steps — a classic example of emergence. Generalised turmites use more colours; select a preset rule to explore them. 🇺🇦 Українська

Ant rule

RL (classic) RLR LLRR RLLR LRRL RRLL RLLRR
Steps0
Ant position
Colored cells0

Emergence and Turing completeness

Despite the trivial rule set, Langton's Ant is Turing-complete: any computation can be encoded in its grid state. The emergent highway was proved never to be stationary (Chris Langton, 1986); whether the ant always eventually builds a highway for any finite initial configuration remains an open conjecture. Multi-colour generalisations (turmites) can generate space-filling curves, symmetric patterns, and fractal-like structures — explored through the preset rules above.

About Langton's Ant

Langton's Ant is a two-dimensional cellular automaton devised by Christopher Langton in 1986. An "ant" sits on an infinite grid of black and white cells and follows two deterministic rules: on a white cell, turn 90° clockwise, flip the cell to black, move one step forward; on a black cell, turn 90° anticlockwise, flip the cell to white, move forward. Despite these utterly simple rules, the ant exhibits complex emergent behaviour — roughly 10,000 steps of apparently chaotic, pseudo-random wandering — before spontaneously settling into a periodic diagonal "highway" pattern that repeats every 104 steps indefinitely. The system is Turing-complete: with additional colour states, Langton's ant variants can simulate any computation.

The simulation lets you adjust speed, enable multiple ants with distinct colour-rule strings (called "turmites"), and observe how interactions between ants produce unexpected collective behaviours. You can also customise the rule string (e.g., "LR", "RLL", "LRRRRRLLR") to generate completely different emergent structures.

Frequently Asked Questions

Why does the highway pattern emerge after ~10,000 steps?

The appearance of the highway around step 10,000 is one of the most studied examples of emergence in simple systems, but there is no complete mathematical proof of why it happens at that particular step count for a blank starting grid. It has been verified computationally for every standard starting configuration; the highway is a period-104 attractor. Proving that the highway always emerges for all initial conditions remains an open conjecture in mathematics.

Is Langton's Ant Turing complete?

Langton's original two-colour ant alone is not proven Turing complete, but multi-colour variants called turmites are: Turmite rule RL (two colours, two states) was shown by Gajardo, Moreira, and Goles in 2002 to simulate Rule 110 cellular automaton, which is Turing complete. This means that with the right initial configuration, a turmite can compute any function a modern computer can, given sufficient time and space.

What is the "highway" and what does it look like?

The highway is a periodic diagonal stripe pattern that the ant produces after the chaotic transient phase ends. It repeats with a period of exactly 104 steps, advancing diagonally by 2 cells per period. The visual pattern resembles a repeating herringbone tile. Once the highway is established, the ant never reverts to chaotic behaviour; the highway grows indefinitely until the ant reaches the edge of a finite grid.

What happens if you place two ants on the same grid?

Two ants interacting on the same grid can produce a huge variety of outcomes depending on their starting positions and orientations: some configurations result in both ants producing highways in different directions, others lead to complex mutual interference that prevents either highway from forming, and some produce stable cyclic patterns. Multi-ant systems are much harder to analyse theoretically and are often studied computationally.

What are turmites and how do they generalise Langton's Ant?

A turmite is a 2D Turing machine on a grid: it has an internal state (like a Turing machine head state) in addition to the cell colour, and the rules specify: (new cell colour, turn direction, new internal state). Langton's original ant is the simplest turmite with 1 internal state and 2 cell colours. The space of 2-state 2-colour turmites contains 2,592 distinct rules; a handful produce highways, some produce chaotic patterns, and a few are computationally universal.

Can Langton's Ant be studied on other grid topologies?

Yes. Variants have been studied on triangular and hexagonal grids, on tori (finite grids with periodic boundary conditions), and even on Cayley graphs of groups. On a torus the ant must eventually revisit a state and enter a cycle, so the highway or other periodic attractor is guaranteed; on an infinite grid the convergence to the highway remains conjectural.

What is the relationship between Langton's Ant and Rule 110?

Rule 110 is a 1D elementary cellular automaton proved Turing complete by Matthew Cook in 2004. The connection to Langton's Ant comes through turmites: the turmite rule corresponding to "RL" was shown to embed Rule 110 simulations in its behaviour. This is significant because it anchors the Turing-completeness of turmite systems to an independently proved Turing-complete system rather than relying on a direct construction.

Does Langton's Ant always produce a highway from a blank grid?

For an infinite blank (all-white) initial grid, the highway has been observed to emerge consistently around step 10,000 in every known simulation. However, the conjecture that this always happens — regardless of grid size or simulation precision — has never been formally proved. For non-blank initial configurations the ant may never settle into a highway; it depends sensitively on the initial pattern of black cells.

How is Langton's Ant related to the study of emergence?

Langton's Ant is a canonical example of emergence: complex global behaviour (the highway) arising from local rules with no explicit encoding of that pattern. It is studied in complexity theory, artificial life research, and philosophy of science as evidence that complex order can self-organise from trivially simple rules. Christopher Langton used it as a motivating example in the founding of the Santa Fe Institute's artificial life programme.