The Mersenne Twister Pseudo Random Number Generator
This is a mirror of my library hosted at https://create.stephan-brumme.com/mersenne-twister/
The Mersenne Twister is often regarded as the fastest pseudo-random number generator which passes almost all statistical tests.
The original C code isn't exactly beautiful, therefore I decided to write my own C++ class.
.cpp file are under 100 lines even though there are tons of comments.
#include "mersenne.h" ... // create new Mersenne Twister MersenneTwister prng(123456); // generate two random 32-bit numbers int x = prng(); int y = prng();