| | |
More random than random
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
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
(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
Venomocity
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):
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):
[code=vb]
' your code goes here
[/code]
Will Look like this (how we like it):
vb Syntax (Toggle Plain Text)
'your code goes here
vb Syntax (Toggle Plain Text)
Randomize Timer
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!
Thanks!
I like it here! This is my family of geniuses!
Venomocity
Venomocity
![]() |
Similar Threads
- random number display the same (C#)
- Random Numbers on button (Java)
- Plz Some1 Reply!!! (C++)
- random (Java)
- How to print out string at random interval (Java)
- Random numbers...really random?? (Java)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Problem in exporting data to word from data report
- Next Thread: New data sheet from old one in excel
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






