This is a simple (and hopefully amusing) example of cellular automata written in C++. In this simulation, a hero must cross a dragon infested courtyard to rescue a princess. For some reason, the hero has only brought two arrows!
The courtyard consists of 100 cells, each of which updates itself based on the contents of its neighbors.
To run the program, type:
./courtyard x y
where x is a number of dragons, and y is the number of milliseconds between each "frame" of the animation.
By Tom Rutherford.