Thread: tictactoe program

  1. #1
    Registered User
    Join Date
    Feb 2006
    Location
    Philadelphia, PA
    Posts
    27

    tictactoe program

    Hello,

    I wrote this tictactoe game for my class. This is not really a game, but it acts like one.It compiles and works, but I can't figure out how to find if both X and O won at the same time..

    Here's the code, maybe you can help me out.

    CODE REMOVED
    Last edited by ademkiv; 03-16-2006 at 08:36 PM.

  2. #2
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    It doesn't compile for me (Microsoft 2003)

    The problem is this: '$'
    I really can't figure out why you use it

  3. #3
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    869
    By changing the "else if" into just "if", perhaps? Then it will check both conditions.

    By the way, you really should consider using loops instead of that crazy long expression.

  4. #4
    Registered User
    Join Date
    Feb 2006
    Location
    Philadelphia, PA
    Posts
    27
    i am remotely connected to the server at my university, I think they use Fedora Core. It compiles for me. Strange.

    I just checked again, there is no such symbol in my code, strange.

    cwr,
    I'm not that good with loops, that's why i didn't use them.

    I just tried your suggestion, and it works. Thanks!!!
    Last edited by ademkiv; 03-16-2006 at 08:23 PM.

  5. #5
    Registered User
    Join Date
    Feb 2006
    Location
    Philadelphia, PA
    Posts
    27
    I got it all figured out. Thanks guys. I appreciate all the help.

    I removed the code because I know that other people from my class are going to find it and might copy it. I don't want to get kicked out of school for some stupid piece of code. I hope you understand.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  2. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  3. ticTacToe program, logic help!
    By gomantis in forum C Programming
    Replies: 1
    Last Post: 10-14-2007, 08:52 PM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM