VB TicTacToe

--Originally published at Quirino´s Projects

I once made a tictactoe game, pretty proud of it.

Lost visual evidence, too lazy to make the buttons again, lucky i had a backup of just the code

giphy1

I dont know how copyright works in code but well, i made the whole thing


Public Class TicTacToe
Dim A As Char
Dim B As Char
Dim c As String
Function xo(Button As Char) As Char
If A = "x" Then
B = "o"

A = "o"
ElseIf A <> "x" Then
B = "x"

A = "x"
End If
Return B
End Function
Function win() As String
If Button1.Text = Button2.Text And Button1.Text = Button3.Text And Button1.Text <> "" Then
c = "Gana " & A
End If
If Button4.Text = Button5.Text And Button5.Text = Button6.Text And Button4.Text <> "" Then
c = "Gana " & A
End If
If Button7.Text = Button8.Text And Button8.Text = Button9.Text And Button7.Text <> "" Then
c = "Gana " & A
End If
If Button1.Text = Button4.Text And Button4.Text = Button7.Text And Button1.Text <> "" Then
c = "Gana " & A
End If
If Button2.Text = Button5.Text And Button5.Text = Button8.Text And Button2.Text <> "" Then
c = "Gana " & A
End If
If Button3.Text = Button6.Text And Button6.Text = Button9.Text And Button3.Text <> "" Then
c = "Gana " & A
End If
If Button1.Text = Button5.Text And Button5.Text = Button9.Text And Button9.Text <> "" Then
c = "Gana " & A
End If
If Button3.Text = Button5.Text And Button5.Text = Button7.Text And Button3.Text <> "" Then
c = "Gana 
Continue reading "VB TicTacToe"