can you show the code - did you use random number generator code in C or C++

onecrazeemom <[EMAIL PROTECTED]> wrote:                               I finally 
completed the dice roll program. Now, what do I do to make
 the rolls more random? They seem to come up with doubles quite often.
 I used srand( time(0)) to get my random numbers. I used the modulus(I
 think that is what it is called) 
 
 dieOne = 1 + rand() %6;
 dieTwo = 1 + rand() %6;
 
 srand( time(0) );
 
 Just curious what gives you a true random number when the lines of
 code are run so close together. Here are a couple of rolls:
 
 1. 3, 1
 2. 6, 1
 3. 6, 2
 4. 5, 5
 5. 1, 1
 6. 3, 4
 7. 4, 6
 
 I guess they are more random than I thought, but the first two times I
 ran the program it came up with doubles.
 
 Thanks in advance,
 Stephanie
 
 
     
                               

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Non-text portions of this message have been removed]

Reply via email to