home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Begin VB.Form frmSMFTicTacToe BorderStyle = 1 'Fixed Single Caption = "Smoke Tic-Tac-Toe" ClientHeight = 4455 ClientLeft = 2730 ClientTop = 2040 ClientWidth = 6675 Icon = "FrmSMFTicTacToe.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False MousePointer = 15 'Size All ScaleHeight = 4455 ScaleWidth = 6675 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton Command1 Caption = "E&xit" Height = 375 Left = 2760 TabIndex = 2 Top = 3840 Width = 855 End Begin VB.CommandButton cmdPlayAgain Caption = "&Play Again" Height = 375 Left = 840 TabIndex = 0 Top = 3840 Width = 1575 End Begin VB.Timer Timer1 Interval = 1 Left = 120 Top = 3120 End Begin VB.Label box9 Alignment = 2 'Center BeginProperty Font Name = "Arial" Size = 35.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 975 Left = 3120 TabIndex = 15 Top = 2640 Width = 1215 End Begin VB.Label box8 Alignment = 2 'Center BeginProperty Font Name = "Arial" Size = 35.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 975 Left = 1680 TabIndex = 14 Top = 2640 Width = 1215 End Begin VB.Label box7 Alignment = 2 'Center BeginProperty Font Name = "Arial" Size = 35.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 975 Left = 240 TabIndex = 13 Top = 2640 Width = 1215 End Begin VB.Label box6 Alignment = 2 'Center BeginProperty Font Name = "Arial" Size = 35.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 975 Left = 3120 TabIndex = 12 Top = 1440 Width = 1215 End Begin VB.Label box4 Alignment = 2 'Center BeginProperty Font Name = "Arial" Size = 35.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 975 Left = 240 TabIndex = 10 Top = 1440 Width = 1215 End Begin VB.Label box3 Alignment = 2 'Center BeginProperty Font Name = "Arial" Size = 35.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 975 Left = 3120 TabIndex = 9 Top = 240 Width = 1215 End Begin VB.Label box2 Alignment = 2 'Center BeginProperty Font Name = "Arial" Size = 35.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 975 Left = 1680 TabIndex = 8 Top = 240 Width = 1215 End Begin VB.Label box1 Alignment = 2 'Center BeginProperty Font Name = "Arial" Size = 35.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 975 Left = 240 TabIndex = 7 Top = 240 Width = 1215 End Begin VB.Label lblPlayer2points Alignment = 2 'Center BeginProperty Font Name = "Arial" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 615 Left = 5040 TabIndex = 6 Top = 2880 Width = 735 End Begin VB.Label lblPlayer1points Alignment = 2 'Center BeginProperty Font Name = "Arial" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 615 Left = 5040 TabIndex = 5 Top = 1440 Width = 735 End Begin VB.Label Label3 Caption = "Player 2" BeginProperty Font Name = "Arial" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 615 Left = 4560 TabIndex = 4 Top = 2160 Width = 1815 End Begin VB.Label Label2 Caption = "Player 1" BeginProperty Font Name = "Arial" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 495 Left = 4560 TabIndex = 3 Top = 720 Width = 1815 End Begin VB.Label Label1 Caption = "TIE" BeginProperty Font Name = "Arial" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00000000& Height = 495 Left = 1920 TabIndex = 1 Top = 1680 Visible = 0 'False Width = 855 End Begin VB.Line Line4 BorderColor = &H00000000& BorderWidth = 5 X1 = 120 X2 = 4320 Y1 = 2520 Y2 = 2520 End Begin VB.Line Line3 BorderColor = &H00000000& BorderWidth = 5 X1 = 120 X2 = 4320 Y1 = 1320 Y2 = 1320 End Begin VB.Line Line2 BorderColor = &H00000000& BorderWidth = 5 X1 = 3000 X2 = 3000 Y1 = 240 Y2 = 3600 End Begin VB.Line Line1 BorderColor = &H00000000& BorderWidth = 5 X1 = 1560 X2 = 1560 Y1 = 240 Y2 = 3600 End Begin VB.Label box5 Alignment = 2 'Center BeginProperty Font Name = "Arial" Size = 35.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 975 Left = 1680 TabIndex = 11 Top = 1440 Width = 1215 End Attribute VB_Name = "frmSMFTicTacToe" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim player1points As Integer Dim player2points As Integer Private Sub box1_Click() If box1.Caption = "" And MousePointer = 15 Then box1.Caption = "X" MousePointer = 12 End If If box1.Caption = "" And MousePointer = 12 Then box1.Caption = "O" MousePointer = 15 End If End Sub Private Sub Box2_Click() If box2.Caption = "" And MousePointer = 15 Then box2.Caption = "X" MousePointer = 12 End If If box2.Caption = "" And MousePointer = 12 Then box2.Caption = "O" MousePointer = 15 End If End Sub Private Sub Box3_Click() If box3.Caption = "" And MousePointer = 15 Then box3.Caption = "X" MousePointer = 12 End If If box3.Caption = "" And MousePointer = 12 Then box3.Caption = "O" MousePointer = 15 End If End Sub Private Sub box4_Click() If box4.Caption = "" And MousePointer = 15 Then box4.Caption = "X" MousePointer = 12 End If If box4.Caption = "" And MousePointer = 12 Then box4.Caption = "O" MousePointer = 15 End If End Sub Private Sub Box5_Click() If box5.Caption = "" And MousePointer = 15 Then box5.Caption = "X" MousePointer = 12 End If If box5.Caption = "" And MousePointer = 12 Then box5.Caption = "O" MousePointer = 15 End If End Sub Private Sub box6_Click() If box6.Caption = "" And MousePointer = 15 Then box6.Caption = "X" MousePointer = 12 End If If box6.Caption = "" And MousePointer = 12 Then box6.Caption = "O" MousePointer = 15 End If End Sub Private Sub Box7_Click() If box7.Caption = "" And MousePointer = 15 Then box7.Caption = "X" MousePointer = 12 End If If box7.Caption = "" And MousePointer = 12 Then box7.Caption = "O" MousePointer = 15 End If End Sub Private Sub Box8_Click() If box8.Caption = "" And MousePointer = 15 Then box8.Caption = "X" MousePointer = 12 End If If box8.Caption = "" And MousePointer = 12 Then box8.Caption = "O" MousePointer = 15 End If End Sub Private Sub Box9_Click() If box9.Caption = "" And MousePointer = 15 Then box9.Caption = "X" MousePointer = 12 End If If box9.Caption = "" And MousePointer = 12 Then box9.Caption = "O" MousePointer = 15 End If End Sub Private Sub Command1_Click() End Sub Private Sub cmdPlayAgain_Click() Timer1.Interval = 1 box1.Visible = True box2.Visible = True box3.Visible = True box4.Visible = True box5.Visible = True box6.Visible = True box7.Visible = True box8.Visible = True box9.Visible = True Line1.Visible = True Line2.Visible = True Line3.Visible = True Line4.Visible = True Label1.Visible = False box1.Caption = "" box2.Caption = "" box3.Caption = "" box4.Caption = "" box5.Caption = "" box6.Caption = "" box7.Caption = "" box8.Caption = "" box9.Caption = "" End Sub Private Sub Label4_Click() End Sub Private Sub Timer1_Timer() If box1.Caption = "X" Then box1.ForeColor = &HFF& If box2.Caption = "X" Then box2.ForeColor = &HFF& If box3.Caption = "X" Then box3.ForeColor = &HFF& If box4.Caption = "X" Then box4.ForeColor = &HFF& If box5.Caption = "X" Then box5.ForeColor = &HFF& If box6.Caption = "X" Then box6.ForeColor = &HFF& If box7.Caption = "X" Then box7.ForeColor = &HFF& If box8.Caption = "X" Then box8.ForeColor = &HFF& If box9.Caption = "X" Then box9.ForeColor = &HFF& If box1.Caption = "O" Then box1.ForeColor = &HFF0000 If box2.Caption = "O" Then box2.ForeColor = &HFF0000 If box3.Caption = "O" Then box3.ForeColor = &HFF0000 If box4.Caption = "O" Then box4.ForeColor = &HFF0000 If box5.Caption = "O" Then box5.ForeColor = &HFF0000 If box6.Caption = "O" Then box6.ForeColor = &HFF0000 If box7.Caption = "O" Then box7.ForeColor = &HFF0000 If box8.Caption = "O" Then box8.ForeColor = &HFF0000 If box9.Caption = "O" Then box9.ForeColor = &HFF0000 '***************************** X's *********************************** If box1.Caption = "X" And box2.Caption = "X" And box3.Caption = "X" Then box4.Visible = False: box5.Visible = False: box6.Visible = False: box7.Visible = False: box8.Visible = False: box9.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box4.Caption = "X" And box5.Caption = "X" And box6.Caption = "X" Then box1.Visible = False: box2.Visible = False: box3.Visible = False: box7.Visible = False: box8.Visible = False: box9.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box7.Caption = "X" And box8.Caption = "X" And box9.Caption = "X" Then box1.Visible = False: box2.Visible = False: box3.Visible = False: box4.Visible = False: box5.Visible = False: box6.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box1.Caption = "X" And box5.Caption = "X" And box9.Caption = "X" Then box2.Visible = False: box3.Visible = False: box4.Visible = False: box6.Visible = False: box7.Visible = False: box8.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box3.Caption = "X" And box5.Caption = "X" And box7.Caption = "X" Then box1.Visible = False: box4.Visible = False: box8.Visible = False: box9.Visible = False: box2.Visible = False: box6.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box1.Caption = "X" And box4.Caption = "X" And box7.Caption = "X" Then box2.Visible = False: box3.Visible = False: box5.Visible = False: box6.Visible = False: box8.Visible = False: box9.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box2.Caption = "X" And box5.Caption = "X" And box8.Caption = "X" Then box1.Visible = False: box3.Visible = False: box4.Visible = False: box6.Visible = False: box7.Visible = False: box9.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box3.Caption = "X" And box6.Caption = "X" And box9.Caption = "X" Then box1.Visible = False: box4.Visible = False: box7.Visible = False: box2.Visible = False: box5.Visible = False: box8.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box1.Caption = "X" And box3.Caption = "X" And box7.Caption = "X" And box9.Caption = "X" Then box2.Visible = False: box4.Visible = False: box5.Visible = False: box6.Visible = False: box8.Visible = False player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If '***************************** O's *********************************** If box1.Caption = "O" And box2.Caption = "O" And box3.Caption = "O" Then box4.Visible = False: box5.Visible = False: box6.Visible = False: box7.Visible = False: box8.Visible = False: box9.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box4.Caption = "O" And box5.Caption = "O" And box6.Caption = "O" Then box1.Visible = False: box2.Visible = False: box3.Visible = False: box7.Visible = False: box8.Visible = False: box9.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box7.Caption = "O" And box8.Caption = "O" And box9.Caption = "O" Then box1.Visible = False: box2.Visible = False: box3.Visible = False: box4.Visible = False: box5.Visible = False: box6.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box1.Caption = "O" And box5.Caption = "O" And box9.Caption = "O" Then box2.Visible = False: box3.Visible = False: box4.Visible = False: box6.Visible = False: box7.Visible = False: box8.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box3.Caption = "O" And box5.Caption = "O" And box7.Caption = "O" Then box1.Visible = False: box4.Visible = False: box8.Visible = False: box9.Visible = False: box2.Visible = False: box6.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box1.Caption = "O" And box4.Caption = "O" And box7.Caption = "O" Then box2.Visible = False: box3.Visible = False: box5.Visible = False: box6.Visible = False: box8.Visible = False: box9.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box2.Caption = "O" And box5.Caption = "O" And box8.Caption = "O" Then box1.Visible = False: box3.Visible = False: box4.Visible = False: box6.Visible = False: box7.Visible = False: box9.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box3.Caption = "O" And box6.Caption = "O" And box9.Caption = "O" Then box1.Visible = False: box4.Visible = False: box7.Visible = False: box2.Visible = False: box5.Visible = False: box8.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box1.Caption = "O" And box3.Caption = "O" And box7.Caption = "O" And box9.Caption = "O" Then box2.Visible = False: box4.Visible = False: box5.Visible = False: box6.Visible = False: box8.Visible = False player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box1.Caption <> "" And box2.Caption <> "" And box3.Caption <> "" And box4.Caption <> "" And box5.Caption <> "" And box6.Caption <> "" And box7.Caption <> "" And box8.Caption <> "" And box9.Caption <> "" Then box1.Visible = False box2.Visible = False box3.Visible = False box4.Visible = False box5.Visible = False box6.Visible = False box7.Visible = False box8.Visible = False box9.Visible = False Line1.Visible = False Line2.Visible = False Line3.Visible = False Line4.Visible = False Label1.Visible = True End If End Sub