Langton's ant (source code)

= Langton's ant
{c}

A discrete dynamical system with an ant moving on a colored square lattice. In its standard two-color form, the ant turns right on white, left on black, flips the current cell's color, and advances one cell. From an all-white board it eventually exhibits a repeating pattern that translates across the lattice.