FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   Recursive question
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Recursive question  (Read 405 times)
timjaeger

Email
Recursive question
« on: Mar 31st, 2005, 8:27pm »

Hi,
 
I'm new to Processing, but am quickly learning and using it for a project.
 
I wanted to know why this recursive function isn't working the way it should..upon clicking, the user should see white lines branching out 3 levels deep, similar to the tutorial on recursivity, but instead there is no branching taking place.
 
http://research.calit2.net/solaris/tests/applet1/index.html
 
Here is the tutorial I am working from.
 
http://stage.itp.tsoa.nyu.edu/%7Edts204/ppaint/week7/index.html
 
I'm trying to build a skeleton from which other things could be  built upon.
 
Any help would be appreciated.
 
st33d

WWW Email
Re: Recursive question
« Reply #1 on: Mar 31st, 2005, 10:00pm »

You've got the recursion being called from within a for loop. You're sending the program back to the beginning of the function before the for loop is finished. The example you're working from doesn't use a for loop. It calls itself to get the repeating behaviour. I think it's the level you want to be random so when you first call the function in mouseReleased you might want to call the random there.
 

I could murder a pint.
Pages: 1 

« Previous topic | Next topic »