Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 19th, 2007, 4: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
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pong game complete teencoder Show Off Your Open Source Projects 6 Aug 9th, 2006 2:27 PM
Assembly for complete beginner? Flavius_Belisarius Assembly 17 May 14th, 2006 2:06 AM
complete C++ OS??? Kilo C++ 10 Dec 6th, 2005 10:03 PM
complete newbie question melee28 C 36 Sep 11th, 2005 6:48 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:47 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC