943,567 Members | Top Members by Rank

Ad:
Feb 18th, 2009
0

More random than random

Expand Post »
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
Similar Threads
Reputation Points: 2
Solved Threads: 0
Newbie Poster
venomocity is offline Offline
16 posts
since Aug 2007
Feb 18th, 2009
0

Re: More random than random

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):
vb Syntax (Toggle Plain Text)
  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):
vb Syntax (Toggle Plain Text)
  1. Randomize Timer
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Feb 23rd, 2009
0

Re: More random than random

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!
Reputation Points: 2
Solved Threads: 0
Newbie Poster
venomocity is offline Offline
16 posts
since Aug 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Problem in exporting data to word from data report
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: New data sheet from old one in excel





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC