Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim a, b, c, d, e, f, g, h, i As Boolean 'leen si el jugador X ocupa un casillero
- Dim a2, b2, c2, d2, e2, f2, g2, h2, i2 As Boolean 'leen si el jugador O ocupa un casillero
- Dim a3, b3, c3, d3, e3, f3, g3, h3, i3 As Boolean 'leen si hay un casillero ocupado sin importar quien lo ocupa
- Dim w As Boolean 'lee si el jugador ya agoto su turno
- Private Sub Command10_Click()
- End
- End Sub
- Private Sub Form_Load()
- a = False
- b = False
- c = False
- d = False
- e = False
- f = False
- g = False
- h = False
- i = False
- a2 = False
- b2 = False
- c2 = False
- d2 = False
- e2 = False
- f2 = False
- g2 = False
- h2 = False
- i2 = False
- a3 = False
- b3 = False
- c3 = False
- d3 = False
- e3 = False
- f3 = False
- g3 = False
- h3 = False
- i3 = False
- w = True
- End Sub
- Private Sub Command1_Click()
- Text1.Text = "MENSAJE"
- If a3 = True Then 'si la casilla esta ocupada
- Text1.Text = "La casilla esta ocupada" 'imprime la casilla esta ocupada
- ElseIf w = True Then
- If vx.Visible = True Then 'sino, si es el turno de la x
- Command1.Caption = "X" 'imprime x
- a = True 'casillero ocupado por x
- a3 = True 'casillero ocupado
- w = False
- ElseIf w = True Then
- Text1.Text = "Ya paso tu turno"
- End If
- ElseIf w = False Then
- If vo.Visible = True Then 'sino, si es el turno de o
- Command1.Caption = "O" 'imprime o
- a2 = True 'casillero ocupado por o
- a3 = True 'casillero ocupado
- w = True
- ElseIf w = False Then
- Text1.Text = "Ya paso tu turno"
- End If
- End If 'fin de condicionales
- End Sub
- Private Sub Command2_Click()
- Text1.Text = "MENSAJE"
- If b3 = True Then 'si la casilla esta ocupada
- Text1.Text = "La casilla esta ocupada" 'imprime la casilla esta ocupada
- ElseIf w = True Then
- If vx.Visible = True Then 'sino, si es el turno de la x
- Command2.Caption = "X" 'imprime x
- b = True 'casillero ocupado por x
- b3 = True 'casillero ocupado
- w = False
- ElseIf w = True Then
- Text1.Text = "Ya paso tu turno"
- End If
- ElseIf w = False Then
- If vo.Visible = True Then 'sino, si es el turno de o
- Command2.Caption = "O" 'imprime o
- b2 = True 'casillero ocupado por o
- b3 = True 'casillero ocupado
- w = True
- ElseIf w = False Then
- Text1.Text = "Ya paso tu turno"
- End If
- End If 'fin de condicionales
- End Sub
- Private Sub Command3_Click()
- Text1.Text = "MENSAJE"
- If c3 = True Then 'si la casilla esta ocupada
- Text1.Text = "La casilla esta ocupada" 'imprime la casilla esta ocupada
- ElseIf w = True Then
- If vx.Visible = True Then 'sino, si es el turno de la x
- Command3.Caption = "X" 'imprime x
- c = True 'casillero ocupado por x
- c3 = True 'casillero ocupado
- w = False
- ElseIf w = True Then
- Text1.Text = "Ya paso tu turno"
- End If
- ElseIf w = False Then
- If vo.Visible = True Then 'sino, si es el turno de o
- Command3.Caption = "O" 'imprime o
- c2 = True 'casillero ocupado por o
- c3 = True 'casillero ocupado
- w = True
- ElseIf w = False Then
- Text1.Text = "Ya paso tu turno"
- End If
- End If 'fin de condicionales
- End Sub
- Private Sub Command4_Click()
- Text1.Text = "MENSAJE"
- If d3 = True Then 'si la casilla esta ocupada
- Text1.Text = "La casilla esta ocupada" 'imprime la casilla esta ocupada
- ElseIf w = True Then
- If vx.Visible = True Then 'sino, si es el turno de la x
- Command4.Caption = "X" 'imprime x
- d = True 'casillero ocupado por x
- d3 = True 'casillero ocupado
- w = False
- ElseIf w = True Then
- Text1.Text = "Ya paso tu turno"
- End If
- ElseIf w = False Then
- If vo.Visible = True Then 'sino, si es el turno de o
- Command4.Caption = "O" 'imprime o
- d2 = True 'casillero ocupado por o
- d3 = True 'casillero ocupado
- w = True
- ElseIf w = False Then
- Text1.Text = "Ya paso tu turno"
- End If
- End If 'fin de condicionales
- End Sub
- Private Sub Command5_Click()
- Text1.Text = "MENSAJE"
- If e3 = True Then 'si la casilla esta ocupada
- Text1.Text = "La casilla esta ocupada" 'imprime la casilla esta ocupada
- ElseIf w = True Then
- If vx.Visible = True Then 'sino, si es el turno de la x
- Command5.Caption = "X" 'imprime x
- e = True 'casillero ocupado por x
- e3 = True 'casillero ocupado
- w = False
- ElseIf w = True Then
- Text1.Text = "Ya paso tu turno"
- End If
- ElseIf w = False Then
- If vo.Visible = True Then 'sino, si es el turno de o
- Command5.Caption = "O" 'imprime o
- e2 = True 'casillero ocupado por o
- e3 = True 'casillero ocupado
- w = True
- ElseIf w = False Then
- Text1.Text = "Ya paso tu turno"
- End If
- End If 'fin de condicionales
- End Sub
- Private Sub Command6_Click()
- Text1.Text = "MENSAJE"
- If f3 = True Then 'si la casilla esta ocupada
- Text1.Text = "La casilla esta ocupada" 'imprime la casilla esta ocupada
- ElseIf w = True Then
- If vx.Visible = True Then 'sino, si es el turno de la x
- Command6.Caption = "X" 'imprime x
- f = True 'casillero ocupado por x
- f3 = True 'casillero ocupado
- w = False
- ElseIf w = True Then
- Text1.Text = "Ya paso tu turno"
- End If
- ElseIf w = False Then
- If vo.Visible = True Then 'sino, si es el turno de o
- Command6.Caption = "O" 'imprime o
- f2 = True 'casillero ocupado por o
- f3 = True 'casillero ocupado
- w = True
- ElseIf w = False Then
- Text1.Text = "Ya paso tu turno"
- End If
- End If 'fin de condicionales
- End Sub
- Private Sub Command7_Click()
- Text1.Text = "MENSAJE"
- If g3 = True Then 'si la casilla esta ocupada
- Text1.Text = "La casilla esta ocupada" 'imprime la casilla esta ocupada
- ElseIf w = True Then
- If vx.Visible = True Then 'sino, si es el turno de la x
- Command7.Caption = "X" 'imprime x
- g = True 'casillero ocupado por x
- g3 = True 'casillero ocupado
- w = False
- ElseIf w = True Then
- Text1.Text = "Ya paso tu turno"
- End If
- ElseIf w = False Then
- If vo.Visible = True Then 'sino, si es el turno de o
- Command7.Caption = "O" 'imprime o
- g2 = True 'casillero ocupado por o
- g3 = True 'casillero ocupado
- w = True
- ElseIf w = False Then
- Text1.Text = "Ya paso tu turno"
- End If
- End If 'fin de condicionales
- End Sub
- Private Sub Command8_Click()
- Text1.Text = "MENSAJE"
- If h3 = True Then 'si la casilla esta ocupada
- Text1.Text = "La casilla esta ocupada" 'imprime la casilla esta ocupada
- ElseIf w = True Then
- If vx.Visible = True Then 'sino, si es el turno de la x
- Command8.Caption = "X" 'imprime x
- h = True 'casillero ocupado por x
- h3 = True 'casillero ocupado
- w = False
- ElseIf w = True Then
- Text1.Text = "Ya paso tu turno"
- End If
- ElseIf w = False Then
- If vo.Visible = True Then 'sino, si es el turno de o
- Command8.Caption = "O" 'imprime o
- h2 = True 'casillero ocupado por o
- h3 = True 'casillero ocupado
- w = True
- ElseIf w = False Then
- Text1.Text = "Ya paso tu turno"
- End If
- End If 'fin de condicionales
- End Sub
- Private Sub Command9_Click()
- Text1.Text = "MENSAJE"
- If i3 = True Then 'si la casilla esta ocupada
- Text1.Text = "La casilla esta ocupada" 'imprime la casilla esta ocupada
- ElseIf w = True Then
- If vx.Visible = True Then 'sino, si es el turno de la x
- Command9.Caption = "X" 'imprime x
- i = True 'casillero ocupado por x
- i3 = True 'casillero ocupado
- w = False
- ElseIf w = True Then
- Text1.Text = "Ya paso tu turno"
- End If
- ElseIf w = False Then
- If vo.Visible = True Then 'sino, si es el turno de o
- Command9.Caption = "O" 'imprime o
- i2 = True 'casillero ocupado por o
- i3 = True 'casillero ocupado
- w = True
- ElseIf w = False Then
- Text1.Text = "Ya paso tu turno"
- End If
- End If 'fin de condicionales
- End Sub
- Private Sub vx_Click()
- 'VERIFICA SI HAY GANADOR O EMPATE
- If a = True And b = True And c = True Then
- Text1.Text = "GANASTE CRUZ!!"
- Beep
- volver.Visible = True
- txt_x.Text = txt_x.Text + 1
- ElseIf d = True And e = True And f = True Then
- Text1.Text = "GANASTE CRUZ!!"
- Beep
- volver.Visible = True
- txt_x.Text = txt_x.Text + 1
- ElseIf g = True And h = True And i = True Then
- Text1.Text = "GANASTE CRUZ!!"
- Beep
- volver.Visible = True
- txt_x.Text = txt_x.Text + 1
- ElseIf a = True And d = True And g = True Then
- Text1.Text = "GANASTE CRUZ!!"
- Beep
- volver.Visible = True
- txt_x.Text = txt_x.Text + 1
- ElseIf b = True And e = True And h = True Then
- Text1.Text = "GANASTE CRUZ!!"
- Beep
- volver.Visible = True
- txt_x.Text = txt_x.Text + 1
- ElseIf c = True And f = True And i = True Then
- Text1.Text = "GANASTE CRUZ!!"
- Beep
- volver.Visible = True
- txt_x.Text = txt_x.Text + 1
- ElseIf a = True And e = True And i = True Then
- Text1.Text = "GANASTE CRUZ!!"
- Beep
- volver.Visible = True
- txt_x.Text = txt_x.Text + 1
- ElseIf c = True And e = True And g = True Then
- Text1.Text = "GANASTE CRUZ!!"
- Beep
- volver.Visible = True
- txt_x.Text = txt_x.Text + 1
- ElseIf a3 = True And b3 = True And c3 = True And d3 = True And e3 = True And f3 = True And g3 = True And h3 = True And i3 = True Then
- Text1.Text = "EMPATE"
- Beep
- volver.Visible = True
- Else
- vx.Visible = False
- vo.Visible = True
- Text1.Text = "MENSAJE"
- End If
- End Sub
- Private Sub vo_Click()
- If a2 = True And b2 = True And c2 = True Then
- Text1.Text = "GANASTE CIRCULO!!"
- Beep
- volver.Visible = True
- txt_o.Text = txt_o.Text + 1
- ElseIf d2 = True And e2 = True And f2 = True Then
- Text1.Text = "GANASTE CIRCULO!!"
- Beep
- volver.Visible = True
- txt_o.Text = txt_o.Text + 1
- ElseIf g2 = True And h2 = True And i2 = True Then
- Text1.Text = "GANASTE CIRCULO!!"
- Beep
- volver.Visible = True
- txt_o.Text = txt_o.Text + 1
- ElseIf a2 = True And d2 = True And g2 = True Then
- Text1.Text = "GANASTE CIRCULO!!"
- Beep
- volver.Visible = True
- txt_o.Text = txt_o.Text + 1
- ElseIf b2 = True And e2 = True And h2 = True Then
- Text1.Text = "GANASTE CIRCULO!!"
- Beep
- volver.Visible = True
- txt_o.Text = txt_o.Text + 1
- ElseIf c2 = True And f2 = True And i2 = True Then
- Text1.Text = "GANASTE CIRCULO!!"
- Beep
- volver.Visible = True
- txt_o.Text = txt_o.Text + 1
- ElseIf a2 = True And e2 = True And i2 = True Then
- Text1.Text = "GANASTE CIRCULO!!"
- Beep
- volver.Visible = True
- txt_o.Text = txt_o.Text + 1
- ElseIf c2 = True And e2 = True And g2 = True Then
- Text1.Text = "GANASTE CIRCULO!!"
- Beep
- volver.Visible = True
- txt_o.Text = txt_o.Text + 1
- Else
- vo.Visible = False
- vx.Visible = True
- Text1.Text = "MENSAJE"
- End If
- End Sub
- Private Sub volver_Click()
- Command1.Caption = ""
- Command2.Caption = ""
- Command3.Caption = ""
- Command4.Caption = ""
- Command5.Caption = ""
- Command6.Caption = ""
- Command7.Caption = ""
- Command8.Caption = ""
- Command9.Caption = ""
- Text1.Text = "MENSAJE"
- a = False
- b = False
- c = False
- d = False
- e = False
- f = False
- g = False
- h = False
- i = False
- a2 = False
- b2 = False
- c2 = False
- d2 = False
- e2 = False
- f2 = False
- g2 = False
- h2 = False
- i2 = False
- a3 = False
- b3 = False
- c3 = False
- d3 = False
- e3 = False
- f3 = False
- g3 = False
- h3 = False
- i3 = False
- w = True
- vo.Visible = False
- vx.Visible = True
- volver.Visible = False
- End Sub
- Private Sub Command11_Click()
- txt_o.Text = "0"
- txt_x.Text = "0"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement