28 Oct
2012
28 Oct
'12
4:30 a.m.
I'm using boost to shuffle an array, but it's not looking as random as I would expect. Am I not using it right? The code below outputs sequences that look random mostly, but I see patterns such as 7 7 12 12 11. boost::random::mt19937 rng; boost::minstd_rand lcggen; lcggen.seed(clockTime); rng.seed(lcggen); unsigned min=1; unsigned max=15; for(unsigned i=0;i<5;i++) { boost::random::uniform_int_distribution<> dist(min,max); const int j = dist(rng); ... code that shuffles stuff using j ... min++; cout<<j<<' '; } Suggestions? Thanks! Robin -- www.cinepaint.org