Tic tac Toe

Discussion in 'C' started by inspiration, Apr 3, 2010.

  1. inspiration

    inspiration New Member

    Joined:
    Feb 15, 2010
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    0
    I'm writing a tic tac toe program (as I'm sure most of you already have done) and I'm having a great deal of difficulty figuring out how to make this thing work. In fact, my code is nowhere near done because I'm downright lost. Can anyone help? Thanks in advance...
     
  2. pankaj.sea

    pankaj.sea New Member

    Joined:
    Apr 6, 2009
    Messages:
    461
    Likes Received:
    13
    Trophy Points:
    0
    Occupation:
    Web Developer
    Location:
    Kolkata
    Home Page:
    http://ipankaj.net
    well your right, most of us have done one, but, whats confusin you, algorithims, or just the code in general, you have a sample or something that we can look at and see whats wrong?
     
  3. inspiration

    inspiration New Member

    Joined:
    Feb 15, 2010
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    0
    I'm not even sure where to begin. I've written code for my array but I have no idea how to tell the computer how a player should win nor how to define an area of the board. Any ideas? Should I e-mail my code?
     
  4. pankaj.sea

    pankaj.sea New Member

    Joined:
    Apr 6, 2009
    Messages:
    461
    Likes Received:
    13
    Trophy Points:
    0
    Occupation:
    Web Developer
    Location:
    Kolkata
    Home Page:
    http://ipankaj.net
    no, you can post it on the board, more people can help that way, the way i did it was with a mutlidimensional array, first going across, then down in rows

    ie:
    [1][1]-[1][2]-[1][3]
    -------------------
    [2][1]-[2][2]-[2][3]
    -------------------
    [3][1]-[3][2]-[3][3]

    thats sorta how i did it, others would just go down the list, 1,2,3,4,5,6,7,8,9.
     
  5. meyup

    meyup New Member

    Joined:
    Feb 15, 2010
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    0
    here is my Tic - Tac - Toe program (undefeated, by the way), you can work off of it if you like
    download the attachment
     
  6. inspiration

    inspiration New Member

    Joined:
    Feb 15, 2010
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    0
    You guys are the coolest. I have about another week to finish this up so you just may here from me again. Thanks for all your help.

    P.S. Nova Dragoon - obviously my program will look nothing like your masterpiece when I'm done. I will use it as a reference, however. It's always easier to see how someone did it correctly. Thanks so much.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice