Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.


getRandomNumber

Generates a random number.

The random number will be within the range specified(min value <= random number < max value), where 0 is the minimum value for a random number if only a maximum value is given as argument to the function.

Syntax

getRandomNumber(maximum_value);

getRandomNumber(minimum_value, maximum_value);

Arguments

minimum_value: Is an expression with the type of number

maximum_value: Is an expression with the type of number

Return type

number

Examples

print("Random number 1: ");

print(getRandomNumber(100, 200)); //Return a random number >= 100 and < 200

print("Random number 2: ");

print(getRandomNumber(200)); //Return a random number < 200

Availability

Version 4.8