Langton's Ants in Python

Wednesday, January 20, 2016

Recently, I've been spending quite a bit of time programming a Langton's Ant simulator in Python. I've started with a classic ant using an RL moving scheme, then I integrated an extended mode that allows you to input your own moving scheme.

The ant show in this picture is evolving with an RLLR moving scheme. As mentioned earlier, it's currently possible to experience the simulation with any moving scheme you like. While some are very interesting such as this one, most will result in a messy patch of colors without anything of interest. On rare occasions such as this one, some order will emerge out of the chaos.

Speed can be adjusted, new ants can be added to the simulation, etc. More features are going to be available later on, such as saving and loading a simulation.

The code is available on GitHub: