Tic Tac DOH!

This is a discussion on Tic Tac DOH! within the C++ Programming forums, part of the General Programming Boards category; Well, I didn't wanna do it. But I had to pay my dues. I've done more advanced things than Tic ...

  1. #1
    Registered User Invincible's Avatar
    Join Date
    Feb 2002
    Posts
    210

    Tic Tac DOH!

    Well, I didn't wanna do it. But I had to pay my dues. I've done more advanced things than Tic Tac Toe in a console window, but I decided that if everyone else was going to do it then so was I.

    So here it is, my version of Tic Tac Toe, Tic Tac DOH!

    Any comments on code or design, especially in the area of sizing the console, are much appreciated.

    OS: Windows (so far tested in 95/XP)

    Compiler: VC++ 6.0

    Enjoy
    Attached Files Attached Files
    "The mind, like a parachute, only functions when open."

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    some comments:
    the green text never ends, and it begins awkwardly
    text interferes with the last row of the tic tac toe board
    compiles fine with borland, probably with djgpp too
    ai seems smart enough

    basically, all problems here are cosmetic. good job

  3. #3
    Registered User Invincible's Avatar
    Join Date
    Feb 2002
    Posts
    210
    Thanks for the compliment on the AI. There is only one way to beat it that I know of. Did you you find more?

    Not sure what you mean by "the green text never ends, and it begins akwardly." (I purposely set the text to green)

    Did you happen to lose? Did you get a DOH!?

    I do know what you mean by the text running into the bottom of the board though. I could drop it down a line or two, but I don't think that would solve the problem. I was sure that the output formatting would behave unpredictably. That's why I wanted specific input on console sizing. I can't seem to find a method that will produce constant results, but I may just be trying to push the limits of the console.

    If you wouldn't mind, I'd like to know what OS you're using. I'd also like to know what font settings you're using in the console (i.e. Raster or TrueType and at what size), and the width and height of your window and screen buffer as displayed in properties.

    If anyone has any tips, tricks or formulas for formatting a console window that looks good across all the Windows OS's I would pay good money for the information as it seems to be obscure (just kidding, but I would thank you heartily).

    I know programming a GUI in a console window probably isn't worth the effort and frustration, but I'm cursed with perfectionism and I can't leave the console window alone.
    "The mind, like a parachute, only functions when open."

  4. #4
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408
    Thats the coolest Tic-Tac-Toe game i have seen so far!
    Great work!
    Oh and i really like the Doh thing you made instead of Game Over =D (I had plenty of opportunities too watch)

    EDIT:: Noticed you have a ~ sign before Win:
    should that be there? ::EDIT

  5. #5
    I'm Back
    Join Date
    Dec 2001
    Posts
    556

    Thumbs up

    Cool game, you are, i think only the 2nd guy to use arrow keys. to move around. good ai stuff too

    Dont understand by what you mean by "only 1 way to beat the AI". i played 4 games beat it twice and drew twice.

  6. #6
    Seņor Member
    Join Date
    Jan 2002
    Posts
    561
    I really like it, but all those sleep statements are getting on my nerves.

  7. #7
    Registered User Invincible's Avatar
    Join Date
    Feb 2002
    Posts
    210
    Thanks Erion, that means a lot coming from someone who's not afraid to post code.
    Dont understand by what you mean by "only 1 way to beat the AI". i played 4 games beat it twice and drew twice.
    Well, you may be smarter about logic than I, but I could only beat the game using one "pattern' if I got to go first. And I could draw if the computer got to go first. That's all I meant.
    all those sleep statements are getting on my nerves.
    I would have thought by looking at your icon that you like to sleep Tim But seriously, you know of a better way? Or you just got annoyed waiting?
    Last edited by Invincible; 04-24-2002 at 06:58 AM.
    "The mind, like a parachute, only functions when open."

  8. #8
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    >>Well, you may be smarter about logic than I,

    LOL, i havent used ai in any of my games so far...

  9. #9
    Seņor Member
    Join Date
    Jan 2002
    Posts
    561
    Ya I get bored easily, and all that waiting was ........ing me off, but other than that it was great.

  10. #10
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    Yeah, I'd have to agree, your version of tic-tac-toe kicks ass!

  11. #11
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    Very nice for a console TTT.

    U.
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

  12. #12
    Registered User Invincible's Avatar
    Join Date
    Feb 2002
    Posts
    210
    Thanks for all the kind replies, it's just Tic-Tac-Doh jeeze I was a little dissappointed I didn't get more comments on the actual code though. Was it that bad? I didn't even use a 2D array lol.
    "The mind, like a parachute, only functions when open."

  13. #13
    Registered User
    Join Date
    Feb 2002
    Posts
    591
    Nice game. The best console tic tac toe I have seen. In your code your functions are pretty big. I do the same thing in my progs but technicaly they should be shorter.

  14. #14
    Registered User Invincible's Avatar
    Join Date
    Feb 2002
    Posts
    210
    Thank you for the compiliment Barjor. Would it be better to have one short function and more function calls?
    "The mind, like a parachute, only functions when open."

  15. #15
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Would it be better to have one short function and more function calls?
    A good rule of thumb for the length of functions is when they get to be larger than half a screen (or a full screen), break them up into two or more specialized functions.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help me with my simple Tic tac toe prog
    By maybnxtseasn in forum C Programming
    Replies: 2
    Last Post: 04-04-2009, 06:25 PM
  2. tic tac toe
    By holden in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 05-09-2004, 09:59 AM
  3. Help with Tic Tac Toe game
    By snef73 in forum C++ Programming
    Replies: 1
    Last Post: 04-25-2003, 08:33 AM
  4. Need some help with a basic tic tac toe game
    By darkshadow in forum C Programming
    Replies: 1
    Last Post: 05-12-2002, 04:21 PM
  5. Tic Tac Toe Help
    By aresashura in forum C++ Programming
    Replies: 1
    Last Post: 11-21-2001, 11:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21