jjRNG class JJ2+

A seedable pseudo-random number generator

Each instance has a state of its own, so the same seed always produces the same sequence of numbers, regardless of other random numbers the game or other scripts use.

Constructors

jjRNG(uint64 seed = 5489) C++
Creates a generator seeded with the given value

Functions

void discard(uint64 count = 1)
Advances the generator without returning the numbers
void seed(uint64 value = 5489) C++
Resets the generator to the state given by a seed

Operators

jjRNG& opAssign(const jjRNG&in o) = C++
Copies the state of another generator
uint64 opCall() () C++
Advances the generator and returns the next 64-bit number
bool opEquals(const jjRNG&in o) const == C++
Returns whether both refer to the same generator object, the states aren't compared

Function documentation

void jjRNG::discard(uint64 count = 1)

Advances the generator without returning the numbers