Jump to content


Tic Tac Toe


  • You cannot reply to this topic
15 replies to this topic

#1 rego

    Member

  • Members
  • PipPip
  • 46 posts

Posted 20 November 2004 - 12:08 PM

Hi all!
just wanted to know what i could represent as the training data for the computer to learn to play a game of tic-tac-toe against a human.
cheers!

#2 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 20 November 2004 - 12:40 PM

maybe you could explain a little more how your AI system works ?
If Prolog is the answer, what is the question ?

#3 NomadRock

    Senior Member

  • Members
  • PipPipPipPip
  • 785 posts

Posted 20 November 2004 - 02:55 PM

If you wanted AI to play tic-tac-toe you would just have it check all possible solutions, there aren't many. You can use magic square techniques to speed this up, but on modern computers slow algorithms for this will go faster than the user can click.
Jesse Coyle

#4 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 20 November 2004 - 05:41 PM

better yet... precompute the whole game and save it to disk. the game tree for tic tac toe is very small so you won't have a problem with space
If Prolog is the answer, what is the question ?

#5 ShadowHawk

    Member

  • Members
  • PipPip
  • 47 posts

Posted 23 November 2004 - 07:45 AM

Well precomputing is not really much of an AI is it. It is more a lookup table. From the formulation of the question i guess that the AI used is some sort of learning AI ( NN or genetic ) for that just make a programm that creates all the game possible states and then trian it with that. It is faster to create a programm for the testdata then to make the testdata yourself.

#6 rego

    Member

  • Members
  • PipPip
  • 46 posts

Posted 23 November 2004 - 10:37 AM

thank you shadowhawk that is what i meant! i will be using the back propagtion algorithm for NNs and ID3 for decision tree learning! :) i would be interested in using genetic learning but im not sure if it can be used for learning to play games!

many thanks!

#7 ShadowHawk

    Member

  • Members
  • PipPip
  • 47 posts

Posted 23 November 2004 - 11:17 AM

Be sure to post your game ( with code ) when it is done so other people can learn from it if they want. At least if u dont object to that. I for 1 would like to know how u solved the issue that a square in the game can be either black-white-open i only made a NN ( as a simple test ) to determine if a player had won or not.

#8 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 23 November 2004 - 09:19 PM

for tic tac toe you would usually use some sort of minimax/negamax algorithm and running that beforehand is as much AI as it is to use it while the game is running. of course it might be far more fun to write a programm that actually learns how to play the game... i guess i just wasn't sure what the intention of the OP was so i suggested the obvious :)
If Prolog is the answer, what is the question ?

#9 SnprBoB86

    Valued Member

  • Members
  • PipPipPip
  • 112 posts

Posted 23 November 2004 - 09:43 PM

Anyone ever seen http://www.zillions-of-games.com/ ? very cool stuff
Brandon Bloom
http://brandonbloom.name

#10 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 24 November 2004 - 10:23 AM

i've heard of it... they have an AI that only knows about the formally stated rules of a game and tries to play by them
If Prolog is the answer, what is the question ?

#11 rego

    Member

  • Members
  • PipPip
  • 46 posts

Posted 24 November 2004 - 11:57 AM

no problem shadowhawk i will post my game as soon as it is completed! it's gonna be completely made in Prolog!
many thanks!

#12 rego

    Member

  • Members
  • PipPip
  • 46 posts

Posted 27 November 2004 - 04:24 PM

does anyone know which of the following learning algorithms i can use to learn to play tic-tac-toe against a human?

candidate-elimination algorithm
Find-S algorithm
ID3 algorithm
Back-Propagation algorithm
Naive Bayes Classifier
K-Nearest neighbor algorithm
Q-Learning algorithm

I need to use 3 of them for my project!

I was thinking candidate-elimination algorithm, Back-Propagation and Q-Learning but i don't know if these wil work!

Many Thanks

#13 SnprBoB86

    Valued Member

  • Members
  • PipPipPip
  • 112 posts

Posted 27 November 2004 - 04:48 PM

Tic-Tac-Toe is far too simple to really get a good trial out of any more complex AI techniques. Why don't you pick something a little bit more complicated while stile simplistic in rules such as Reversi or Checkers or some other boardgame? With perfect play, Tic-Tac-Toe is always a draw... it is really quite uninteresting...
Brandon Bloom
http://brandonbloom.name

#14 rego

    Member

  • Members
  • PipPip
  • 46 posts

Posted 28 November 2004 - 11:53 AM

yeah i know but im already half way into the course and i cant change now - would be too much work!

#15 NomadRock

    Senior Member

  • Members
  • PipPipPipPip
  • 785 posts

Posted 28 November 2004 - 07:34 PM

You need to sit down and learn what those algorithms are. Worrying about changing games is the least of your problems. If you understood the techniques you could apply them to any simple game in minutes. Try reading your textbook, and talking with your proffessor.
Jesse Coyle

#16 rego

    Member

  • Members
  • PipPip
  • 46 posts

Posted 30 November 2004 - 10:50 AM

ok thanks





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users