Tic Tac Toe juego (5 / 5 paso)

Paso 5: El contador de Victoria

38. ahora queremos programar la gana, por lo que nombramos las cuerdas "BlueWin" y "RedWin" bajo un nuevo Private Sub.

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
BlueWinCounter.Text = BlueWin
End If

Si OvalShape4.Visible = True y OvalShape5.Visible = True y OvalShape6.Visible = True Then
BlueWinCounter.Text = BlueWin
End If

Si OvalShape7.Visible = True y OvalShape8.Visible = True y OvalShape9.Visible = True Then
BlueWinCounter.Text = BlueWin
End If

Si OvalShape1.Visible = True y OvalShape4.Visible = True y OvalShape7.Visible = True Then
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.

Artículos Relacionados

Tic Tac Toe juego usando Arduino

Tic Tac Toe juego usando Arduino

Tic Tac Toe es un juego popular de papel de dos jugadores en que primer jugador que complete una fila o columna o diagonal de 'X' o ' o ' wins. Si nadie no pudo lograr la hazaña, se dibuja el partido.Paso 1: Componentes necesarios1) Arduino Uno / Nan
FPGA Tic Tac Toe

FPGA Tic Tac Toe

¿"Tic Tac Toe? ¿Qué es eso? Nunca oí de eso."-Nadie nuncaPor Ryan Frawley y Derek NguyenEsta guía le mostrará cómo hacer un trabajo de Tic Tac Toe juego en VHDL en un tablero de SDMONexys 2 FPGA. Este tutorial fue hecho por parte de un proyecto
Microcontrolador ATMEL juega el juego de Tic-Tac-Toe

Microcontrolador ATMEL juega el juego de Tic-Tac-Toe

juego de Tic-Tac-Toe implementado con microcontrolador ATmega168 de desnudo hueso. Trabaja en lo más baja posible para esta frecuencia de controlador 1 MHz. Permite a la energía de dos baterías AAA.  Puede encontrar algunos detalles adicionales en es
Tic Tac Toe de viaje

Tic Tac Toe de viaje

Dedo del pie de tic tac es un juego de viaje impresionante que puede mantener a niños y adultos ocupados durante las horas de un viaje por carretera. Con un poco de fieltro y creatividad pude hacer una placa impresionante viaje reutilizable tic tac t
Robot de Tic-Tac-Toe

Robot de Tic-Tac-Toe

en este Instructable mostrará cómo hacer un brazo robot que juega Tic Tac Toe utilizando un controlador de robot mago Micro, 4 servos y bloques de construcción / materiales de su elección. El cableado es muy simple, apenas enchufe 4 servos y la bater
Cómo escribir un programa de Tic-Tac-Toe en Java

Cómo escribir un programa de Tic-Tac-Toe en Java

Introducción:Tres en raya es un juego muy común que es bastante fácil de jugar. Las reglas del juego son simples y bien conocidos. Debido a estas cosas, Tic-Tac-Toe es bastante fácil de código de arriba. En este tutorial, buscará cómo codificar un tr
Ganar estrategias TIC-TAC-Toe

Ganar estrategias TIC-TAC-Toe

Todo el mundo ama el simple juego de Tic-Tac-Toe, pero parece como un juego al azar. En realidad, no!Parece que muchos conflictos pueden resolverse mediante un simple juego...Ahora usted puede ganar la siguiente Juega-Tic-tac-toe-off mirando estas 4
Hacer Tic Tac Toe en Java

Hacer Tic Tac Toe en Java

este instructivo le guiará, paso a paso, por lo que Tic Tac Toe en Java! Esto no pretende ser un resumen del lenguaje Java, pero más de un ejemplo guiado. El primer paso será ir sobre algunos conceptos básicos para hacer el resto de la guía bajar sua
Arduino y Touchpad Tic Tac Toe

Arduino y Touchpad Tic Tac Toe

o un ejercicio de entrada y salida de la multiplexación y trabajar con bits.  Y una presentación para el concurso de Arduino.Se trata de una implementación de un juego de tic tac toe utilizando una matriz de 3 x 3 de doble color LED para la pantalla,
Tic Tac Toe

Tic Tac Toe

Tic Tac ToeEste es un proyecto muy sencillo que cualquiera puede hacer, que realmente podría hacer esto con herramientas limitadas.Utilizar y reciclar un viejo tablero Rimu Head pero puede usar cualquier cosa. (También se puede hacer esto cualquier t
Tic-Tac-Toe K'nex

Tic-Tac-Toe K'nex

¿quién no conoce este juego? Tres en raya, uno de los juegos más jugados de siempre. Recientemente, he hecho las tres en raya que ha hecho Daniel662000. Vi que podía utilizar la mejora, así que hice esta versión. Es más pequeño y tiene una menor cant
Diversión rústico Tic Tac Toe

Diversión rústico Tic Tac Toe

Tic Tac Toe el amor?? ¡Yo también! Yo he jugado desde que era niño, ahora gano bien o es un sorteo ;-DEs un divertido juego para jugar con los niños y hacer esta versión rústica hace más divertido! Hacerlo y lo regalo! Todo el mundo le encantaría :-)
Inteligente Arduino Uno y la Mega Tic Tac Toe (tres en raya)

Inteligente Arduino Uno y la Mega Tic Tac Toe (tres en raya)

He decidido crear el clásico juego de tres en raya (o Tic Tac Toe, como también se conoce) en el Arduino después de ser pedido por mi hija si podríamos construir un juego juntos. Aquí está un video jugando la versión final en el Arduino Mega. El segu
Cómo ganar Tic Tac Toe: Simple!

Cómo ganar Tic Tac Toe: Simple!

Hola, soy InstructableUltimate y hoy mostrará usted cómo ganar Tic Tac Toe en pocos pasos, y esto es muy simple!Paso 1: Ganar yendo primero Bueno, eso es una victoria fácil. Adiós y espero que esto te ayudó! (Si esto no funciona, recuerda que tu opon