Overview
Invented by Chris Langton in 1986, Langton's Ant is a cellular automaton that evolves on an infinite two-colour grid. An "ant" moves from square to square following just two rules but manages to create surprisingly complex behaviour.
The Rules
- If the ant is on a white square, it turns 90° right, flips the square to black, then moves forward one cell.
- If the ant is on a black square, it turns 90° left, flips the square back to white, then moves forward one cell.
That is it—no counters, no memory, just orientation and colour.
Emergent Behaviour
Despite its microscopic rule-set, the automaton goes through three distinct phases:
- Chaos: the first few hundred steps look random as the ant carves patterns.
- Highway construction: after ~10,000 steps the ant inevitably starts building a predictable 104-step loop called the
highway
. - Repetition: once the highway forms, the ant will repeat forever, extending the diagonal road ad infinitum.
Complexity
Langton's Ant is Turing-complete; multiple ants and colours can simulate any computation. It is a classic example of emergence
: complex global order arising from local simplicity.
About the Visualiser
In the gallery you can:
- Pause / resume the simulation.
- Watch in real-time as the highway emerges (we accelerate by executing 20 steps per animation frame).
- Enjoy colours sampled from the Bauhaus palette: cream grid, blue trail, red ant.
Feel free to inspect the source in games/js/demos.js
for a concise, readable implementation.