Functions | |
| void | Randomize () |
| int | RandomInteger (int low, int high) |
| double | RandomReal (double low, double high) |
| bool | RandomChance (double p) |
| bool RandomChance | ( | double | p | ) |
The RandomChance function returns true with the probability indicated by p, which should be a floating-point number between 0 (meaning never) and 1 (meaning always). For example, calling RandomChance(.30) returns true 30 percent of the time.
| int RandomInteger | ( | int | low, | |
| int | high | |||
| ) |
This function returns a random integer in the range low to high, inclusive.
| void Randomize | ( | ) |
This function sets the random seed so that the random sequence is unpredictable. If this function is not called, the other functions will return the same values on each run. During the debugging phase, it is best not to call this function, so that program behavior is repeatable.
| double RandomReal | ( | double | low, | |
| double | high | |||
| ) |
This function returns a random real number in the half-open interval [low .. high), meaning that the result is always greater than or equal to low but strictly less than high.
1.5.1