標題:
請問3X3井字圈叉遊戲用VB2008要怎麼做
發問:
如題 最近上課老師出的題目 小弟是初學者 煩請VB高手指點迷津 指導小弟一下 更新: 感謝暗大大 能否給個完整程式謝謝 即時:shy0936雅虎 更新 2: 謝謝您這是VB6我想要VB2008
最佳解答:
vb6的程式碼如下 稍微自己改一下就行了 若需要完整的程式 請附上E-mail Dim p, w As Integer Dim A(9) As Integer Private Sub Command1_Click() p = 0 For i = 0 To 8 squre(i).Picture = LoadPicture() A(i) = 2 Next i w = 1 End Sub Private Sub Form_Load() p = 0 For i = 0 To 8 squre(i).Picture = LoadPicture() A(i) = 2 Next i w = 1 End Sub Private Sub Label1_Click() End Sub Private Sub Label2_Click() End Sub Private Sub squre_Click(Index As Integer) If w = 1 Then squre(Index) = player(p).Picture p = 1 - p If p = 1 Then s = "O" Else s = "X" A(Index) = p If A(0) 2 Then If (A(0) = A(1) And A(1) = A(2)) Then MsgBox (s & "Win"): w = 0 If (A(0) = A(3) And A(0) = A(6)) Then MsgBox (s & "Win"): w = 0 If (A(0) = A(4) And A(0) = A(8)) Then MsgBox (s & "Win"): w = 0 End If If A(8) 2 Then If (A(2) = A(5) And A(5) = A(8)) Then MsgBox (s & "Win"): w = 0 If (A(6) = A(7) And A(7) = A(8)) Then MsgBox (s & "Win"): w = 0 End If If A(4) 2 Then If (A(1) = A(4) And A(7) = A(4)) Then MsgBox (s & "Win"): w = 0 If (A(3) = A(4) And A(4) = A(5)) Then MsgBox (s & "Win"): w = 0 If (A(6) = A(4) And A(4) = A(2)) Then MsgBox (s & "Win"): w = 0 End If End If End Sub
其他解答:
此文章來自奇摩知識+如有不便請留言告知
留言列表