Constructor
# new Random(stsJarPath, seed)
Create a new random number generator with a specified seed
Parameters:
Name | Type | Description |
---|---|---|
stsJarPath |
string | Path to the `desktop-1.0.jar` Slay the Spire game file |
seed |
number | Seed used to generate pseudo-random numbers |
Example
const seed: number = 1337;
const rng = new Random('./path/to/stsJar', seed);
const maxValue: number = 5;
const randomNumberFrom0To5: number = rng.randomInt(maxValue);