Langton's Ant produces ordered structure from two purely local per-step rules
An autonomous agent acts independently, taking no commands from a leader, yet ordered structure can emerge from its interaction with the environment. Langton’s Ant is a minimal grid example: the ant faces one of four directions and each frame follows two rules — on a white pixel it turns 90 degrees right and flips the pixel to black; on a black pixel it turns 90 degrees left and flips it to white; then it steps forward. The grid itself stores the memory of past visits, so the ant’s future is determined by its own history. From an apparently chaotic start the ant eventually settles into a periodic sequence that builds a straight ‘highway’. The lesson: emergent, structured behaviour needs no global plan — it falls out of simple rules coupling an agent to a stateful environment.
Examples
// Per frame: // 1. move one pixel forward in current direction // 2. if pixel is white -> set black, turn right (direction -= 1) // if pixel is black -> set white, turn left (direction += 1) // grid wraps at edges; a straight ‘highway’ emerges after ~10k steps
Assessment
State the two rules that govern Langton’s Ant and explain why the same emergent straight path appears regardless of the ant’s starting orientation; identify what role the grid plays as memory.