Please look at my tic tac toe game

This is a discussion on Please look at my tic tac toe game within the Game Programming forums, part of the General Programming Boards category; I know you guys saw my old tic tac toe, here is the new one. Please comment on my code. ...

  1. #1
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    Please look at my tic tac toe game

    I know you guys saw my old tic tac toe, here is the new one. Please comment on my code. Here is a text file with the source code, i use msvc++ 6.
    Attached Files Attached Files

  2. #2
    Unregistered
    Guest
    Hi,
    I looked at your first attempt. It's good to see that you changed the input to 1-9 instead of two coordinates. I feel that is much better). I also noticed on the original that the players name did not print out properly but does now - I could not see why it did not print before (I am new to C).

    The only comment I would have is that playing the latest version does not display very well, I find the numbers on the display (which are helping to tell you which key to press) do not look as good as the "-" before. A way around this might be to print the grid with the numbers at the top of each game rather than on the "real" board.
    Just small comments - otherwise great.
    Well Done!!

  3. #3
    Registered User Kuplex's Avatar
    Join Date
    Dec 2001
    Posts
    18

    Talking nice program

    Nice game. I see that yo uchanged a few things from the first one. When you get better or just feel like it, try using ASCII characters to create a more authentic board, then as your skills develop even more, you could really turn it into a high quality game. Anyway though! Good job!

    PS- i got beat alot by the 'insane' AI
    Kuplex
    "The only thing you can count on is uncertainty."

    Must I explain myself futher?

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    22
    Only one big problem...

    Global Variables... ack...

    Why not use global variables? Simple. Global variables remain on the stack for the entire duration of the program. Incredibly inefficient.

    Other than that, the codes great!

    -Vulcan

  5. #5
    Registered User cody's Avatar
    Join Date
    Sep 2001
    Posts
    86
    Well...it seems to work but:

    - its no c++ its c. If you'd use a class you'd also get rid of this
    crappy global vars...

    - the code can be improved at _several_ points (if conditions, switch *brr*)

    - the system() commands aren't very nice in my oppinion

    - try makin' the code full ANSI, always better

    - the computermove() functions is hardcoded. That suxx Try using an array of single bits indicating ur own markers and the enemy markers and perform logical actions on these arrays...

    but anyway: well done

    aloa
    cody
    #include "reallife.h"

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    85
    good program, my only suggestion is to try to find a way to randomize the computer moves somewhat in insane, because once you find a way to win, you can keep using the exact same moves.

    - the system() commands aren't very nice in my oppinion
    whats wrong with system() commands?

  7. #7
    Registered User cody's Avatar
    Join Date
    Sep 2001
    Posts
    86
    They are ugly There's always another way to do it without a system() command.

    arigato
    cody
    #include "reallife.h"

  8. #8
    phubuh
    Guest

    Re: nice program

    Originally posted by Kuplex
    PS- i got beat alot by the 'insane' AI
    If you're fairly smart, you should get a tie every time.
    :P

  9. #9
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    I followed an old thread on a TicTacToe game of yours; and I tried to make my own, but failed.. I tried again a few weeks later and my result is attached. It sounds fairly similar to yours; but instead of coding an AI i've decided to take a try at connect 4.
    Last edited by Dual-Catfish; 12-10-2001 at 05:36 PM.

  10. #10
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    Err, can't attach file to an edited message; here it is.
    Attached Files Attached Files

  11. #11
    Registered User Kuplex's Avatar
    Join Date
    Dec 2001
    Posts
    18

    Exclamation phubuh, i was being nice--you ass

    .
    Kuplex
    "The only thing you can count on is uncertainty."

    Must I explain myself futher?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tic Tac Toe game
    By nafix in forum C Programming
    Replies: 6
    Last Post: 11-10-2007, 12:45 PM
  2. tic tac toe crashes :(
    By stien in forum Game Programming
    Replies: 4
    Last Post: 05-13-2007, 06:25 PM
  3. 2D RPG Online Game Project. 30% Complete. To be released and marketed.
    By drallstars in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 10-28-2006, 12:48 AM
  4. tic tac toe AI roadblock >:-(|)
    By dark_rocket in forum Game Programming
    Replies: 5
    Last Post: 06-12-2006, 05:13 AM
  5. not 3x3 tic tac toe game AI
    By Unregistered in forum Game Programming
    Replies: 9
    Last Post: 08-29-2001, 04:02 AM

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