Matthew Ellen .co .uk

Ant Dance

Many moons ago I read of a computer programme that would show an ant moving around a screen, if the pixel the ant landed on was black the ant would turn left and move off and the pixel would turn white. Conversly, if the pixel were white then the ant would turn right and move off and the pixel would turn black. I recreated this in Delphi at the time, and the programme was horribly slow. I am much older now, and my experience has taught me how to write this programme in javascript, and how to make it a lot quicker. Enjoy!

(It's better to run this in Chrome, I've found, since it seems to eat up a huge amount of memory in Firefox 13)

This text is displayed if your browser does not support HTML5 Canvas.