For i = 0 To 2
If ox(0, i) = 1 And ox(1, i) = 1 And ox(2, i) = 1
Then
result = 1
End If
If ox(i, 0) = 1 And ox(i, 1) = 1 And ox(i, 2) = 1
Then
result = 1
End If
If ox(0, i) = 2 And ox(1,i) = 2 And ox(2, i) = 2 Then
result = 2
End If
If ox(i, 0) = 2 And ox(i, 1) = 2 And ox(i, 2) = 2
Then
result = 2
End If
Next i
If ox(0, 0) = 1 And ox(1, 1) = 1 And ox(2, 2) = 1
Then
result = 1
End If
If ox(0, 0) = 2 And ox(1, 1) = 2 And ox(2, 2) = 2
Then
result = 2
End If
If ox(0, 2) = 1 And ox(1, 1) = 1 And ox(2, 0) = 1
Then
result = 1
End If
If ox(0, 2) = 2 And ox(1, 1) = 2 And ox(2, 0) = 2
Then
result = 2
End If
If result = 1 Then
Beep
lblMsg.Caption = “好棒啊!畫
O 者贏了 ※※※※※”
lblMsg.Visible = True
Timer.Enabled = False
End If
If result = 2 Then
Beep
lblMsg.Caption = “帥呆啦!畫
X 者贏了 ※※※※※”
lblMsg.Visible = True
Timer.Enabled = False
End If
If result <> 0 Then
For i = 0 To 8
cmdOX(i).Enabled = False
Next i
Else
over = True
For i = 0 To 2
For j = 0 To 2
If ox(i, j) = 0 Then
over = False
End If
Next j
Next i
If over Then
lblMsg.Enabled = True
End If
End If
End If
End Sub |