Interface RandomInt

access this type via: util.RandomInt (provides, requires or uses)

Generate random or pseudo-random numbers. The setSeed() function should generally be used once (after instantiation) to ensure a unique starting point for the sequence of numbers returned by successive calls to get(). The current time is commonly used with setSeed(). If setSeed() is not used, each instance of the random number generator may return the same sequence of numbers.

Functions

void setSeed(int s)

int get(int top)

void setSeed(int s)

Set a 'seed' value for the random number generator. Some implementations may generate the same sequence of numbers from the same seed, so this should generally be set from something like the current time to help ensure good pseudo-random numbers.

int get(int top)

Get a pseudo-random number between zero and 'top', exluding top itself.