tic tac toe

This is a discussion on tic tac toe within the Game Programming forums, part of the General Programming Boards category; Im a new programmer and im trying to make a tic tac toe game. I was wandering how to make ...

  1. #1
    wierd guy bart's Avatar
    Join Date
    Aug 2001
    Posts
    87

    tic tac toe

    Im a new programmer and im trying to make a tic tac toe game. I was wandering how to make the AI for it. could someone help me?

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    this is fairly simple....

    you can represent the board as a 2d 3x3 array

    you can take advantage of the fact that there is only 8 ways to win the game. three rows three columns and two diagonals

    the really simple tictactoe game will only check for possible wins on those lines and possible losses on those lines else place avatar in random slot... start with this then try to think how to make it more intelligent.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Ryce
    Guest

    Talking heh

    I didnt see this topic when i posted mine.

    I guess the AI for Tic Tac Toe is going to be a function with a TON of if statements. Or at least thats how i plan on doing mine!

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, 07:25 PM
  2. tic tac toe
    By holden in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 05-09-2004, 10:59 AM
  3. Help with Tic Tac Toe game
    By snef73 in forum C++ Programming
    Replies: 1
    Last Post: 04-25-2003, 09:33 AM
  4. tic tac toe game
    By Leeman_s in forum Game Programming
    Replies: 9
    Last Post: 04-24-2002, 04:24 AM
  5. my tic tac toe game, please try it
    By Leeman_s in forum C++ Programming
    Replies: 2
    Last Post: 04-14-2002, 06:16 PM

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