Thread: tic tac toe

  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, 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. tic tac toe game
    By Leeman_s in forum Game Programming
    Replies: 9
    Last Post: 04-24-2002, 03: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, 05:16 PM