Private Sub Start_Click()
Dim arrDeck(52)
Randomize
Dim CardCount As Integer
Dim CardVal As Integer
Dim Subnum As Integer
Dim Counter As Integer
CardCount = 1
Do While CardCount < 53
arrDeck(CardCount) = -1
CardCount = CardCount + 1
Loop
CardCount = 1
Counter = 0
Do While CardCount < 53 And Counter < 53
10 CardVal = Int((52 * Rnd) + 1)
If arrDeck(CardVal) = -1 Then
arrDeck(CardVal) = CardCount
Subnum = Counter
Image1(Subnum) = Image1(CardVal)
Image1(CardVal).Visible = True
CardCount = CardCount + 1
Counter = Counter + 1
Else: GoTo 10
End If
Loop
This post has been edited by JackOfAllTrades: 07 April 2009 - 04:30 AM

New Topic/Question
Reply




MultiQuote



|