Random Variation
Processing random( ) function
//returns a float value between min, max, does not include the max value
//function signatures - 2 overloaded versions
float random( float max ) // 0 assumed to be the minimum value
float random( float min, float max )Random Probability of Event Likelihoods
//random chance example
float randChance = random( 0.0, 1.0); //will return values between 0.0, .9999
if( randChance < 0.5) { //select midpoint of random range
println( "option1"); //printed ~50% of the time
//put other code here if you want it exectued %50 of the time
}else{
println( "option2"); //printed ~50% of the time
//put other code here if you want it exectued %50 of the time
}Random Variation: Color variation
Select a random array element
Last updated