GNOME Bugzilla – Bug 621182
random generation problem
Last modified: 2010-06-10 23:13:10 UTC
The function for generating the dice rolls does a simple modulus calculation, as shown below: int RollDie (void) { return ((rand () % 6) + 1); } However, this isn't really a good way to generate a random number. The low order bits aren't very 'random' in a linear congruential generator and if RAND_MAX doesn't divide evenly into 6 the distribution won't even be uniform. Another method would be: int RollDie (void) { double r = rand() * (1.0 / RAND_MAX); return (int)floor(r *6.0) + 1; }
This is in gtali, not aisleriot.
That's right. Sorry, my mistake.
*** Bug 608543 has been marked as a duplicate of this bug. ***
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.