Predefined Functions - random
Description: The random function returns a pseudorandom integer ranging from -randomrange upto randomrange-1. It takes the input value as seed used to generate a random number. Within the same version of ChaosPro the same seed value will always generate the same random number. So in order to generate a sequence of random numbers, you must change the input value for the function. This can be most easily done by using the random number from the previous call as the input value for the next call:
r=random(p); for (i=0;i<100;i=i+1) { r=random(r); // use the random number from the previous call as seed for the new call... // do something with r }Examples
|