Langton´s Ants

Up a level : Cellular Automata

In this page you can run Langton’s Ants.

You can change the rules, change the size of the cells (pixels) and the speed of the ant + more as described below.


  • Hide/Show: Hides or shows the rest of the buttons.
  • Start/Stop: The start button starts the ant, and the button changes to a stop button. When the label is Stop it stops the run.
  • Centre: Move the ant to the original centre.
  • Resume: This button appears if you have pressed the stop button If you click the resume button the ant stars from the last position it had. The cells retain the old colours. Those cells will be shown in slightly transparent variants of the old colour.

You may change the rules before resuming the run.

If the new number of rules are less than the previous number of rules, then the remainder after division with the new number of rules will be used as the colour number.

  • Decreases the number of steps per frame.
  • Quicker: Increases the number of steps per frame.
  • Random Blob. Will create a circular disk with the radius 50 cells. The colours of the cells are random colours within the range of the current rule. The ant will keep its current position.
  • Clear: Clears the board and centres the ant.

Then we can also select the cell size from 1 to 8 pixels. The board size is the height and width of the window. The board will retain its size even if the cells are larger than one pixel.

The run stops if the ant reach the edge of the board.

Compared to the original Ant, where the rules are to turn right = R, and turn left = L, a few more rules are added. We have: continue forward = F, move backward, i.e. turn 180 degrees =B, move to the “north” = up on the screen =N, move “south” = S, move “east” = E and move west = “W”.

Up a level : Cellular AutomataLast modified: Mar 5, 2023 @ 11:48