Click here to see Langton’s Ant in the Labs.
I probably could have posted this project before the 3D version, but the 3D version was already done in Javascript, and besides: 3D is just cool!
The above screenshot is taken at just over 10,000 iterations into the animation. Langton’s Ant will, if undisturbed, create a “highway” which will proceed off into infinity unless the world it is crawling wraps at the edges, as this one does.
If you have seen one Langton’s Ant animation you have probably seen them all, though in this one I added a heat map which shows the number of times the Ant has visited each cell. It will take a while to begin to see different colors, and everything will look blue for quite some time. The above screenshot of the heat map was taken at approximately 100,000 iterations.
As with all of my experiments, all of the code is contained in a single page for easy download and modification. I did not use any external libraries and I commented the Javascript for ease of reading and interpretation. Enjoy!