VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A Tic Tac Game

by Distubezz (1 Submission)
Category: Games
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 6th March 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

A Tic Tac Game

API Declarations


Public intCounter As Integer
Public intButton
Public Caption
Public intCat As Integer


Function Remove(Tic)


If intCounter = 1 Then
frmTic(intButton).Caption = "X"
intCounter = 0
frmTic(intButton).Enabled = False
intCat = intCat + 1
GoTo ERC
End If

If intCounter = 0 Then
frmTic(intButton).Caption = "O"
intCounter = 1
frmTic(intButton).Enabled = False
intCat = intCat + 1
GoTo ERC

End If

ERC:

If frmTic.cmdTac1.Caption = "X" And frmTic.cmdTac2.Caption = "X" And frmTic.cmdTac3.Caption = "X" Or frmTic.cmdTac1.Caption = "X" And frmTic.cmdTac4.Caption = "X" And frmTic.cmdTac7.Caption = "X" Or frmTic.cmdTac1.Caption = "X" And frmTic.cmdTac5.Caption = "X" And frmTic.cmdTac9.Caption = "X" Then
MsgBox ("Congratulations X you won")
End If

If frmTic.cmdTac4.Caption = "X" And frmTic.cmdTac5.Caption = "X" And frmTic.cmdTac6.Caption = "X" Then
MsgBox ("Congratulations X you won")
End If

If frmTic.cmdTac7.Caption = "X" And frmTic.cmdTac8.Caption = "X" And frmTic.cmdTac9.Caption = "X" Or frmTic.cmdTac2.Caption = "X" And frmTic.cmdTac5.Caption = "X" And frmTic.cmdTac8.Caption = "X" Or frmTic.cmdTac3.Caption = "X" And frmTic.cmdTac6.Caption = "X" And frmTic.cmdTac9.Caption = "X" Then
MsgBox ("Congratulations X you won")
End If

If frmTic.cmdTac1.Caption = "O" And frmTic.cmdTac2.Caption = "O" And frmTic.cmdTac3.Caption = "O" Or frmTic.cmdTac1.Caption = "O" And frmTic.cmdTac4.Caption = "O" And frmTic.cmdTac7.Caption = "O" Or frmTic.cmdTac1.Caption = "O" And frmTic.cmdTac5.Caption = "O" And frmTic.cmdTac9.Caption = "O" Then
MsgBox ("Congratulations O you won")
End If

If frmTic.cmdTac4.Caption = "O" And frmTic.cmdTac5.Caption = "O" And frmTic.cmdTac6.Caption = "O" Then
MsgBox ("Congratulations O you won")
End If

If frmTic.cmdTac7.Caption = "O" And frmTic.cmdTac8.Caption = "O" And frmTic.cmdTac9.Caption = "O" Or frmTic.cmdTac2.Caption = "O" And frmTic.cmdTac5.Caption = "O" And frmTic.cmdTac8.Caption = "O" Or frmTic.cmdTac3.Caption = "O" And frmTic.cmdTac6.Caption = "O" And frmTic.cmdTac9.Caption = "O" Then
MsgBox ("Congratulations O you won")
End If
End Function


Rate A Tic Tac Game



End
End Sub

Private Sub cmdTac1_Click()
intButton = "cmdTac1"
Remove (Tic)
End Sub

Private Sub cmdTac2_Click()
intButton = "cmdTac2"
Remove (Tic)
End Sub

Private Sub cmdTac3_Click()
intButton = "cmdTac3"
Remove (Tic)
End Sub

Private Sub cmdTac4_Click()
intButton = "cmdTac4"
Remove (Tic)
End Sub

Private Sub cmdTac5_Click()
intButton = "cmdTac5"
Remove (Tic)
End Sub

Private Sub cmdTac6_Click()
intButton = "cmdTac6"
Remove (Tic)
End Sub

Private Sub cmdTac7_Click()
intButton = "cmdTac7"
Remove (Tic)
End Sub

Private Sub cmdTac8_Click()
intButton = "cmdTac8"
Remove (Tic)
End Sub

Private Sub cmdTac9_Click()
intButton = "cmdTac9"
Remove (Tic)
End Sub

Private Sub Form_Load()
MsgBox ("X will go fist")
intCounter = 1
End Sub

Download this snippet    Add to My Saved Code

A Tic Tac Game Comments

No comments have been posted about A Tic Tac Game. Why not be the first to post a comment about A Tic Tac Game.

Post your comment

Subject:
Message:
0/1000 characters