This will get the job done on how to seed values.
Example to make a card deck you would detirmine the number before hand, so you would have this (3.4.5.2.1) and you fould know that the third card is first.
The only thing wrong is I can't dynamicaly dim arrays. So I fixed it one to fifty.
Please any question comments or anything post em!
Ps: Is this FAQ or not?
Brad,
Free mp3 player,games and more.
Example to make a card deck you would detirmine the number before hand, so you would have this (3.4.5.2.1) and you fould know that the third card is first.
The only thing wrong is I can't dynamicaly dim arrays. So I fixed it one to fifty.
Please any question comments or anything post em!
Ps: Is this FAQ or not?
Code:
Public Function MakeDeck(low As Integer, high As Integer)
Dim take(1 To 50)
For i = low To high
repeat:
num = Rnd2(low, high)
If take(num) = "Yes" Then
GoTo repeat
Else
MakeDeck = MakeDeck & num & ","
take(num) = "Yes"
MsgBox MakeDeck
End If
Next i
For i = low To high
take(i) = ""
Next i
End Function
Public Function Rnd2(ByVal low As Single, ByVal high As Single) As Single
Randomize
Rnd2 = Rnd * (high - low) + low
Rnd2 = Round(Rnd2)
End Function
Free mp3 player,games and more.