我正在为自己制作一个扑克游戏,我有其余的代码,但我似乎不知道如何搜索七张牌以查看是否有顺子(玩家手中的 5 张外卡和 2 张牌) ,卡片是数字(1 是王牌,2 是 2,等等。11 是杰克,12 是王后等)到目前为止我有这个:
Function isStraight(ByVal Player As String)
Dim h1, h2, h3, h4, h5 As String
h1 = 0
h2 = 1
h3 = 2
h4 = 3
h5 = 4
Dim z1, z2 As String
If Player = "P1" Then
z1 = P1Card1
z2 = P1Card2
ElseIf Player = "P2" Then
z1 = P2Card1
z2 = P2Card2
End If
Dim cntr As Integer = 0
Do
cntr = cntr + 1
h1 = h1 + 1
h2 = h2 + 1
h3 = h3 + 1
h4 = h4 + 1
h5 = h5 + 1
If A(FC1, FC2, FC3, FC4, FC5) Or A(FC5, FC1, FC2, FC3, FC4) Or A(FC4, FC5, FC1, FC2, FC3) Or A(FC3, FC4, FC5, FC1, FC2) Then
End If
Loop
提前致谢!