Langton's Ant
Your browser cannot show this simulation.

Steps: 0 Grid:

Langton's ant is a simple cellular automaton invented by Chris Langton in 1986.

In this automaton one special cell exists, called the ant, which moves in a specific direction. With each move it changes the state of the cell it leaves.

At first, the ant's movements create a form which seems chaotic. However, after around 10,000 steps, order emerges. The ant starts building a recurrent "highway" pattern of 104 steps that repeats indefinitely.

The ant moves according to the rules below:

  • It travels in any of the four cardinal directions at each step it takes.
  • At a white square, it turns 90° right, changes the color of the square to black and moves forward one unit.
  • At a black square, it turns 90° left, changes the color of the square to white and moves forward one unit.

Here the grid wraps around at its edges, so sooner or later the highway runs into the pattern built earlier, and chaos returns.

More information