Langton's Ant

With the Ants tool, click a cell to add an ant or remove one. Arrow keys move the cursor and Enter adds or removes an ant there.

Two rules, then a highway

The ant stands on a grid of cells that all start empty. At each step it looks at its cell. On an empty cell it turns right; on a black cell it turns left. Then it flips the color of the cell and moves forward one cell.

From those two rules come three stages. For the first few hundred steps the ant makes small patterns, often symmetric ones. Then it wanders through what looks like chaos until about step 10,000, when it begins building a highway: a sequence of 104 steps that repeats forever and carries the ant away diagonally. Every finite starting pattern that has been tried ends in the same highway, but nobody has proved that it always will. What is proved is that the ant's path is never bounded.

More colors

With more colors, each color gets its own turn, and every visit changes the cell to the next color in a cycle. The rule's name lists the turns in color order, so Langton's ant is RL: right on color 0, left on color 1. Some names give patterns that return to symmetry again and again. That is guaranteed when the name, read as a loop, splits into pairs of equal letters, as in LLRR or RLLR. Here N also works for no turn and U for a U-turn.

Several ants

Ants share the board and each one moves once per step. Here they move one after another in the order they were placed, so an ant reacts to colors flipped by the ants before it in the same step. That order is a convention, and other ways of updating several ants can lead to very different patterns.

Source: Langton's ant on Wikipedia.

Keyboard

Space
Run or pause
N
One step
Backspace
Reset to step 0
M A
Move tool or ants tool
+ - F
Zoom in, zoom out, fit
← ↑ → ↓
Move the cursor when the board has focus; with Shift, pan
Enter
Add or remove an ant at the cursor