Thread: where to get algorithm of TicTacToe in approach w/ C

  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    19

    where to get algorithm of TicTacToe in approach w/ C

    tnx in advance

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Google

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    If memory serves:

    Initalize board to all blanks or zero's

    Call Main Menu function which asks if you'd like to play a game

    If yes, call game_menu()

    which displays the board, asks for the next move, etc., in a large loop.

    Get a move.

    Confirm given move would be legal, if made.

    If it's legal:
    * make the move and display it.

    *Check if game is now won, lost, or drawn, as a result of that last move

    **If it is, give appropriate message and return to main menu(). Ask if they want to play again.

    if game is not over, loop back to top of game_menu for next move.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Implement of a Fast Time Series Evaluation Algorithm
    By BiGreat in forum C Programming
    Replies: 7
    Last Post: 12-04-2007, 02:30 AM
  2. Replies: 4
    Last Post: 12-10-2006, 07:08 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM