I've been interested in Langton ants for a good 8 years now, and have been playing with variants on them for a long time. Here's one of my favorites: <a href="http://pyvascript.appspot.com/Langton45" rel="nofollow">http://pyvascript.appspot.com/Langton45</a><p>Rather than working on 90 degree turns, this does 45 degree angles, and it has a bit more complexity in the command set.<p>The rules are: + and - turn right and left 45 degrees, * and / turn right and left 90 degrees, ! reverses direction, . does nothing.<p>You can come up with some really interesting patterns, e.g. <a href="http://pyvascript.appspot.com/Langton45?command=*.%2B" rel="nofollow">http://pyvascript.appspot.com/Langton45?command=*.%2B</a><p>Edit: Huh, I guess I never released any of that. I should port it to a modern Pyvascript and throw it up somewhere, as the version this is built against is probably going on 3 years old.
Also see Conway's Game of Life for an interactive system of complex emergent behaviors from very simple rules:<p><a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life" rel="nofollow">http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life</a><p><a href="http://www.bitstorm.org/gameoflife/" rel="nofollow">http://www.bitstorm.org/gameoflife/</a>
For more fun along these lines, wolfram provides as always:<p><a href="http://demonstrations.wolfram.com/CellularAutomatonExplorer/" rel="nofollow">http://demonstrations.wolfram.com/CellularAutomatonExplorer/</a><p>(Cellular Automata is the name for these constructs, langon's ant, the game of life, and so on.)
It is interesting, but, pardon my ignorance, is it appropriate to call this "a behaviour" (in the traditional meaning of this word)? It looks to me like "just" playing with numbers, i.e. normal phenomenon ultimately describable with some math theory. It looks far-fetched to me to describe it with the terms like "simple rules can result to complex emergent behaviour," etc...<p>I remember there are some number sequences generated by some rules, which seems random at first and then some sub-sequence repeates. Now this looks similar to me, except it seems to more mysterious because someone described it as "ant doing something". ;-)
Where can one find chaotic toy algorithms that don't involve Turing machines or cellular automata? (I need one for a project, and I keep running into image processing and biology applications. I actually need a toy one.)<p>EDIT: Found it: (pseudocode, not Python)<p><pre><code> while x > 1
case ((x mod 2) == 0):
x = x / 2
case ((x mod 3) == 0):
x = x + 1
default:
x = x * 3
</code></pre>
The number of iterations it takes to leave the loop is chaotic.
I have a free android live wallpaper, based on them: <a href="https://market.android.com/details?id=info.jaisharma.antslive.free" rel="nofollow">https://market.android.com/details?id=info.jaisharma.antsliv...</a> . You can create/delete ants, the patterns they draw is always interesting specially since multiple ants affect each other's state and since a human draws ants at random location and time.
Complex patterns produced by simple set of rules? DNA->proteins->cells->organisms->societies? The only difference in my view is that DNA happens in 3-dimensional space and uses 4 "colors" instead of 2.