Hey guys im new to vb and im trying to make this game for my class. But im having a little trouble. This is what i have so far and im wondering if you guys could look at it.




Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim arrgrid(3, 3) As Integer
Dim intwhosturn As Integer
Dim intwhoswinner As Integer
Call initgrid()
Call setdifficulty(difficulty.medium)
intwhosturn = 1
For i As Integer = 0 To 2
For j As Integer = 0 To 2
arrgrid(i, j) = 0
Next
Next
Call DrawGrid()
If arrgrid(0, 0) = 1 Then
Me.lblgrid00.Text = "O"
ElseIf arrgrid(0, 0) = 2 Then
Me.lblgrid00.Text = "X"
Else
Me.lblgrid00.Text = ""
End If
Call GridClick(0, 0)
If (arrgrid(intRow, intCol) = 0) And (intwhoswinner = 0) Then

If intwhosturn = 1 Then
arrgrid(intRow, intCol) = 1
intwhosturn = 2
ElseIf intwhosturn = 2 Then
arrgrid(intRow, intCol) = 2
intwhosturn = 1
End If

Call DrawGrid()
Call CheckWinLose()

If (intwhosturn = 2) And (intwhoswinner = 0) Then

End If
If intwhoswinner = 3 Then
MessageBox.Show("It's a draw")
ElseIf intwhoswinner = 2 Then
MessageBox.Show("You Lose")
ElseIf intwhoswinner = 1 Then
MessageBox.Show("You Win")
End If
Dim intOCount As Integer = 0
Dim intXCount As Integer = 0
Dim intTotalCount As Integer = 0
For i As Integer = 0 To 2
For j As Integer = 0 To 2
If arrgrid(i, j) = 1 Then
intOCount += 1
intTotalCount += 1
End If

If arrgrid(i, j) = 2 Then
intXCount += 1
intTotalCount += 1
End If
Next

If intOCount = 3 Then
intwhoswinner = 1
ElseIf intXCount = 3 Then
intwhoswinner = 2
End If

intOCount = 0
intXCount = 0
Next
If (intTotalCount = 9) And (intwhoswinner = 0) Then
intwhoswinner = 3
Else
intTotalCount = 0
End If
If arrgrid(0, 0) = 1 And arrgrid(1, 1) = 1 And arrgrid(2, 2) = 1 Then
intwhoswinner = 1
ElseIf arrgrid(0, 0) = 2 And arrgrid(1, 1) = 2 And arrgrid(2, 2) = 2 Then
intwhoswinner = 2
ElseIf arrgrid(0, 2) = 1 And arrgrid(1, 1) = 1 And arrgrid(2, 0) = 1 Then
intwhoswinner = 1
ElseIf arrgrid(0, 2) = 2 And arrgrid(1, 1) = 2 And arrgrid(2, 0) = 2 Then
intwhoswinner = 2
End If


End If