Click here to Skip to main content
15,892,746 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 4:59
ymilan10-Apr-09 4:59 
GeneralRe: Need Help with Shuffle of a deck Pin
Dave Kreskowiak10-Apr-09 7:11
mveDave Kreskowiak10-Apr-09 7:11 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 8:31
ymilan10-Apr-09 8:31 
AnswerRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 3:55
riced10-Apr-09 3:55 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 5:10
ymilan10-Apr-09 5:10 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 5:35
ymilan10-Apr-09 5:35 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 5:44
riced10-Apr-09 5:44 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 6:15
ymilan10-Apr-09 6:15 
' I x'd out the lines to show what I am trying to do...
Option Explicit
Public Sub Main()
Start_Game.Show
End Sub
Private Sub Exit_Click()
MsgBox ("Thank you for playing! Good bye")
End
End Sub
Private Sub Start_Click()

Dim arrDeck(52)
Randomize
Dim Cardcount As Integer
Dim Counter As Integer
Dim Card1 As Integer
Dim Card2 As Integer
'Dim CardVal As Integer
'Dim SubNum As Integer


' Fill deck with cards in order 1 to 52
Cardcount = 1
Do While Cardcount <= 52
arrDeck(Cardcount) = Cardcount
Cardcount = Cardcount + 1
Loop

' Shuffle the deck - end value (100)
Counter = 0
Do While Counter <= 100

' Get two random card positions
Card1 = Int((52 * Rnd) + 1)
Card2 = Int((52 * Rnd) + 1)

' Swap cards at these positions

Tmpcard = arrDeck(Card1)
arrDeck(Card1) = arrDeck(Card2)
arrDeck(Card2) = Tmpcard
'CardVal = Tmpcard ? Looking for a single value out of the random cards you made...
Loop

' Now output images in order of deck
Cardcount = 1
Counter = 0

' It seems I need a counter in here for Subnum, 0-52 so it can display the cards from 0-52 slots,
' But the array of a single value out of the random cards you made need to be set to another counter,
' Right? I'm not sure...I x'd out the lines to show what I meant...

'Do While Cardcount <= 52 And Counter < 53
'If arrDeck(CardVal) = -1 Then
' arrDeck(CardVal) = Cardcount
'Image1(Cardcount) = CardVal
' Subnum = Counter
'Image1(Subnum).Visible = True
Cardcount = Cardcount + 1
'Counter = Counter + 1
' End If
Loop

End Sub
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 7:15
riced10-Apr-09 7:15 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 8:34
ymilan10-Apr-09 8:34 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 8:50
riced10-Apr-09 8:50 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 8:46
ymilan10-Apr-09 8:46 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 8:58
riced10-Apr-09 8:58 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 8:59
ymilan10-Apr-09 8:59 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 9:14
riced10-Apr-09 9:14 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 9:41
ymilan10-Apr-09 9:41 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 9:43
ymilan10-Apr-09 9:43 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 10:03
riced10-Apr-09 10:03 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 10:22
ymilan10-Apr-09 10:22 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 10:54
riced10-Apr-09 10:54 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 10:58
ymilan10-Apr-09 10:58 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 11:08
riced10-Apr-09 11:08 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan11-Apr-09 6:13
ymilan11-Apr-09 6:13 
GeneralRe: Need Help with Shuffle of a deck Pin
riced12-Apr-09 3:50
riced12-Apr-09 3:50 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan12-Apr-09 5:58
ymilan12-Apr-09 5:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.