@Random (JavaScript)

Returns a random number greater than or equal to 0.0 and less than 1.0.

Defined in

@Functions (JavaScript)

Syntax

@Random() : double
Return value Description
double The random value.

Examples

This example gets 16 random numbers and turns them into integers by moving the decimal point two places to the right and truncating the result.
function p(stuff) {
	print("<<<" + stuff + ">>>");
}

for(var i = 0; i < 16; i++) {
	var r = @Integer(@Random() * 100);
	p(i + " " + r);
}