Langton's ant cellular automaton, in C.
A small, self-contained demo written in pure C — no external libraries, just the standard library and POSIX. Part of the Corg-Labs collection of single-file C programs.
- The ant turns right on a white cell, left on a black cell
- It flips the cell's color, then steps forward
- Order emerges into a 'highway' after ~10,000 steps
- A live counter tracks the number of steps taken
gcc ant.c -o ant
./ant
Press Ctrl-C to quit.