Theory.org » software » ant » Langton's Ant Software

**Langton's Ant**
This is a little piece of software I cooked up one weekend after reading about Chris Langton's Ant. This is an example of a finite-state cellular automata. The ant (or ants) start out on a grid. Each cell is either black or white. If the ant is on a black square, it turns right 90° and moves forward one unit. If the ant is on a white square, it turns left 90° and moves forward one unit. And when the ant leaves a square, it inverts the color. The neat thing about Langton's Ant is that no matter what pattern field you start it out on, it eventually builds a "road," which is a series of 117 steps that repeat indefinitely, each time leaving the ant displaced one pixel vertically and horizontally. Run the thing and see what I mean.
Download ant.tar.gz and enjoy.

Options:

`
-s [WIDTH] [HEIGHT]`

-m [MAGNIFICATION FACTOR]

-r [NUMBER] , 1 out of number pixels is inverted

-f [FILENAME.PNG] , use a png to specify starting configuration.

-t , play on a torus.

-k , play on a klein bottle.

-a [NUMBER OF ANTS] , multiple ant mode:

if loading png, places n ants at the first n pixels found with color ff0000
otherwise will place n ants randomly about the field.

Links

Research paper by Ronny Ziegler

Vants

More ants, incl. the program Xant

Special thanks to Ronny Ziegler for the German version of this page.

Requires gtk and libpng. GPLed. If anyone has Langton's Ant links, mail me at matt (at) theory.org. 'Nuff said.

Last modified: Fri Feb 4 13:08:38 PST 2000

visits since August 20, 1999.