An ant (the red square) walks on a grid of colored cells. At each step it looks at the color under it, turns, recolors the cell, and steps forward. Langton's ant is the simplest case: on a blank cell it turns right, on a colored one left, and flips the cell. For about ten thousand steps it makes what looks like chaos, then suddenly starts building a diagonal highway that never ends. Press Play to watch it, pick another rule, or type your own. A turmite is the same ant with a memory: a table says, for each pair of (inner state, color under it), what color to leave, which way to turn, and what state to be in next.
Chris Langton described the ant in 1986. Nobody has proved that the highway always appears, only that it does from every starting pattern tried. A rule of just L and R letters is the ant on more colors: each letter says which way to turn on that color, and the cell then moves on to the next color in the list, so RL is the classic ant and LLRR or LRRRRRLLR grow very different shapes. The longer form handles inner states: one group per ant state, separated by slashes, and one three-character entry per cell color inside it, giving the new color, the turn (L, R, U for turn around, N for no turn) and the new state, as in 1R0 0L0, which is also the classic ant. An entry that points at a color or state that does not exist turns the box red. Random tries two-state, three-color tables and keeps one that, after 20,000 trial steps, has grown an irregular pattern without running off in a straight line. Turmites A, B and C came from that search; they are not named in the literature. The descriptions of the L/R presets are what I measured at 100,000 steps. The grid wraps around at the edges.
This page was created with Claude Code.