-
Notifications
You must be signed in to change notification settings - Fork 6
library__random
#random
Pseudo-random number generator.
random:gaussian()
Generates a random double. The returned value behaves like a random variable with mean 0.0 and standard deviation 1.0.
random:init(seed)
Initializes the current RNG with the specified seed evaluated as a double.
random:init()
Initializes the current RNG with a seed generated from the internal clock. The value of the seed is returned.
random:next()
Generates a random integer, double or boolean according to the context.
random:next(max)
Evaluates max as an integer and generates a random integer, double or boolean according to the context. If this function must return an integer, then the result is between 0 (inclusive) and max (exclusive).
random:seed()
Returns the seed of the current RNG.
random:shuffle(it)
Evaluates it as a list of elements, and returns this list randomly shuffled.