D
Dannerino
Using: Access 2003 SP3. I'm trying to generate random numbers to mimic the
truly random nature of rolling dice. My code is...
***************************************
Randomize
For intCounter = 1 to 5 'For each of the five dice being rolled
intDiceValue(intcounter) = ((6 * Rnd) + 1)
Next intCounter
*******************************************
I then have a simple INSERT INTO sql statement that inserts the results of
each roll into a table, specifically to track the frequency that each number
is rolled.
I realize that the count of each number, one thru six, is not going to be
exactly even with the rest. But my results seem very skewed, so I'm
wondering if my code has a flaw. I've rolled the number three a good 4.5
times as often as rolling a one. Rolling a 4, 5 or 6 happens with about the
same frequency. And rolling a 2 is almost as rare as a 1.
As I understand it, running the Randomize function before looping through
and generating 5 random numbers means the seed is generated based on the
system clock. Any ideas?
truly random nature of rolling dice. My code is...
***************************************
Randomize
For intCounter = 1 to 5 'For each of the five dice being rolled
intDiceValue(intcounter) = ((6 * Rnd) + 1)
Next intCounter
*******************************************
I then have a simple INSERT INTO sql statement that inserts the results of
each roll into a table, specifically to track the frequency that each number
is rolled.
I realize that the count of each number, one thru six, is not going to be
exactly even with the rest. But my results seem very skewed, so I'm
wondering if my code has a flaw. I've rolled the number three a good 4.5
times as often as rolling a one. Rolling a 4, 5 or 6 happens with about the
same frequency. And rolling a 2 is almost as rare as a 1.
As I understand it, running the Randomize function before looping through
and generating 5 random numbers means the seed is generated based on the
system clock. Any ideas?