We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
random (Read 877 times)
random
May 4th, 2009, 3:29am
 
hey y'all, I was wondering, what are the different types of randomize commands available in processing?
Re: random
Reply #1 - May 4th, 2009, 3:57am
 
Processing has 2 basic random types, random(low,high) which gives a float between low and high randomly, and noise(...); which uses a perlin noise algorithm to give smoothly variable numbers depending on the coordinates passed in (e.g. if the coordinates only vary slightly, the result only varies slightly)

Both random and noise have "seed" functions which allow you to give a known setup, so that you'll get the same results each time (albeit still random), e.g. randomSeed(1234); println(random(0,1)); will always print the same number.
Re: random
Reply #2 - May 7th, 2009, 9:07pm
 
maybe you wanna checkout some cell noise.
http://carljohanrosen.com/processing/index.php?page=start&topic=1.0
Re: random
Reply #3 - May 8th, 2009, 11:06am
 
i got ya! the seeding thing seems like a useful tool to have as part of random. I had a quick look at the link, (I'll check it out properly when I'm not so strapped for time) sure looks complicated for my young programming brain!
Thank you
Page Index Toggle Pages: 1