Paso 5: El contador de Victoria
Privada Sub RoundWin_Show(sender As System.Object, e As System.EventArgs) maneja Me.MouseMove End Sub
'Este es el código que va a pasar cuando el ratón se mueve'.
39. Inserte el código siguiente entre las privadas Sub y End Sub
Dim BlueWin como cadena = Str$(Val(BlueWinCounter.Text) + 1)
Dim RedWin como cadena = Str$(Val(RedWinCounter.Text) + 1)
' Este es el código que hace BlueWin y RedWin una cadena. Si el evento ocurre agrega puntuación de + 1 al jugador.»
40. el siguiente código es el gana.
Si OvalShape1.Visible = True y OvalShape2.Visible = True y OvalShape3.Visible = True Then Si OvalShape4.Visible = True y OvalShape5.Visible = True y OvalShape6.Visible = True Then Si OvalShape7.Visible = True y OvalShape8.Visible = True y OvalShape9.Visible = True Then Si OvalShape1.Visible = True y OvalShape4.Visible = True y OvalShape7.Visible = True Then
BlueWinCounter.Text = BlueWin
End If
BlueWinCounter.Text = BlueWin
End If
BlueWinCounter.Text = BlueWin
End If
BlueWinCounter.Text = BlueWin
End If
Si OvalShape2.Visible = True y OvalShape5.Visible = True y OvalShape8.Visible = True Then
BlueWinCounter.Text = BlueWin
End If
Si OvalShape3.Visible = True y OvalShape6.Visible = True y OvalShape9.Visible = True Then
BlueWinCounter.Text = BlueWin
End If
Si OvalShape1.Visible = True y OvalShape5.Visible = True y OvalShape9.Visible = True Then
BlueWinCounter.Text = BlueWin
End If
Si OvalShape3.Visible = True y OvalShape5.Visible = True y OvalShape7.Visible = True Then
BlueWinCounter.Text = BlueWin
End If
Si LineShape1.Visible y LineShape3.Visible y LineShape5.Visible = True Then
RedWinCounter.Text = RedWin
End If
Si LineShape7.Visible y LineShape9.Visible y LineShape11.Visible = True Then
RedWinCounter.Text = RedWin
End If
Si LineShape13.Visible y LineShape15.Visible y LineShape17.Visible = True Then
RedWinCounter.Text = RedWin
End If
Si LineShape1.Visible y LineShape7.Visible y LineShape13.Visible = True Then
RedWinCounter.Text = RedWin
End If
Si LineShape3.Visible y LineShape9.Visible y LineShape15.Visible = True Then
RedWinCounter.Text = RedWin
End If
Si LineShape5.Visible y LineShape11.Visible y LineShape17.Visible = True Then
RedWinCounter.Text = RedWin
End If
Si LineShape1.Visible y LineShape9.Visible y LineShape17.Visible = True Then
RedWinCounter.Text = RedWin
End If
Si LineShape5.Visible y LineShape9.Visible y LineShape13.Visible = True Then
RedWinCounter.Text = RedWin
End If
'Agrega 1 al contador de ganar si hay un 3 en una fila'
41. insertar el siguiente código debajo del código anterior entrado:
Si OvalShape1.Visible = True y OvalShape2.Visible = True y OvalShape3.Visible = True o
OvalShape4.Visible = True y OvalShape5.Visible = True y OvalShape6.Visible = True o
OvalShape7.Visible = True y OvalShape8.Visible = True y OvalShape9.Visible = True o
OvalShape1.Visible = True y OvalShape4.Visible = True y OvalShape7.Visible = True o
OvalShape2.Visible = True y OvalShape5.Visible = True y OvalShape8.Visible = True o
OvalShape3.Visible = True y OvalShape6.Visible = True y OvalShape9.Visible = True o
OvalShape1.Visible = True y OvalShape5.Visible = True y OvalShape9.Visible = True o
OvalShape3.Visible = True y OvalShape5.Visible = True y OvalShape7.Visible = True o
LineShape1.Visible = True y LineShape3.Visible = True y OvalShape5.Visible = True o
LineShape7.Visible = True y LineShape9.Visible = True y LineShape11.Visible = True o
LineShape13.Visible = True y LineShape15.Visible = True y LineShape17.Visible = True o
LineShape1.Visible = True y LineShape7.Visible = True y LineShape13.Visible = True o
LineShape3.Visible = True y LineShape9.Visible = True y LineShape15.Visible = True o
LineShape5.Visible = True y LineShape11.Visible = True y LineShape17.Visible = True o
LineShape1.Visible = True y LineShape9.Visible = True y LineShape17.Visible = True o
LineShape5.Visible = True y LineShape9.Visible = True y LineShape13.Visible = True o
RectangleShape1.Enabled = False y RectangleShape2.Enabled = False y RectangleShape3.Enabled = False y RectangleShape4.Enabled = False y RectangleShape5.Enabled = False y RectangleShape6.Enabled = False y RectangleShape7.Enabled = False y RectangleShape8.Enabled = False y RectangleShape9.Enabled = False Then
Éstos son todas las posibilidades de una victoria
OvalShape1.Visible = False
OvalShape2.Visible = False
OvalShape3.Visible = False
OvalShape4.Visible = False
OvalShape5.Visible = False
OvalShape6.Visible = False
OvalShape7.Visible = False
OvalShape8.Visible = False
OvalShape9.Visible = False
LineShape1.Visible = False
LineShape2.Visible = False
LineShape3.Visible = False
LineShape4.Visible = False
LineShape5.Visible = False
LineShape6.Visible = False
LineShape7.Visible = False
LineShape8.Visible = False
LineShape9.Visible = False
LineShape10.Visible = False
LineShape11.Visible = False
LineShape12.Visible = False
LineShape13.Visible = False
LineShape14.Visible = False
LineShape15.Visible = False
LineShape16.Visible = False
LineShape17.Visible = False
LineShape18.Visible = False
'Hace que todos los círculos y cruces invisibles'
RectangleShape1.Enabled = True
RectangleShape2.Enabled = True
RectangleShape3.Enabled = True
RectangleShape4.Enabled = True
RectangleShape5.Enabled = True
RectangleShape6.Enabled = True
RectangleShape7.Enabled = True
RectangleShape8.Enabled = True
RectangleShape9.Enabled = True
'Esto permitirá que las cajas otra vez'
End si
'Si hay una victoria restablezca el tablero de juego'
42. depurar el juego y solucionar los errores encontrados.