Langton's Ant

Two tiny rules, 10,000 steps of chaos, then a perfect highway — watch the ant, try new rules, and test yourself in Predict the ant. Free · no download · works on phone & desktop

Steps0
Score0

Press Play and watch the ant. After about 10,000 steps it builds a highway.

Press Play, turn the speed up and wait for step 10,000 — the chaos suddenly turns into a straight highway.

About Langton's Ant

Langton's ant is a famous little computer experiment invented by Chris Langton in 1986. An ant sits on a grid of white squares and follows two rules: on a white square it turns right, on a black square it turns left — and either way it flips the color of the square and steps forward. For the first few hundred steps the ant draws neat, symmetric shapes. Then it turns into a chaotic mess for about 10,000 steps, and suddenly, every time, it starts building a straight diagonal 'highway' that repeats every 104 steps and carries on forever. Nobody has proved that this always happens. In Free play you can run the ant at up to 5,000 steps a second, step through one move at a time, flip squares to place obstacles, add up to 20 ants, and try multi-color rules such as LLRR (which grows a symmetric pattern) or LRRRRRLLR (which builds a filled square). In Predict the ant, you get ten small 9 × 9 puzzles: work out where the ant will be after three to seven steps, then watch its path to check.

How to play

  1. Free play: press Play (or Space) to run the ant, Step (or N) for one move, or +1000 steps to skip ahead. Use the Speed slider for up to 5,000 steps a second.
  2. Tap the grid to flip squares, or set "Tap the grid to" to Add an ant and place more ants. Clear starts again with one ant in the middle.
  3. Pick a Rule to try multi-color ants: each letter is the turn for one color — R for right, L for left — and squares cycle through the colors.
  4. Predict the ant: work out where the ant will stand after the number of steps shown, then tap that square (or use the arrow keys and Enter). The path is replayed so you can check.
  5. Get 9 or 10 of the 10 puzzles right for three stars. Your best score is saved.

Tips & strategy

  • Turn the speed up and watch around step 10,000 — that is when the highway appears.
  • With Wrap edges off, the run stops when an ant reaches the edge of the grid.
  • In Predict the ant, follow the rules one step at a time with your finger: turn first, flip the square, then move.
  • Two ants can break each other’s highways — try placing a second ant in the path of the first.

Frequently asked questions

What are the rules of Langton's ant?

On a white square, turn 90° right; on a black square, turn 90° left. Then flip the color of the square and move forward one square. That is all.

What is the highway?

After about 10,000 steps of seemingly random movement, the ant falls into a cycle of 104 steps that moves it two squares diagonally each time. It keeps building this straight "highway" forever on an empty grid.

Does Langton's ant always build a highway?

Every starting pattern that has been tried with a finite number of black squares ends in a highway, but nobody has proved that it always happens. It has been proved that the ant never stays inside a bounded area.

What do RL, LLRR and the other rules mean?

Each letter belongs to one color, in order. RL is the classic two-color ant. LLRR uses four colors and grows a symmetric shape; LRRRRRLLR fills a square; RRLLLRLLLRRR builds a triangle. Ants with more colors are often called turmites.

How do I win?

Free play is a sandbox with no score. Switch Mode to Predict the ant for ten puzzles — each right answer scores a point, and 9 or 10 gives three stars.

Languages

EN

← Browse all games