I have to set up a 2d array(13, 4) containing a deck of playing cards.
What I am wondering is how to correctly set up the array in the first
place, and then how do you access the information once the data is in the
array? Button clicks tell the array the rank and suit of the card chosen.
The output should be a prompt telling the user what they have in their hand
if anything at all.
Here is what I have thus far:
****
Dim countEntered(13 ) As Boolean
Dim suitEntered(4) As Boolean
Dim x, y, z As Integer
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim handResult(13, 4) As Boolean
'Fill arrays
countEntered(1) = False
countEntered(2) = False
countEntered(3) = False
countEntered(4) = False
countEntered(5) = False
countEntered(6) = False
countEntered(7) = False
countEntered(8) = False
countEntered(9) = False
countEntered(10 ) = False
countEntered(11 ) = False
countEntered(12 ) = False
countEntered(13 ) = False
suitEntered(1) = False
suitEntered(2) = False
suitEntered(3) = False
suitEntered(4) = False
End Sub
*****
Here is what I have entered for button clicks....
Private Sub Button13_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button13.Click
countEntered(13 ) = True
Display.Text = "Ace"
y = y + 1
End Sub
Private Sub Button16_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button16.Click
suitEntered(1) = True
Display.Text = Display.Text & " of Spades"
z = z + 1
Return
End Sub
*****
My intent is to change the boolean value to true once the proper buttons
are clicked. Am I going about this the right way? Then, once the boolean
values are established in the array, how do I associate them with the card
value and return what is in the player's hand?
I'm a little confused. Any help will be greatly appreciated!
What I am wondering is how to correctly set up the array in the first
place, and then how do you access the information once the data is in the
array? Button clicks tell the array the rank and suit of the card chosen.
The output should be a prompt telling the user what they have in their hand
if anything at all.
Here is what I have thus far:
****
Dim countEntered(13 ) As Boolean
Dim suitEntered(4) As Boolean
Dim x, y, z As Integer
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim handResult(13, 4) As Boolean
'Fill arrays
countEntered(1) = False
countEntered(2) = False
countEntered(3) = False
countEntered(4) = False
countEntered(5) = False
countEntered(6) = False
countEntered(7) = False
countEntered(8) = False
countEntered(9) = False
countEntered(10 ) = False
countEntered(11 ) = False
countEntered(12 ) = False
countEntered(13 ) = False
suitEntered(1) = False
suitEntered(2) = False
suitEntered(3) = False
suitEntered(4) = False
End Sub
*****
Here is what I have entered for button clicks....
Private Sub Button13_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button13.Click
countEntered(13 ) = True
Display.Text = "Ace"
y = y + 1
End Sub
Private Sub Button16_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button16.Click
suitEntered(1) = True
Display.Text = Display.Text & " of Spades"
z = z + 1
Return
End Sub
*****
My intent is to change the boolean value to true once the proper buttons
are clicked. Am I going about this the right way? Then, once the boolean
values are established in the array, how do I associate them with the card
value and return what is in the player's hand?
I'm a little confused. Any help will be greatly appreciated!
Comment