Skip to content

RandomUtils

Dan M edited this page Mar 28, 2022 · 2 revisions

RandomUtils contains extra functions for working with Random, such as getting a value in a given range.


API

Static Methods

static void setSeed(int seed)

Sets the seed being used for all methods. Note that this will reset the Random object this class uses so it will reset the random sequence. Repeatedly calling it will just result in getting the same number each time.

static int intInRange(int min, int max)

Returns an integer in-between min and max, inclusive. If max is less than min, then min is set to max and vice-versa.

static double doubleInRange(double min, double max)

Exactly the same as [intInRange](), but returns a double.

Clone this wiki locally