View Single Post
Old Nov 19th, 2007, 5:48 PM   #1
Megabyte
Hand Crafted
 
Megabyte's Avatar
 
Join Date: Nov 2007
Location: The Pit
Posts: 13
Rep Power: 0 Megabyte is on a distinguished road
Complete Randomization

Currently I'm working on a slot machine project purely for the fun and practice of it, and the fact that it isn't too hard and I'm relatively new still.

I'm using random numbers to determine what combination will result once it stops. However, each time I stop the program then run it again, I notice that it isn't totally random.

For example, the first time I run it, the random numbers generated may be 4, 27, 21, 5, etc ... And each corresponds to a certain set of pictures to load.
I close it, and the next time I run it, the same random numbers are generated, thus resulting in the same pictures. (It's not always loading 3 picture ones, but always 1, 2, 3 for the first time the pull button is clicked, 2, 2, and 1 the second time, etc.)

intChoose = Int((1 - 27 + 1) * Rnd + 27)

That's what I'm using to generate the numbers.
I thought generating a random numbers which would then generate another different random number would work, but again that does not solve the problem -- only increase possibilities.

Is there any way to completely randomize it so that it will choose a different random numbers each time the program is run, or is that a feature specific to VB6 (or most other code) that doesn't allow the programmer to change it?
Megabyte is offline   Reply With Quote