Results 1 to 12 of 12
  1. #1
    aLcohoL_95's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    SatyRicon
    Posts
    685
    Reputation
    8
    Thanks
    291
    My Mood
    Cynical

    [Help] Tic-Tac-Toe

    Hey i found some codes for Tic Tac Toe but i am getting error pls help me:
    code:
    Code:
    Public Class tictactoe
        Inherits System.Windows.Forms.Form
        Dim p As New Integer
        Dim pic As New PictureBox
    #Region " Windows Form Designer generated code "
    
        Public Sub New()
            MyBase.New()
    
            'This call is required by the Windows Form Designer.
            InitializeComponent()
    
            'Add any initialization after the InitializeComponent() call
    
        End Sub
    
        'Form overrides dispose to clean up the component list.
        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If Not (components Is Nothing) Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub
    
        'Required by the Windows Form Designer
        Private components As System.ComponentModel.IContainer
    
        'NOTE: The following procedure is required by the Windows Form Designer
        'It can be modified using the Windows Form Designer.  
        'Do not modify it using the code editor.
        Friend WithEvents tside As System.Windows.Forms.Label
        Friend WithEvents lside As System.Windows.Forms.Label
        Friend WithEvents rside As System.Windows.Forms.Label
        Friend WithEvents Label1 As System.Windows.Forms.Label
        Friend WithEvents Label2 As System.Windows.Forms.Label
        Friend WithEvents Label3 As System.Windows.Forms.Label
        Friend WithEvents Label4 As System.Windows.Forms.Label
        Friend WithEvents Label5 As System.Windows.Forms.Label
        Friend WithEvents x As System.Windows.Forms.PictureBox
        Friend WithEvents o As System.Windows.Forms.PictureBox
        Friend WithEvents Wplayer As System.Windows.Forms.Label
        Friend WithEvents Start As System.Windows.Forms.Button
        Friend WithEvents pic1 As System.Windows.Forms.PictureBox
        Friend WithEvents pic2 As System.Windows.Forms.PictureBox
        Friend WithEvents pic9 As System.Windows.Forms.PictureBox
        Friend WithEvents pic8 As System.Windows.Forms.PictureBox
        Friend WithEvents pic7 As System.Windows.Forms.PictureBox
        Friend WithEvents pic6 As System.Windows.Forms.PictureBox
        Friend WithEvents pic5 As System.Windows.Forms.PictureBox
        Friend WithEvents pic4 As System.Windows.Forms.PictureBox
        Friend WithEvents pic3 As System.Windows.Forms.PictureBox
        Friend WithEvents Closer As System.Windows.Forms.Button
        Friend WithEvents blank As System.Windows.Forms.PictureBox
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
            Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(tictactoe))
            Me.tside = New System.Windows.Forms.Label
            Me.lside = New System.Windows.Forms.Label
            Me.rside = New System.Windows.Forms.Label
            Me.Label1 = New System.Windows.Forms.Label
            Me.Label2 = New System.Windows.Forms.Label
            Me.Label3 = New System.Windows.Forms.Label
            Me.Label4 = New System.Windows.Forms.Label
            Me.Label5 = New System.Windows.Forms.Label
            Me.pic1 = New System.Windows.Forms.PictureBox
            Me.pic2 = New System.Windows.Forms.PictureBox
            Me.pic9 = New System.Windows.Forms.PictureBox
            Me.pic8 = New System.Windows.Forms.PictureBox
            Me.pic7 = New System.Windows.Forms.PictureBox
            Me.pic6 = New System.Windows.Forms.PictureBox
            Me.pic5 = New System.Windows.Forms.PictureBox
            Me.pic4 = New System.Windows.Forms.PictureBox
            Me.pic3 = New System.Windows.Forms.PictureBox
            Me.x = New System.Windows.Forms.PictureBox
            Me.o = New System.Windows.Forms.PictureBox
            Me.Wplayer = New System.Windows.Forms.Label
            Me.Start = New System.Windows.Forms.Button
            Me.Closer = New System.Windows.Forms.Button
            Me.blank = New System.Windows.Forms.PictureBox
            Me.SuspendLayout()
            '
            'tside
            '
            Me.tside.BackColor = System.Drawing.Color.Black
            Me.tside.Location = New System.Drawing.Point(8, 8)
            Me.tside.Name = "tside"
            Me.tside.Size = New System.Drawing.Size(150, 1)
            Me.tside.TabIndex = 0
            '
            'lside
            '
            Me.lside.BackColor = System.Drawing.Color.Black
            Me.lside.Location = New System.Drawing.Point(8, 8)
            Me.lside.Name = "lside"
            Me.lside.Size = New System.Drawing.Size(1, 150)
            Me.lside.TabIndex = 1
            '
            'rside
            '
            Me.rside.BackColor = System.Drawing.Color.Black
            Me.rside.Location = New System.Drawing.Point(157, 8)
            Me.rside.Name = "rside"
            Me.rside.Size = New System.Drawing.Size(1, 150)
            Me.rside.TabIndex = 2
            '
            'Label1
            '
            Me.Label1.BackColor = System.Drawing.Color.Black
            Me.Label1.Location = New System.Drawing.Point(8, 157)
            Me.Label1.Name = "Label1"
            Me.Label1.Size = New System.Drawing.Size(150, 1)
            Me.Label1.TabIndex = 3
            '
            'Label2
            '
            Me.Label2.BackColor = System.Drawing.Color.Black
            Me.Label2.Location = New System.Drawing.Point(57, 8)
            Me.Label2.Name = "Label2"
            Me.Label2.Size = New System.Drawing.Size(1, 150)
            Me.Label2.TabIndex = 4
            '
            'Label3
            '
            Me.Label3.BackColor = System.Drawing.Color.Black
            Me.Label3.Location = New System.Drawing.Point(106, 8)
            Me.Label3.Name = "Label3"
            Me.Label3.Size = New System.Drawing.Size(1, 150)
            Me.Label3.TabIndex = 5
            '
            'Label4
            '
            Me.Label4.BackColor = System.Drawing.Color.Black
            Me.Label4.Location = New System.Drawing.Point(8, 57)
            Me.Label4.Name = "Label4"
            Me.Label4.Size = New System.Drawing.Size(150, 1)
            Me.Label4.TabIndex = 6
            '
            'Label5
            '
            Me.Label5.BackColor = System.Drawing.Color.Black
            Me.Label5.Location = New System.Drawing.Point(8, 106)
            Me.Label5.Name = "Label5"
            Me.Label5.Size = New System.Drawing.Size(150, 1)
            Me.Label5.TabIndex = 7
            '
            'pic1
            '
            Me.pic1.Location = New System.Drawing.Point(16, 16)
            Me.pic1.Name = "pic1"
            Me.pic1.Size = New System.Drawing.Size(32, 32)
            Me.pic1.TabIndex = 8
            Me.pic1.TabStop = False
            '
            'pic2
            '
            Me.pic2.Location = New System.Drawing.Point(64, 16)
            Me.pic2.Name = "pic2"
            Me.pic2.Size = New System.Drawing.Size(32, 32)
            Me.pic2.TabIndex = 9
            Me.pic2.TabStop = False
            '
            'pic9
            '
            Me.pic9.Location = New System.Drawing.Point(112, 112)
            Me.pic9.Name = "pic9"
            Me.pic9.Size = New System.Drawing.Size(32, 32)
            Me.pic9.TabIndex = 10
            Me.pic9.TabStop = False
            '
            'pic8
            '
            Me.pic8.Location = New System.Drawing.Point(64, 112)
            Me.pic8.Name = "pic8"
            Me.pic8.Size = New System.Drawing.Size(32, 32)
            Me.pic8.TabIndex = 11
            Me.pic8.TabStop = False
            '
            'pic7
            '
            Me.pic7.Location = New System.Drawing.Point(16, 112)
            Me.pic7.Name = "pic7"
            Me.pic7.Size = New System.Drawing.Size(32, 32)
            Me.pic7.TabIndex = 12
            Me.pic7.TabStop = False
            '
            'pic6
            '
            Me.pic6.Location = New System.Drawing.Point(112, 64)
            Me.pic6.Name = "pic6"
            Me.pic6.Size = New System.Drawing.Size(32, 32)
            Me.pic6.TabIndex = 13
            Me.pic6.TabStop = False
            '
            'pic5
            '
            Me.pic5.Location = New System.Drawing.Point(64, 64)
            Me.pic5.Name = "pic5"
            Me.pic5.Size = New System.Drawing.Size(32, 32)
            Me.pic5.TabIndex = 14
            Me.pic5.TabStop = False
            '
            'pic4
            '
            Me.pic4.Location = New System.Drawing.Point(16, 64)
            Me.pic4.Name = "pic4"
            Me.pic4.Size = New System.Drawing.Size(32, 32)
            Me.pic4.TabIndex = 15
            Me.pic4.TabStop = False
            '
            'pic3
            '
            Me.pic3.Location = New System.Drawing.Point(112, 16)
            Me.pic3.Name = "pic3"
            Me.pic3.Size = New System.Drawing.Size(32, 32)
            Me.pic3.TabIndex = 16
            Me.pic3.TabStop = False
            '
            'x
            '
            Me.x.Image = CType(resources.GetObject("x.Image"), System.Drawing.Image)
            Me.x.Location = New System.Drawing.Point(16, 168)
            Me.x.Name = "x"
            Me.x.Size = New System.Drawing.Size(8, 16)
            Me.x.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
            Me.x.TabIndex = 17
            Me.x.TabStop = False
            Me.x.Visible = False
            '
            'o
            '
            Me.o.Image = CType(resources.GetObject("o.Image"), System.Drawing.Image)
            Me.o.Location = New System.Drawing.Point(40, 168)
            Me.o.Name = "o"
            Me.o.Size = New System.Drawing.Size(8, 16)
            Me.o.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
            Me.o.TabIndex = 18
            Me.o.TabStop = False
            Me.o.Visible = False
            '
            'Wplayer
            '
            Me.Wplayer.Location = New System.Drawing.Point(192, 16)
            Me.Wplayer.Name = "Wplayer"
            Me.Wplayer.Size = New System.Drawing.Size(88, 16)
            Me.Wplayer.TabIndex = 19
            Me.Wplayer.Text = "Player X"
            '
            'Start
            '
            Me.Start.Location = New System.Drawing.Point(184, 56)
            Me.Start.Name = "Start"
            Me.Start.TabIndex = 20
            Me.Start.Tag = ""
            Me.Start.Text = "New Game"
            '
            'Closer
            '
            Me.Closer.Location = New System.Drawing.Point(184, 104)
            Me.Closer.Name = "Closer"
            Me.Closer.TabIndex = 21
            Me.Closer.Text = "Exit"
            '
            'blank
            '
            Me.blank.Location = New System.Drawing.Point(64, 176)
            Me.blank.Name = "blank"
            Me.blank.Size = New System.Drawing.Size(8, 8)
            Me.blank.TabIndex = 22
            Me.blank.TabStop = False
            '
            'tictactoe
            '
            Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
            Me.BackColor = System.Drawing.Color.Red
            Me.ClientSize = New System.Drawing.Size(292, 166)
            Me.Controls.Add(Me.blank)
            Me.Controls.Add(Me.Closer)
            Me.Controls.Add(Me.Start)
            Me.Controls.Add(Me.Wplayer)
            Me.Controls.Add(Me.o)
            Me.Controls.Add(Me.x)
            Me.Controls.Add(Me.pic3)
            Me.Controls.Add(Me.pic4)
            Me.Controls.Add(Me.pic5)
            Me.Controls.Add(Me.pic6)
            Me.Controls.Add(Me.pic7)
            Me.Controls.Add(Me.pic8)
            Me.Controls.Add(Me.pic9)
            Me.Controls.Add(Me.pic2)
            Me.Controls.Add(Me.pic1)
            Me.Controls.Add(Me.Label5)
            Me.Controls.Add(Me.Label4)
            Me.Controls.Add(Me.Label3)
            Me.Controls.Add(Me.Label2)
            Me.Controls.Add(Me.Label1)
            Me.Controls.Add(Me.rside)
            Me.Controls.Add(Me.lside)
            Me.Controls.Add(Me.tside)
            Me.Name = "tictactoe"
            Me.Text = "Tic-Tac-Toe"
            Me.ResumeLayout(False)
    
        End Sub
    
    #End Region
    
        Private Sub tictactoe_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            p = 1
        End Sub
    
        Private Sub pic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic1.Click, pic2.Click, pic3.Click, pic4.Click, pic5.Click, pic6.Click, pic7.Click, pic8.Click, pic9.Click
            pic = sender
            Select Case p
                Case 1
                    If pic.Image Is blank.Image Then
                        p = 2
                        Wplayer.Text = "Player O"
                        pic.Image = x.Image
                    End If
                Case 2
                    If pic.Image Is blank.Image Then
                        p = 1
                        Wplayer.Text = "Player X"
                        pic.Image = o.Image
                    End If
            End Select
            Call win()
            Call tie()
            Call win3()
        End Sub
    
        Private Sub Closer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Closer.Click
            End
        End Sub
    
        Private Sub Start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Start.Click
            pic1.Image = blank.Image
            pic2.Image = blank.Image
            pic3.Image = blank.Image
            pic4.Image = blank.Image
            pic5.Image = blank.Image
            pic6.Image = blank.Image
            pic7.Image = blank.Image
            pic8.Image = blank.Image
            pic9.Image = blank.Image
            pic1.Enabled = True
            pic2.Enabled = True
            pic3.Enabled = True
            pic4.Enabled = True
            pic5.Enabled = True
            pic6.Enabled = True
            pic7.Enabled = True
            pic8.Enabled = True
            pic9.Enabled = True
            Wplayer.Text = "Player X"
            p = 1
        End Sub
        Public Function win()
            If pic1.Image Is pic2.Image And pic2.Image Is pic3.Image And pic3.Image Is x.Image Then
                Call win2()
            End If
            If pic4.Image Is pic5.Image And pic5.Image Is pic6.Image And pic6.Image Is x.Image Then
                Call win2()
            End If
            If pic7.Image Is pic8.Image And pic8.Image Is pic9.Image And pic9.Image Is x.Image Then
                Call win2()
            End If
            If pic1.Image Is pic4.Image And pic4.Image Is pic7.Image And pic7.Image Is x.Image Then
                Call win2()
            End If
            If pic2.Image Is pic5.Image And pic5.Image Is pic8.Image And pic8.Image Is x.Image Then
                Call win2()
            End If
            If pic3.Image Is pic6.Image And pic6.Image Is pic9.Image And pic9.Image Is x.Image Then
                Call win2()
            End If
            If pic3.Image Is pic5.Image And pic5.Image Is pic7.Image And pic7.Image Is x.Image Then
                Call win2()
            End If
            If pic1.Image Is pic5.Image And pic5.Image Is pic9.Image And pic9.Image Is x.Image Then
                Call win2()
            End If
        End Function
        Public Function win2()
            pic1.Enabled = False
            pic2.Enabled = False
            pic3.Enabled = False
            pic4.Enabled = False
            pic5.Enabled = False
            pic6.Enabled = False
            pic7.Enabled = False
            pic8.Enabled = False
            pic9.Enabled = False
            If p = 1 Then
                Wplayer.Text = "Player O WINS!"
            Else
                Wplayer.Text = "Player X WINS!"
            End If
        End Function
        Public Function tie()
            If pic1.Image Is blank.Image Then
            ElseIf pic2.Image Is blank.Image Then
            ElseIf pic3.Image Is blank.Image Then
            ElseIf pic4.Image Is blank.Image Then
            ElseIf pic5.Image Is blank.Image Then
            ElseIf pic6.Image Is blank.Image Then
            ElseIf pic7.Image Is blank.Image Then
            ElseIf pic8.Image Is blank.Image Then
            ElseIf pic9.Image Is blank.Image Then
            Else
                pic1.Enabled = False
                pic2.Enabled = False
                pic3.Enabled = False
                pic4.Enabled = False
                pic5.Enabled = False
                pic6.Enabled = False
                pic7.Enabled = False
                pic8.Enabled = False
                pic9.Enabled = False
                Wplayer.Text = "TIE!"
            End If
        End Function
        Public Function win3()
            If pic1.Image Is pic2.Image And pic2.Image Is pic3.Image And pic3.Image Is o.Image Then
                Call win2()
            End If
            If pic4.Image Is pic5.Image And pic5.Image Is pic6.Image And pic6.Image Is o.Image Then
                Call win2()
            End If
            If pic7.Image Is pic8.Image And pic8.Image Is pic9.Image And pic9.Image Is o.Image Then
                Call win2()
            End If
            If pic1.Image Is pic4.Image And pic4.Image Is pic7.Image And pic7.Image Is o.Image Then
                Call win2()
            End If
            If pic2.Image Is pic5.Image And pic5.Image Is pic8.Image And pic8.Image Is o.Image Then
                Call win2()
            End If
            If pic3.Image Is pic6.Image And pic6.Image Is pic9.Image And pic9.Image Is o.Image Then
                Call win2()
            End If
            If pic3.Image Is pic5.Image And pic5.Image Is pic7.Image And pic7.Image Is o.Image Then
                Call win2()
            End If
            If pic1.Image Is pic5.Image And pic5.Image Is pic9.Image And pic9.Image Is o.Image Then
                Call win2()
            End If
        End Function
    End Class
    Last edited by aLcohoL_95; 04-07-2010 at 11:04 AM.

    CANNIBAL CORPSE P0WNS


  2. #2
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    copy & paste doesn't work...........



  3. #3
    aLcohoL_95's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    SatyRicon
    Posts
    685
    Reputation
    8
    Thanks
    291
    My Mood
    Cynical

    here is a SS what must i do

    CANNIBAL CORPSE P0WNS


  4. #4
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    All your errors are duplicate code related, go into you code and rmeove and duplicate declarations and subs


     


     


     



    The Most complete application MPGH will ever offer - 68%




  5. #5
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,086
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    thats what happens when you just copy and paste.
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  6. #6
    MvRouC12's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Stalking Choobs
    Posts
    1,690
    Reputation
    13
    Thanks
    246
    My Mood
    Amused
    yea. exactly what nextgen1 said. lol ^_^

    i had the same problem with the same exact program...

    Let me guess... the tic-tac-toe program is off of youtube? lol

    [IMG]https://i986.photobucke*****m/albums/ae345/TripleSixPf/Okami-MvRouC12.jpg[/IMG]
    Quote Originally Posted by m_t_h View Post


    By stop playing AVA untill brasilian server comes.

    Do you guys really need to ruin EVERY game?
    [IMG]https://i175.photobucke*****m/albums/w148/Guitarman1157/dontforget.gif[/IMG]

  7. #7
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,086
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    those youtube vids usually dont work
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  8. #8
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,970
    My Mood
    Happy
    Quote Originally Posted by zmansquared View Post
    those youtube vids usually dont work
    If you follow every step from the video and write everything from your hand it works other if you C&P it doesnt work(most of the times)
    -Rest in peace leechers-

    Your PM box is 100% full.

  9. #9
    tstom's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Posts
    348
    Reputation
    10
    Thanks
    16
    My Mood
    Yeehaw
    I dont copy and paste, i write the code to actually learn fromthe tutorial XD
    .:Latest:.

  10. #10
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,086
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    ya i guess your right hejsan. i meant just lick ctrl c then crtl v from the code on the side
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  11. #11
    tempta43's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    980
    Reputation
    23
    Thanks
    295
    My Mood
    Bored
    Follow tutorials correctly, and fix up your GUI, colored buttons really plague me. :/

  12. #12
    MvRouC12's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Stalking Choobs
    Posts
    1,690
    Reputation
    13
    Thanks
    246
    My Mood
    Amused
    Quote Originally Posted by tempta43 View Post
    Follow tutorials correctly, and fix up your GUI, colored buttons really plague me. :/
    Seriously...

    So does red. lol

    [IMG]https://i986.photobucke*****m/albums/ae345/TripleSixPf/Okami-MvRouC12.jpg[/IMG]
    Quote Originally Posted by m_t_h View Post


    By stop playing AVA untill brasilian server comes.

    Do you guys really need to ruin EVERY game?
    [IMG]https://i175.photobucke*****m/albums/w148/Guitarman1157/dontforget.gif[/IMG]

Similar Threads

  1. [Tutorial]Tic Tac Toe Game[Leeched]
    By jimmy541 in forum Visual Basic Programming
    Replies: 7
    Last Post: 04-20-2010, 03:43 PM
  2. Basic C++ Tic Tac Toe
    By Shark23 in forum C++/C Programming
    Replies: 7
    Last Post: 04-17-2010, 08:05 AM
  3. BLack Horseman Tic Tac Toe Game
    By aLcohoL_95 in forum General
    Replies: 15
    Last Post: 04-14-2010, 01:43 PM
  4. Just owned some Tic Tac Toe :)
    By skip in forum C++/C Programming
    Replies: 1
    Last Post: 08-30-2008, 05:03 AM
  5. ARUN BEAT ME ON TIC TAC TOE
    By CAPTAIN OBVIOUS in forum Flaming & Rage
    Replies: 22
    Last Post: 04-30-2008, 05:33 PM