testlib
testlib copied to clipboard
Random generator rng.next() may produce identical first number on similar parameters
save the code as rngtest.cpp
and compile & run with the following parameter:
#include"testlib.h"
int main(int argc,char*argv[])
{
registerGen(argc,argv,1);
printf("%d\n",rnd.next(0,15));
}
These parameters
rngtest abc 0
rngtest abc 1
...
rngtest abc 9
will all give output 8
.
And parameters
rngtest abc a
rngtest abc b
...
rngtest abc x
will all give output 10
.