I thank you for your reply, but I wasn't clear enough with my question...
This has to be set up as an array of Boolean type. I will be greatly
appreciative for any help I can receive. I have to create a 2D Boolean
array of size (13, 4) The contents contain a deck of 52 cards, of which
they are broken down into the obvious, hearts, spades, clubs, and diamonds,
and then obviously, the rank cards.
My question is this: I believe I have set up the array correctly, and have
it loaded when the form loads, however, I am having trouble understanding
how to access the data in the array, and then associate that data with a
particular card that the user enters. A full hand is to be analyzed by the
program and is to return a message as to whether the user has a hand that
contains anything of value: ie One Pair, Two Pair, etc.
I have included the code below.
***VB Code***
Dim handResult(13, 4) As Boolean
Dim count(13) As Integer
Dim suit(4) As Integer
Dim x, y, z As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim handResult(13, 4) As Boolean
'Fill arrays
handResult(1, 1) = count(1) & suit(1)
handResult(1, 2) = count(1) & suit(2)
handResult(1, 3) = count(1) & suit(3)
handResult(1, 4) = count(1) & suit(4)
handResult(2, 1) = count(2) & suit(1)
handResult(2, 2) = count(2) & suit(2)
handResult(2, 3) = count(2) & suit(3)
handResult(2, 4) = count(2) & suit(4)
handResult(3, 1) = count(3) & suit(1)
handResult(3, 2) = count(3) & suit(2)
handResult(3, 3) = count(3) & suit(3)
handResult(3, 4) = count(3) & suit(4)
handResult(4, 1) = count(4) & suit(1)
handResult(4, 2) = count(4) & suit(2)
handResult(4, 3) = count(4) & suit(3)
handResult(4, 4) = count(4) & suit(4)
handResult(5, 1) = count(5) & suit(1)
handResult(5, 2) = count(5) & suit(2)
handResult(5, 3) = count(5) & suit(3)
handResult(5, 4) = count(5) & suit(4)
handResult(6, 1) = count(6) & suit(1)
handResult(6, 2) = count(6) & suit(2)
handResult(6, 3) = count(6) & suit(3)
handResult(6, 4) = count(6) & suit(4)
handResult(7, 1) = count(7) & suit(1)
handResult(7, 2) = count(7) & suit(2)
handResult(7, 3) = count(7) & suit(3)
handResult(7, 4) = count(7) & suit(4)
handResult(8, 1) = count(8) & suit(1)
handResult(8, 2) = count(8) & suit(2)
handResult(8, 3) = count(8) & suit(3)
handResult(8, 4) = count(8) & suit(4)
handResult(9, 1) = count(9) & suit(1)
handResult(9, 2) = count(9) & suit(2)
handResult(9, 3) = count(9) & suit(3)
handResult(9, 4) = count(9) & suit(4)
handResult(10, 1) = count(10) & suit(1)
handResult(10, 2) = count(10) & suit(2)
handResult(10, 3) = count(10) & suit(3)
handResult(10, 4) = count(10) & suit(4)
handResult(11, 1) = count(11) & suit(1)
handResult(11, 2) = count(11) & suit(2)
handResult(11, 3) = count(11) & suit(3)
handResult(11, 4) = count(11) & suit(4)
handResult(12, 1) = count(12) & suit(1)
handResult(12, 2) = count(12) & suit(2)
handResult(12, 3) = count(12) & suit(3)
handResult(12, 4) = count(12) & suit(4)
handResult(13, 1) = count(13) & suit(1)
handResult(13, 2) = count(13) & suit(2)
handResult(13, 3) = count(13) & suit(3)
handResult(13, 4) = count(13) & suit(4)
End Sub
Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button19.Click
End
End Sub
Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button18.Click
Display.Clear()
InHand.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
count(1) = True
Display.Text = "2"
y = y + 1
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
count(2) = True
Display.Text = "3"
y = y + 1
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
count(3) = True
Display.Text = "4"
y = y + 1
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
count(4) = True
Display.Text = "5"
y = y + 1
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
count(5) = True
Display.Text = "6"
y = y + 1
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button6.Click
count(6) = True
Display.Text = "7"
y = y + 1
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button7.Click
count(7) = True
Display.Text = "8"
y = y + 1
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button8.Click
count(8) = True
Display.Text = "9"
y = y + 1
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button9.Click
count(9) = True
Display.Text = "10"
y = y + 1
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button10.Click
count(10) = True
Display.Text = "Jack"
y = y + 1
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button11.Click
count(11) = True
Display.Text = "Queen"
y = y + 1
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button12.Click
count(12) = True
Display.Text = "King"
y = y + 1
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button13.Click
count(13) = True
Display.Text = "Ace"
y = y + 1
End Sub
Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button16.Click
suit(1) = True
Display.Text = Display.Text & " of Spades"
z = z + 1
Return
End Sub
Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button17.Click
suit(2) = True
Display.Text = Display.Text & " of Hearts"
z = z + 1
Return
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button14.Click
suit(3) = True
Display.Text = Display.Text & " of Clubs"
z = z + 1
Return
End Sub
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button15.Click
suit(4) = True
Display.Text = Display.Text & " of Diamonds"
z = z + 1
Return
End Sub
Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button20.Click
'For y = 0 To 5
'If y = 5 And z >= 4 Then
'InHand.Text = Val(suitEntered)
'End If
'Next
InHand.Text = count(1) & count(2)
If (y) & (z) = 11 Then
InHand.Text = "true"
Else : InHand.Text = "false"
End If
Display.Clear()
End Sub
Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button21.Click
InHand.Clear()
Display.Clear()
End Sub
End Class
***/VB Code***
--
Message posted via
http://www.dotnetmonster.com