No Parameters
VALUE(FLOAT) | A random floating-point value. |
This function returns a random floating-point value from 0.0 up to (but not including) 1.0.
NOTE: The following code will return different values every time it is executed!
world
{
start()
{
local a;
a = 10;
textln("Generating " + a + " integers from 0 to 9:");
while (a > 0)
{
textln(irandom(10));
a = a - 1;
}
textln("");
a = 10;
textln("Generating " + a + " floats from [0.0, 1.0):");
while (a > 0)
{
textln(frandom());
a = a - 1;
}
textln("");
a = 10;
textln("Generating " + a + " Gaussian floats, mean 0, std. dev. 1:");
while (a > 0)
{
textln(grandom(0, 1));
a = a - 1;
}
quit;
}
}
IRandom() — Returns a random integer value.
GRandom() — Returns a random floating-point value with Gaussian distribution.
Authors can expect the distribution of this random number generator to be uniform.
The method of generating random numbers is up to the TAME implementation (Java, JS, etc.), and the generator has not been standardized, yet.
There is currently no way to seed the random number generator for testing purposes, at the time of this writing.