how many values have been produced since the last seed - get_discard()'s number
advances the engine without using the values, as mt_rng::discard does
a float in [0, 1), with 32 bits of resolution
an integer in [0, bound), without modulo bias (the same rule Generator.int uses)
the raw generator, tempered as MT19937 specifies
re-seeds the engine and resets the discard count, as mt_rng::seed does
MT19937, the Mersenne Twister the reference strategy game's
mt_rngwraps, with the sameseed/discardbookkeeping its save files use. The engine itself is exactly specified (the paper's constants and the 32-bit seeding routine), sonextUint32matches that engine bit for bit on any machine; a port that consumes the raw stream, or a replay of raw draws, lines up.What is not portable is C++'s
std::uniform_int_distribution, which the reference then runs the engine through: the C++ standard leaves that mapping implementation-defined, so two standard libraries do not agree on it.inthere is the same unbiased rejectionGeneratoruses, which makes a replay deterministic within this framework rather than bit-identical to any one C++ standard library.Example