More random than random

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Aug 2007
Posts: 15
Reputation: venomocity is an unknown quantity at this point 
Solved Threads: 0
venomocity's Avatar
venomocity venomocity is offline Offline
Newbie Poster

More random than random

 
0
  #1
Feb 18th, 2009
I'm working on designing a game, the problem now is that while I have a code for randomizing a number, its the same series every time. This isn't good for random, to know what you're going to roll before you hit the button sucks. Is there anything to help with this?

(If this is a redundant question that has been asked before, I apologize. Just direct me in the right direction. Thanks)

Here is what my code for random looks like;

Private Sub Attack_Click()
Value = Int((6 - 0) * Rnd + 0)
A1.Caption = Int((6 - 0) * Rnd + 0)
End Sub
I like it here! This is my family of geniuses!
Venomocity
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: More random than random

 
0
  #2
Feb 18th, 2009
you should put your code in code tags. Look ssomething like this:
[code=vb]
' your code goes here
[/code]
Will Look like this (how we like it):
  1. 'your code goes here
That said, somewhere in your form, probably on form load, (you usually only need to do this once, doing it more than once may cause a performance hit):
  1. Randomize Timer
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 15
Reputation: venomocity is an unknown quantity at this point 
Solved Threads: 0
venomocity's Avatar
venomocity venomocity is offline Offline
Newbie Poster

Re: More random than random

 
0
  #3
Feb 23rd, 2009
Thanks Comatose I was working for a while on trying to figure out how to make it look like real code. I guess I'm more of a noob than I'd like to admit but I appreciate the help. Thanks for the answer as well I haven't tried it yet, but I will soon. I just want to make sure I do it right before I sign off on the question.

Thanks!
I like it here! This is my family of geniuses!
Venomocity
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC