Results 1 to 4 of 4

Thread: Tic Tac Toe

  1. #1

    Thread Starter
    Member andrew5578's Avatar
    Join Date
    Dec 2003
    Posts
    51

    Tic Tac Toe

    Hey, I did a tic tac toe program 2 player. Now that im doing single player, to make an unbeatable AI, im mapping out every single movement, and moving accordingly. I decided to use nested select case to map the moves. Theres a problem though. Lets say its the 3rd move, how would i make my select case move three nested select cases in, so that the ai knows which move it is and how to move? Does anyone have any examples of single player ai that they did?
    Last edited by andrew5578; Jan 24th, 2004 at 12:15 AM.
    aka Ender

  2. #2
    Lively Member
    Join Date
    Oct 2003
    Posts
    96
    Havn't you ever seen the movie WarGames?

    TicTacToe has no winner.

    Skip making aTicTacToe game, make a Global Thermonuclear War game.


  3. #3
    Addicted Member Peter1's Avatar
    Join Date
    Aug 2002
    Posts
    166
    Heres my Noughts and Crosses game.

    The Grid is an array of labels, so 0 to 9.

    0 1 2
    3 4 5
    6 7 8

    The Computer loops through them all. For example when it gets to 0 it checks (0,1,2), (0,3,6) and (0,4,8) to see if the player has two in a row, if it does, then the third square becomes our computers move. You've also got to check, if the squares are blank.

    So For Example when the computer loops to 5, it checks (2,5,8) and (3,4,5).

    Heres the game I did anyway.
    Attached Files Attached Files
    Last edited by Peter1; Jan 24th, 2004 at 04:10 AM.

  4. #4
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Originally posted by OberCanober
    Havn't you ever seen the movie WarGames?

    TicTacToe has no winner.

    Skip making aTicTacToe game, make a Global Thermonuclear War game.

    He's right,

    Tic Tac Toe is always Catzzzzzzzzz,

    provided you aren't a moron like me

    jon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width