Pages to see:

Entries in Recursion (1)

Thursday
Jul022009

Recursion...First Attempt

I have a goal of using cellular autonoma to simulate tree growth. This program is an alpha-draft of that, hyper early on in the development cycle. I am pretty sure none of this code will go onto be used in latter versions, but I learned about recursion and that's a good benefit. It is drawn segment by segment, and each segment calls two more. It recurses (I think that's a word) for a random time (well 50% chance of continuing that branch). I added in the ability to start a segment from where you click, it's kinda fun I think...you can paint with the branches. To get the middle branch to stop drawing new branches just hit the 'o' key. Code after the jump...

Click to read more ...