*MAFIA* Forums
*MAFIA* => Help => Topic started by: Partyboy on April 27, 2007, 07:23:31 PM
-
Im trying to Generate 20 random unique numbers on 20 different labels, in Visual Basic 6.0 Professional.
I know how to get them random
Like so
Label1.Caption = Int(Rnd * 20)
Label2.Caption = Int(Rnd * 20)
so on
Label20.Caption = int(Rnd * 20)
Randomize
This will make it so each label will display a random number
But the thing is, is that i cannot have the numbers duplicate. I need to have each number be unique.
So label1.caption cannot = label5.caption
How can this be done.
I now i need an array and loop
So
For i = 1 to 20
'<<<<< what goes here?
next
Thanks
-
Use the number scramble spell it does wonders!
-
K heres a better way to explain. In my algebra class we are doing this simple quizes where you have 45 secs to answer 1squared all the way up to 20 squared so you have to have them memorized. I do but i thought this would be fun to make.
So i made a dialog that had you click start. Then there are 20 labels and 20 texts the labels then have numbers on them that are radomly generated. then you right the correct answer so if label4 says "14" you right in the text 190. Then when the 45 secs are up it disables everthing then tells you how many you got right. All of this i got but getting the numbers to come only once.... see sometimes there will be two 15's or 17's or something and i need each label to have its own. How can this be done. here is what i have so far. It only counts from 5 right now.