Skip to content
Adrien Hubert

Langton's ant, on any L/R rule.

A single ant walks on a square grid, guided by a short string of L and R. At every step the ant reads the colour under it, turns by what that colour's letter says, flips the cell to the next colour in the cycle, and steps forward one square.

Rule LR
Steps 0
Speed 1000/frame

Only L and R. Two to sixteen characters. One colour per letter.

The rule

The classic Langton's ant, defined by Chris Langton in 1986, uses the string LR. Cells are black or white. On a white cell the ant turns left; on a black cell it turns right. Either way, it flips the cell to the opposite colour, then walks one square in whatever direction it is now facing.

Any string of L and R generalises the same idea. A string of length k gives you k colours. The letter at position i is what the ant does when it stands on colour i: L or R, then advance the colour to (i + 1) mod k, then step forward.

The highway

For the classic rule the ant spends its first ten thousand or so steps producing what looks like noise. Then, around step 10 000, a repeating 104-step cycle takes over. From then on the ant moves as a unit two cells over and two cells down every cycle, drawing a diagonal band that grows forever. That band is the highway.

Whether every finite starting configuration eventually reaches a highway is still open. It has been proven for the classic LR rule that the ant's trajectory is unbounded: the ant cannot stay inside any finite region forever. Bunimovich and Troubetzkoy gave that proof in 1992.

Other strings

LLRR produces a symmetric, growing pattern that looks like a spiky snowflake and never settles into a highway. LRRRRRLLR spirals in slowly, then emits long straight roads in several directions at once. RRLLLRLLLRRR skips the noise phase entirely and starts building highways from the first step. Try typing your own: most rules of length three to six look strikingly different from each other.

Sources

Langton, C.G., Studying Artificial Life with Cellular Automata, Physica D 22 (1986), 120-149. Bunimovich, L.A. and Troubetzkoy, S.E., Recurrence Properties of Lorentz Lattice Gas Cellular Automata, Journal of Statistical Physics 67 (1992), 289-302. Gale, D., Propp, J., Sutherland, S., and Troubetzkoy, S., Further Travels with My Ant, Mathematical Intelligencer 17:3 (1995), 48-56.