rand

These are various methods for generating random numbers. The values returned are float point values.

rand()

Returns a random value between 0.0 and 1.0.

rand( max )

Returns a random value between 0.0, and max. Max can be a negative value, to retrieve a value between 0.0 and -10.0

rand( min, max )

Returns a random value between min, and max.

// outputs 10 values, each between 10 and 20, on the console
10.times() do
    console( rand(10, 20) )
end