Langton's ant

Controls

Input mode

Ant direction

Speed

Grid size

Step: 0

Rules

  • If the ant is on a black cell, it turns 90° to the left and changes the cell’s color to white. Then it takes a step in the new direction.
  • If the ant is on a white cell, it turns 90° to the right and changes the cell’s color to black. Then it takes a step in the new direction.

General Information

Langton's Ant is a classic two-dimensional cellular automaton created by researcher Chris Langton in 1986. It consists of a grid divided into identical cells, each of which can be either white or black.

On this grid there is an “ant” - an abstract agent with a position and a direction of movement. At each step, the ant checks the color of the cell it is currently standing on and, according to a simple set of rules, turns, flips the cell's color, and moves forward.

Despite the extreme simplicity of these rules, the ant's behavior turns out to be surprisingly complex. At first it moves chaotically, producing seemingly random patterns on the grid. But after several hundred steps, its trajectory suddenly organizes into a stable, repeating “highway” that continues indefinitely. This phenomenon makes Langton's Ant one of the most famous examples of how simple local rules can lead to complex and even seemingly purposeful global behavior.

Interesting Facts

  • Langton's Ant is Turing-complete - in theory, it can perform any computation.
  • Its behavior goes through three stages: chaos → transition → highway.
  • The “highway” always appears, although there is still no strict mathematical proof.
  • There are many variations: multicolor ants, multiple ants, custom rule sets.
  • The first hundreds of steps look random, but eventually a stable structure forms.
  • Langton's Ant is widely used in generative art and visual experiments.
  • Despite its simplicity, its behavior is hard to predict - a hallmark of complex systems.