SlideShare a Scribd company logo
Public Class Form1
Dim navegador As String = "x"
Dim contadorx As Integer = 0
Dim contadory As Integer = 0
Dim gatitodetector As Integer = 0
Public Function xoy(ByVal nav As String)
If nav = "x" Then
navegador = "0"
Return "x"
Else
navegador = "x"
Return "0"
End If
End Function
Public Sub ganarX()
gatitodetector += 1
If Button1.Text = "x" And Button2.Text = "x" And Button3.Text = "x" Then
MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ")
endofgame()
ElseIf Button4.Text = "x" And Button5.Text = "x" And Button6.Text = "x"
Then
MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ")
endofgame()
ElseIf Button7.Text = "x" And Button8.Text = "x" And Button9.Text = "x"
Then
MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ")
endofgame()
ElseIf Button1.Text = "x" And Button4.Text = "x" And Button7.Text = "x"
Then
MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ")
endofgame()
ElseIf Button2.Text = "x" And Button5.Text = "x" And Button8.Text = "x"
Then
MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ")
endofgame()
ElseIf Button3.Text = "x" And Button6.Text = "x" And Button9.Text = "x"
Then
MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ")
endofgame()
ElseIf Button1.Text = "x" And Button5.Text = "x" And Button9.Text = "x"
Then
MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ")
endofgame()
ElseIf Button3.Text = "x" And Button5.Text = "x" And Button7.Text = "x"
Then
MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ")
endofgame()
End If
ganar0()
End Sub
Public Sub ganar0()
If Button1.Text = "0" And Button2.Text = "0" And Button3.Text = "0" Then
MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ")
endofgame2()
ElseIf Button4.Text = "0" And Button5.Text = "0" And Button6.Text = "0"
Then
MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ")
endofgame2()
ElseIf Button7.Text = "0" And Button8.Text = "0" And Button9.Text = "0"
Then
MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ")
endofgame2()
ElseIf Button1.Text = "0" And Button4.Text = "0" And Button7.Text = "0"
Then
MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ")
endofgame2()
ElseIf Button2.Text = "0" And Button5.Text = "0" And Button8.Text = "0"
Then
MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ")
endofgame2()
ElseIf Button3.Text = "0" And Button6.Text = "0" And Button9.Text = "0"
Then
MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ")
endofgame2()
ElseIf Button1.Text = "0" And Button5.Text = "0" And Button9.Text = "0"
Then
MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ")
endofgame2()
ElseIf Button3.Text = "0" And Button5.Text = "0" And Button7.Text = "0"
Then
MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ")
endofgame2()
ElseIf gatitodetector = 9 Then
MsgBox(" Nadie gana este juego.", MsgBoxStyle.Information, " Nadie
gana")
gatitodetector = 0
End If
End Sub
Public Sub endofgame()
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
contadorx += 1
gatitodetector = 0
lblContadorX.Text = contadorx.ToString
End Sub
Public Sub endofgame2()
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
contadory += 1
gatitodetector = 0
lblContadorY.Text = contadory.ToString
End Sub
Public Sub resetiar()
Button1.Enabled = True
Button2.Enabled = True
Button3.Enabled = True
Button4.Enabled = True
Button5.Enabled = True
Button6.Enabled = True
Button7.Enabled = True
Button8.Enabled = True
Button9.Enabled = True
Button1.Text = ""
Button2.Text = ""
Button3.Text = ""
Button4.Text = ""
Button5.Text = ""
Button6.Text = ""
Button7.Text = ""
Button8.Text = ""
Button9.Text = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Button1.Text = xoy(navegador)
Button1.Enabled = False
ganarX()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Button2.Text = xoy(navegador)
Button2.Enabled = False
ganarX()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Button3.Text = xoy(navegador)
Button3.Enabled = False
ganarX()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Button4.Text = xoy(navegador)
Button4.Enabled = False
ganarX()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Button5.Text = xoy(navegador)
Button5.Enabled = False
ganarX()
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button6.Click
Button6.Text = xoy(navegador)
Button6.Enabled = False
ganarX()
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button7.Click
Button7.Text = xoy(navegador)
Button7.Enabled = False
ganarX()
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button8.Click
Button8.Text = xoy(navegador)
Button8.Enabled = False
ganarX()
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button9.Click
Button9.Text = xoy(navegador)
Button9.Enabled = False
ganarX()
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub NewGaToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles NewGaToolStripMenuItem.Click
resetiar()
gatitodetector = 0
End Sub
End Class

More Related Content

What's hot

Tópicos Avanzados de Programación - Unidad 4 Acceso a datos
Tópicos Avanzados de Programación - Unidad 4 Acceso a datosTópicos Avanzados de Programación - Unidad 4 Acceso a datos
Tópicos Avanzados de Programación - Unidad 4 Acceso a datos
José Antonio Sandoval Acosta
 
Ejercicios de transacciones
Ejercicios de transaccionesEjercicios de transacciones
Ejercicios de transacciones
María Luisa Velasco
 
Creación de tablas y relaciones en MySQL y SQL yog
Creación de tablas y relaciones en MySQL y SQL yogCreación de tablas y relaciones en MySQL y SQL yog
Creación de tablas y relaciones en MySQL y SQL yog
Jair Ospino Ardila
 
Taller de Base de Datos - Unidad 6 SQL procedural
Taller de Base de Datos - Unidad 6 SQL proceduralTaller de Base de Datos - Unidad 6 SQL procedural
Taller de Base de Datos - Unidad 6 SQL procedural
José Antonio Sandoval Acosta
 
Tablas en html
Tablas en htmlTablas en html
Tablas en html
Elim Aqp
 
4.1.4.5 packet tracer
4.1.4.5 packet tracer  4.1.4.5 packet tracer
4.1.4.5 packet tracer
Eliseo Sanabria
 
Grafos
GrafosGrafos
Fragmentación vertical - MySQL
Fragmentación vertical - MySQLFragmentación vertical - MySQL
Fragmentación vertical - MySQL
Angel Vazquez
 
Pruebas del Software
Pruebas del SoftwarePruebas del Software
Pruebas del Software
Juan Pablo Bustos Thames
 
5. Ejercicios normalización
5. Ejercicios normalización5. Ejercicios normalización
5. Ejercicios normalización
Marcelo Herrera
 
Ordenamiento burbuja
Ordenamiento burbuja Ordenamiento burbuja
Ordenamiento burbuja
luis cedeño
 
8.realizacion de pruebas
8.realizacion de pruebas8.realizacion de pruebas
8.realizacion de pruebas
Jose Benítez Andrades
 
GESTIÓN DE LA CONFIGURACIÓN DEL SOFTWARE (GCS)
GESTIÓN DE LA CONFIGURACIÓN DEL SOFTWARE (GCS)GESTIÓN DE LA CONFIGURACIÓN DEL SOFTWARE (GCS)
GESTIÓN DE LA CONFIGURACIÓN DEL SOFTWARE (GCS)
Mónica María Espejo Pérez
 
Estimacion de costos del Software
Estimacion de costos del SoftwareEstimacion de costos del Software
Estimacion de costos del Software
Proyectos de Sistemas - UNPRG
 
Ejercicios
EjerciciosEjercicios
Ejercicios
Ricardo Tejera
 
Algebra relacional
Algebra relacionalAlgebra relacional
Algebra relacional
DorvinEduardo
 
Codigo para crear la base de datos
Codigo para crear la base de datosCodigo para crear la base de datos
Codigo para crear la base de datos
Alvaro Cardona
 
Tópicos Avanzados de Programación - Unidad 1 GUI
Tópicos Avanzados de Programación - Unidad 1 GUITópicos Avanzados de Programación - Unidad 1 GUI
Tópicos Avanzados de Programación - Unidad 1 GUI
José Antonio Sandoval Acosta
 
Arboles min max
Arboles min maxArboles min max
Arboles min max
Amanda Solano Astorga
 
Herramientas case
Herramientas caseHerramientas case
Herramientas case
Luis Sanchez
 

What's hot (20)

Tópicos Avanzados de Programación - Unidad 4 Acceso a datos
Tópicos Avanzados de Programación - Unidad 4 Acceso a datosTópicos Avanzados de Programación - Unidad 4 Acceso a datos
Tópicos Avanzados de Programación - Unidad 4 Acceso a datos
 
Ejercicios de transacciones
Ejercicios de transaccionesEjercicios de transacciones
Ejercicios de transacciones
 
Creación de tablas y relaciones en MySQL y SQL yog
Creación de tablas y relaciones en MySQL y SQL yogCreación de tablas y relaciones en MySQL y SQL yog
Creación de tablas y relaciones en MySQL y SQL yog
 
Taller de Base de Datos - Unidad 6 SQL procedural
Taller de Base de Datos - Unidad 6 SQL proceduralTaller de Base de Datos - Unidad 6 SQL procedural
Taller de Base de Datos - Unidad 6 SQL procedural
 
Tablas en html
Tablas en htmlTablas en html
Tablas en html
 
4.1.4.5 packet tracer
4.1.4.5 packet tracer  4.1.4.5 packet tracer
4.1.4.5 packet tracer
 
Grafos
GrafosGrafos
Grafos
 
Fragmentación vertical - MySQL
Fragmentación vertical - MySQLFragmentación vertical - MySQL
Fragmentación vertical - MySQL
 
Pruebas del Software
Pruebas del SoftwarePruebas del Software
Pruebas del Software
 
5. Ejercicios normalización
5. Ejercicios normalización5. Ejercicios normalización
5. Ejercicios normalización
 
Ordenamiento burbuja
Ordenamiento burbuja Ordenamiento burbuja
Ordenamiento burbuja
 
8.realizacion de pruebas
8.realizacion de pruebas8.realizacion de pruebas
8.realizacion de pruebas
 
GESTIÓN DE LA CONFIGURACIÓN DEL SOFTWARE (GCS)
GESTIÓN DE LA CONFIGURACIÓN DEL SOFTWARE (GCS)GESTIÓN DE LA CONFIGURACIÓN DEL SOFTWARE (GCS)
GESTIÓN DE LA CONFIGURACIÓN DEL SOFTWARE (GCS)
 
Estimacion de costos del Software
Estimacion de costos del SoftwareEstimacion de costos del Software
Estimacion de costos del Software
 
Ejercicios
EjerciciosEjercicios
Ejercicios
 
Algebra relacional
Algebra relacionalAlgebra relacional
Algebra relacional
 
Codigo para crear la base de datos
Codigo para crear la base de datosCodigo para crear la base de datos
Codigo para crear la base de datos
 
Tópicos Avanzados de Programación - Unidad 1 GUI
Tópicos Avanzados de Programación - Unidad 1 GUITópicos Avanzados de Programación - Unidad 1 GUI
Tópicos Avanzados de Programación - Unidad 1 GUI
 
Arboles min max
Arboles min maxArboles min max
Arboles min max
 
Herramientas case
Herramientas caseHerramientas case
Herramientas case
 

Viewers also liked

Juego Tres En Raya
Juego Tres En RayaJuego Tres En Raya
Juego Tres En Raya
kruskaya salazar
 
Maximax, maximin y Minimax
Maximax, maximin y MinimaxMaximax, maximin y Minimax
Maximax, maximin y Minimax
decisiones
 
Algoritmo minimax
Algoritmo minimaxAlgoritmo minimax
Algoritmo minimax
JeffoG92
 
Proyecto tres en raya electrónico
Proyecto tres en raya electrónicoProyecto tres en raya electrónico
Proyecto tres en raya electrónico
mtcarda
 
Minimax
MinimaxMinimax
Minimax
Karen Mendoza
 
Mundelein il appliance repair
Mundelein il appliance repairMundelein il appliance repair
Mundelein il appliance repair
jamesdolbeare
 
PODA ALFA-BETA
PODA ALFA-BETAPODA ALFA-BETA
PODA ALFA-BETA
Raquel Solano
 
BúSqueda Primero En Anchura
BúSqueda Primero En AnchuraBúSqueda Primero En Anchura
BúSqueda Primero En Anchura
mapaz91
 
Arreglos c++
Arreglos c++Arreglos c++
Arreglos c++
Johnny Paucar
 

Viewers also liked (9)

Juego Tres En Raya
Juego Tres En RayaJuego Tres En Raya
Juego Tres En Raya
 
Maximax, maximin y Minimax
Maximax, maximin y MinimaxMaximax, maximin y Minimax
Maximax, maximin y Minimax
 
Algoritmo minimax
Algoritmo minimaxAlgoritmo minimax
Algoritmo minimax
 
Proyecto tres en raya electrónico
Proyecto tres en raya electrónicoProyecto tres en raya electrónico
Proyecto tres en raya electrónico
 
Minimax
MinimaxMinimax
Minimax
 
Mundelein il appliance repair
Mundelein il appliance repairMundelein il appliance repair
Mundelein il appliance repair
 
PODA ALFA-BETA
PODA ALFA-BETAPODA ALFA-BETA
PODA ALFA-BETA
 
BúSqueda Primero En Anchura
BúSqueda Primero En AnchuraBúSqueda Primero En Anchura
BúSqueda Primero En Anchura
 
Arreglos c++
Arreglos c++Arreglos c++
Arreglos c++
 

Similar to Tic tac toe code

Correction s+ rie_vb
Correction s+ rie_vbCorrection s+ rie_vb
Correction s+ rie_vb
Marwane Lamouri
 
Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008
atsumagaysay
 
Practica porfe agustin eliminar y grabar
Practica porfe agustin eliminar y grabarPractica porfe agustin eliminar y grabar
Practica porfe agustin eliminar y grabar
Yosselin Marquez
 
Reservasi hotel
Reservasi hotelReservasi hotel
Reservasi hotel
dian pw
 
Please help with this. program must be written in C# .. All of the g.pdf
Please help with this. program must be written in C# .. All of the g.pdfPlease help with this. program must be written in C# .. All of the g.pdf
Please help with this. program must be written in C# .. All of the g.pdf
manjan6
 
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITYDOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
GOKUL SREE
 
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88
Mahmoud Samir Fayed
 
1. Determine the output displayed when the button is clicked.Priva.docx
1. Determine the output displayed when the button is clicked.Priva.docx1. Determine the output displayed when the button is clicked.Priva.docx
1. Determine the output displayed when the button is clicked.Priva.docx
corbing9ttj
 
1. Determine the output displayed when the button is clicked. Priv.docx
1. Determine the output displayed when the button is clicked. Priv.docx1. Determine the output displayed when the button is clicked. Priv.docx
1. Determine the output displayed when the button is clicked. Priv.docx
corbing9ttj
 
Inventory management
Inventory managementInventory management
Inventory management
Rajeev Sharan
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บท
MareenaHahngeh
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บท
MareenaHahngeh
 
Form1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdfForm1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdf
apleather
 
Hint 1 2D array of type Button, all buttons hidden except for one.pdf
Hint 1 2D array of type Button, all buttons hidden except for one.pdfHint 1 2D array of type Button, all buttons hidden except for one.pdf
Hint 1 2D array of type Button, all buttons hidden except for one.pdf
Footageetoffe16
 
Ejercicio sql server vs visual .net
Ejercicio sql server vs visual .netEjercicio sql server vs visual .net
Ejercicio sql server vs visual .net
Ayuda Universidad
 
Super heroes training_simulator
Super heroes training_simulatorSuper heroes training_simulator
Super heroes training_simulator
joustin12
 
java code please Add event handlers to the buttons in your TicTacToe.pdf
java code please Add event handlers to the buttons in your TicTacToe.pdfjava code please Add event handlers to the buttons in your TicTacToe.pdf
java code please Add event handlers to the buttons in your TicTacToe.pdf
ezzi97
 
The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.5.3 book - Part 79 of 184The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.5.3 book - Part 79 of 184
Mahmoud Samir Fayed
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
Vj NiroSh
 
Vb file
Vb fileVb file

Similar to Tic tac toe code (20)

Correction s+ rie_vb
Correction s+ rie_vbCorrection s+ rie_vb
Correction s+ rie_vb
 
Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008
 
Practica porfe agustin eliminar y grabar
Practica porfe agustin eliminar y grabarPractica porfe agustin eliminar y grabar
Practica porfe agustin eliminar y grabar
 
Reservasi hotel
Reservasi hotelReservasi hotel
Reservasi hotel
 
Please help with this. program must be written in C# .. All of the g.pdf
Please help with this. program must be written in C# .. All of the g.pdfPlease help with this. program must be written in C# .. All of the g.pdf
Please help with this. program must be written in C# .. All of the g.pdf
 
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITYDOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
 
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88
 
1. Determine the output displayed when the button is clicked.Priva.docx
1. Determine the output displayed when the button is clicked.Priva.docx1. Determine the output displayed when the button is clicked.Priva.docx
1. Determine the output displayed when the button is clicked.Priva.docx
 
1. Determine the output displayed when the button is clicked. Priv.docx
1. Determine the output displayed when the button is clicked. Priv.docx1. Determine the output displayed when the button is clicked. Priv.docx
1. Determine the output displayed when the button is clicked. Priv.docx
 
Inventory management
Inventory managementInventory management
Inventory management
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บท
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บท
 
Form1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdfForm1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdf
 
Hint 1 2D array of type Button, all buttons hidden except for one.pdf
Hint 1 2D array of type Button, all buttons hidden except for one.pdfHint 1 2D array of type Button, all buttons hidden except for one.pdf
Hint 1 2D array of type Button, all buttons hidden except for one.pdf
 
Ejercicio sql server vs visual .net
Ejercicio sql server vs visual .netEjercicio sql server vs visual .net
Ejercicio sql server vs visual .net
 
Super heroes training_simulator
Super heroes training_simulatorSuper heroes training_simulator
Super heroes training_simulator
 
java code please Add event handlers to the buttons in your TicTacToe.pdf
java code please Add event handlers to the buttons in your TicTacToe.pdfjava code please Add event handlers to the buttons in your TicTacToe.pdf
java code please Add event handlers to the buttons in your TicTacToe.pdf
 
The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.5.3 book - Part 79 of 184The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.5.3 book - Part 79 of 184
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
 
Vb file
Vb fileVb file
Vb file
 

Recently uploaded

RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
khuleseema60
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
EduSkills OECD
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
melliereed
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
IsmaelVazquez38
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 

Recently uploaded (20)

RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 

Tic tac toe code

  • 1. Public Class Form1 Dim navegador As String = "x" Dim contadorx As Integer = 0 Dim contadory As Integer = 0 Dim gatitodetector As Integer = 0 Public Function xoy(ByVal nav As String) If nav = "x" Then navegador = "0" Return "x" Else navegador = "x" Return "0" End If End Function Public Sub ganarX() gatitodetector += 1 If Button1.Text = "x" And Button2.Text = "x" And Button3.Text = "x" Then MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ") endofgame() ElseIf Button4.Text = "x" And Button5.Text = "x" And Button6.Text = "x" Then MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ") endofgame() ElseIf Button7.Text = "x" And Button8.Text = "x" And Button9.Text = "x" Then MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ") endofgame() ElseIf Button1.Text = "x" And Button4.Text = "x" And Button7.Text = "x" Then MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ") endofgame() ElseIf Button2.Text = "x" And Button5.Text = "x" And Button8.Text = "x" Then MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ") endofgame() ElseIf Button3.Text = "x" And Button6.Text = "x" And Button9.Text = "x" Then MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ") endofgame() ElseIf Button1.Text = "x" And Button5.Text = "x" And Button9.Text = "x" Then MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ") endofgame() ElseIf Button3.Text = "x" And Button5.Text = "x" And Button7.Text = "x" Then MsgBox("X gana este juego.", MsgBoxStyle.Information, " X Wins. ") endofgame() End If ganar0() End Sub Public Sub ganar0() If Button1.Text = "0" And Button2.Text = "0" And Button3.Text = "0" Then MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ") endofgame2() ElseIf Button4.Text = "0" And Button5.Text = "0" And Button6.Text = "0" Then MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ") endofgame2() ElseIf Button7.Text = "0" And Button8.Text = "0" And Button9.Text = "0" Then MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ") endofgame2() ElseIf Button1.Text = "0" And Button4.Text = "0" And Button7.Text = "0" Then
  • 2. MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ") endofgame2() ElseIf Button2.Text = "0" And Button5.Text = "0" And Button8.Text = "0" Then MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ") endofgame2() ElseIf Button3.Text = "0" And Button6.Text = "0" And Button9.Text = "0" Then MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ") endofgame2() ElseIf Button1.Text = "0" And Button5.Text = "0" And Button9.Text = "0" Then MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ") endofgame2() ElseIf Button3.Text = "0" And Button5.Text = "0" And Button7.Text = "0" Then MsgBox("0 gana este juego.", MsgBoxStyle.Information, " 0 Wins. ") endofgame2() ElseIf gatitodetector = 9 Then MsgBox(" Nadie gana este juego.", MsgBoxStyle.Information, " Nadie gana") gatitodetector = 0 End If End Sub Public Sub endofgame() Button1.Enabled = False Button2.Enabled = False Button3.Enabled = False Button4.Enabled = False Button5.Enabled = False Button6.Enabled = False Button7.Enabled = False Button8.Enabled = False Button9.Enabled = False contadorx += 1 gatitodetector = 0 lblContadorX.Text = contadorx.ToString End Sub Public Sub endofgame2() Button1.Enabled = False Button2.Enabled = False Button3.Enabled = False Button4.Enabled = False Button5.Enabled = False Button6.Enabled = False Button7.Enabled = False Button8.Enabled = False Button9.Enabled = False contadory += 1 gatitodetector = 0 lblContadorY.Text = contadory.ToString End Sub Public Sub resetiar() Button1.Enabled = True Button2.Enabled = True Button3.Enabled = True Button4.Enabled = True Button5.Enabled = True Button6.Enabled = True Button7.Enabled = True Button8.Enabled = True Button9.Enabled = True Button1.Text = "" Button2.Text = ""
  • 3. Button3.Text = "" Button4.Text = "" Button5.Text = "" Button6.Text = "" Button7.Text = "" Button8.Text = "" Button9.Text = "" End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Button1.Text = xoy(navegador) Button1.Enabled = False ganarX() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Button2.Text = xoy(navegador) Button2.Enabled = False ganarX() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Button3.Text = xoy(navegador) Button3.Enabled = False ganarX() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Button4.Text = xoy(navegador) Button4.Enabled = False ganarX() End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Button5.Text = xoy(navegador) Button5.Enabled = False ganarX() End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Button6.Text = xoy(navegador) Button6.Enabled = False ganarX() End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click Button7.Text = xoy(navegador) Button7.Enabled = False ganarX() End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click Button8.Text = xoy(navegador) Button8.Enabled = False ganarX() End Sub
  • 4. Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click Button9.Text = xoy(navegador) Button9.Enabled = False ganarX() End Sub Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click Me.Close() End Sub Private Sub NewGaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewGaToolStripMenuItem.Click resetiar() gatitodetector = 0 End Sub End Class