This is a discussion on Tic-Tac-Toe within the General AI Programming forums, part of the Cprogramming.com and AIHorizon.com's Artificial Intelligence Boards category; I've written two logical algorithms for tictactoe. One is if the computer is going first, and the other is for ...

  1. #1
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001


    I've written two logical algorithms for tictactoe. One is if the computer is going first, and the other is for if the user player is going first. The way I formed them (not dealing with a computer yet) was in a basic "do this, then base next move on what they do" basis. I'm wondering how I can get that to translate into a function that accepts a boardstate and acts upon at any state. It's not a translation I can make directly, do you know what I mean? Any suggestions would be helpful. I don't want to use another algorithm.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  2. #2
    Registered User
    Join Date
    Aug 2002
    Hermosa Beach, CA
    why would you avoid using minimax. It is exactly the algorithm you are looking for. I have a full implementation already in the AI threads. You could just take the minimax implementation, and provide your own board representation.
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

  3. #3
    x4000 Ruski's Avatar
    Join Date
    Jun 2002
    Outer Space!
    ugh.. I'm new to this stuff.. but what exactly is minimax?
    what does signature stand for?

  4. #4
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Manassas, VA USA
    • "Problem Solving C++, The Object of Programming" -Walter Savitch
    • "Data Structures and Other Objects using C++" -Walter Savitch
    • "Assembly Language for Intel-Based Computers" -Kip Irvine
    • "Programming Windows, 5th edition" -Charles Petzold
    • "Visual C++ MFC Programming by Example" -John E. Swanke
    • "Network Programming Windows" -Jones/Ohlund
    • "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
    • "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel

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