Results 1 to 3 of 3
  1. #1
    eLancaster is offline Member
    Join Date
    Jan 2011
    Posts
    93
    Rep Power
    0

    Default Tic Tac Toe Artificial intelligence algorithm

    I've written a GUI Tic Tac Toe program. I've used a huge set of "if" statements to decide where the computer ought to place the "O" in order to put up a good fight against the human player.

    But the "if" set just doesn't feel efficient. It seems like a haphazard solution.

    Could some one please describe better ways to go about programming the artificial intelligence. I'd appreciate it if you could keep it dumbed down.

    Thanks!

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,525
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by eLancaster View Post
    I've written a GUI Tic Tac Toe program. I've used a huge set of "if" statements to decide where the computer ought to place the "O" in order to put up a good fight against the human player.

    But the "if" set just doesn't feel efficient. It seems like a haphazard solution.

    Could some one please describe better ways to go about programming the artificial intelligence. I'd appreciate it if you could keep it dumbed down.

    Thanks!
    Google for "mini-max strategy" and/or "alpha-beta pruning". AB-pruning is identical to the min-max algorithm but it avoids 'dead ends' in your search tree. Personally I find self learnig methods much more fun for simple games as TicTacToe ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,415
    Rep Power
    25

Similar Threads

  1. artificial intelligence for a tank
    By newbie79 in forum New To Java
    Replies: 9
    Last Post: 12-22-2010, 04:27 PM
  2. Artificial Intelligence knowledge base in java
    By ala_mages in forum Advanced Java
    Replies: 5
    Last Post: 12-06-2010, 10:44 AM
  3. Artificial intelligence coding problems
    By MuslimCoder in forum New To Java
    Replies: 1
    Last Post: 02-26-2010, 03:30 PM
  4. Help with an Algorithm
    By Manfizy in forum New To Java
    Replies: 22
    Last Post: 07-03-2009, 07:16 AM
  5. O(log n) algorithm help !!!!!!
    By itseeker87 in forum New To Java
    Replies: 8
    Last Post: 09-09-2008, 05:12 PM

Posting Permissions

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