Results 1 to 6 of 6
  1. #1

    Default Artificial Intelligence!

    I wanted to make a computer opponent in my tic-tac-toe level but I never had experience in AI programming, so I was wondering where I would start considering that I want to work on other AI projects.

  2. Thanks!

  3. #2
    German Community Moderator CuriousSack's Avatar
    Points: 98,211, Level: 97
    Level completed: 59%, Points required for next Level: 839
    Overall activity: 100.0%
    100 Experience Points 7 days registered 250 Experience Points 30 days registered 500 Experience Points
    Join Date
    May 2011
    Blog Entries


    So here's the chance for our logic puzzle freaks to betray secrets and help our new friend!

  4. Thanks!

  5. #3


    If you want an unbeatable AI that can calculate all the possible moves, the best solution would be to make a binary algorithmic system but I have never delved too deep into that and it takes some knowledge to make it work correctly, any tiny mistake and the whole thing fails basically.

    I'm lazy so I would never even attempt the method previously mentioned. What I would do is to use tags to map out the board conditions. The AI should know which ones of the 9 squares that are available and by analyzing the taken ones, be able to play accordingly. You need to set up rules. For example; if 2 squares in a row are taken, the third square should be highlighted for the AI, thus prioritized. The more rules you add the smarter the AI will become. You basically need to learn a bunch of tags and selectors how to play tic-tac-toe.

  6. #4


    This goes for any other board game right?

  7. Thanks!

  8. #5


    Pretty much, yes. Some are harder and some are easier. I'd label tic-tac-toe as an easier one due to the simplicity of the game.

  9. #6
    Sackperson Private koltonaugust's Avatar
    Points: 28,490, Level: 51
    Level completed: 86%, Points required for next Level: 160
    Overall activity: 14.0%
    7 days registered 100 Experience Points 250 Experience Points 500 Experience Points 30 days registered
    Join Date
    Jul 2010
    Blog Entries


    Tic Tac Toe is actually very easy to make an unbeatable ai. You could do a variety of different things such as counting each possible line for X's and O's (8 lines) for 2 either. There's also just go for middle if it's not taken. Basically the order should be:
    0. Is the middle taken (optional): If no, put it on middle
    1. Can my opponent win: if yes, block them.
    2. Is there a free corner: If yes, take one.
    3. Is there a free spot: If yes, take one.

Posting Permissions

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