This is a small program I wrote to demonstrate Langton's Ant. The concept is pretty simple.
Basically, the Ant (The green pixel) operates on two rules:
1. If the Ant is on a black pixel, it will change the black pixel to red, turn 90 degrees to the right, and then walk forward one pixel.
2. If the And is on a red pixel, it will change the red pixel to black, turn 90 degrees to the left, and then walk forward one pixel.
So, this process is repeated over and over and over again, producing the crazy pictures you see here.
An amazing feature of Langton's Ant is the fact that it produces a "highway" of sorts after about 10,000 or so steps. It just starts cruising along in a straight line, but with a shape similar to that of a human spine.
I wrote this program in C++ using Allegro.
If you have any questions about Langton's Ant, you look it up on Wikipedia here:
http://en.wikipedia.org/wiki/Langton's_ant
If you have questions about my program, I'd be more than happy to answer them.
You can download the program here: https://sites.google.com/site/ats3117/apps/LangtonsAnt.zip
Have fun!
That is amazing
hylandsjgcn 3 weeks ago