Langton’s ant

Instructions

The ant is marked with red color. You can toggle the color of any square by clicking on it with mouse or draw longer lines by holding mouse button pressed while moving. You can control the simulation using the icons with mouse or keyboard. From left to right the icon functions are are:

Icon button Key Function
Reset ESC Reset simulation and viewing options
Play Space Start playback or step one in slow mode
Pause Space Pause simulation
Speed up + Increase simulation speed
Speed down - Decrease simulation speed
Zoom in Page Up Increase zoom level
Zoom out Page Down Decrease zoom level
Change focus Switch through different focus styles (normal, free, centered)

Move the view around with arrow keys. In normal view mode the ant remains always visible on the screen but is not always at the center. In free view mode you can move around regardless of the ant and in centered mode the ant is always at the center of the screen. You can center the screen to the ant at any time by clicking the blue arrow or pressing ENTER. The blue arrow indicates which direction the ant is facing.

Decreasing speed to minimum causes the simulation to enter slow mode, in which additional steps are only made when user requests them (either by pressing SPACE or clicking the PLAY icon).

Focus style icons from Led24.de
All other icons from VistaICO.com

About ant

Langton’s ant is so called two-dimensional Turing machine which rather interestingly demonstrates how very simple set of rules can yield complex results. It was invented by Chris Langton in 1986.

The playing field is an infinite grid where squares can have two colors, traditionally black and white, but in this case black and green. The "ant" can travel in any of the four cardinal directions at each step and moves according to following rules:

As simple as they are, the rules lead to surprisingly complex behavior. At first the ant seems to move at random, but after some time (about 10.000 steps if the starting grid is of the same color) it starts to build a recurrent pattern of 104 steps that repeat indefinitely. Although it has not been proved mathematically yet, it seems that this "highway" pattern eventually emerges regardless of the initial colors of the field. You can also test this by adding "obstacles" to the ant’s path after it has started to build the highway.