Public Class Form1
Dim Turn = 1
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
If Turn = 1 Or 3 Or 5 Or 7 Or 9 Then
MsgBox("Its Player 1s Turn")
If Turn = 1 Or 3 Or 5 Or 7 Then
Me.Label1.Text = "X"
If Turn = 2 Or 4 Or 6 Or 8 Or 10 Then
MsgBox("Its Player 2s Turn")
If Turn = 2 Or 4 Or 6 Or 8 Or 10 Then
Me.Label1.Text = "O"
End If
End If
End If
End If
Turn = Turn + 1
End Sub
i entered that code for each of the labels when clicked.
Then ran the program just to see if that part of the program worked (this is for running in 2 player mode) but when i ran it it opened and when i clicked any label first msgbox it is player1s turn came up then the box turned to "x" then immeideiteley after (without clicking anything) it came up with Msgbox player2s turn then the same label turned to O.
Can someone please help me to fix that part of the code and help me with creating codes for finding out when the game is over, making a 1 player mode for it, and anyother codes i need to make it
Thnx
John

New Topic/Question
Reply




MultiQuote







|