Instructions for Langton's Ant Simulation

This applet allows one to simulate one or more of Langton's Ant automata. The ant lives on a rectangular mesh of black and white squares. At each instant, the ant is pointing in one of the "NEWS" directions--north, east, west, or south. As time steps forward the ant acts by the following rules:
  1. The ant moves forward one square.
  2. The ant inverts the square it leaves.
  3. If the ant lands on a white square, it turns left; otherwise it turns right.

Initially, the simulation starts with a single ant pointing north. You can observe how the ant moves, step by step, by pressing the comma (,) key. As the ant moves forward, you will notice that the ant is represented by a light gray (or dark gray) color if the ant is sitting on a white (or black) square.

At any time you can add more ants to the simulation by moving the mouse to an approriate location and typing N, E, W, or S, depending on the direction you wish the ant to point. If you type ?, a randomly oriented ant is placed on the screen. It is possible to place multiple ants on a single square.

Killing ants is not allowed.

Other keystrokes are possible: