Results 1 to 10 of 15
I am making a quite simple tic tac toe game in flash. How should i make an AI to play against?
Isn't there a smarter way than a lot of ...
- 06-27-2005 #1Just Joined!
- Join Date
- Mar 2005
- Location
- Roskilde, Denmark
- Posts
- 93
Artificial intelligence
I am making a quite simple tic tac toe game in flash. How should i make an AI to play against?
Isn't there a smarter way than a lot of if-arguments?
By the way, sorry if I am posting in the wrong forum...
- 06-27-2005 #2Linux User
- Join Date
- Dec 2004
- Location
- Speed School of Engineering
- Posts
- 267
I had to do something like this before for a class.
First, we wrote a simple program that first checked to see if the other player was about to win, and if so, so block the move. Otherwise, it made a random move.
Then we wrote another program that began by making random moves. at the end of the game, if it won, then it would add a "point" to that sequence of moves, thereby increasing the chance of choosing that sequence of moves the next game. so it would "learn" what was a good move and what was a bad move. Then we set the two programs to play several thousand games against each other, and afterwards, the "learning" program played a pretty good game of tic-tac-toe
- 06-28-2005 #3Just Joined!
- Join Date
- Mar 2005
- Location
- Roskilde, Denmark
- Posts
- 93
thanks, that is a lot better than what I thougt of.
- 06-28-2005 #4Just Joined!
- Join Date
- Feb 2005
- Location
- Delft, Holland
- Posts
- 95
What were you thinking of?
- 06-28-2005 #5Just Joined!
- Join Date
- Mar 2005
- Location
- Roskilde, Denmark
- Posts
- 93
I would make an if-argument for every combination. You would end up with a whole lot of if arguments that way, if you should cover all posibilities, so I decided that there had to be a better way of doing it.
- 06-29-2005 #6Linux User
- Join Date
- Dec 2004
- Location
- Speed School of Engineering
- Posts
- 267
ah ha! the brute-force method. Long and tedious, but when you finish, you have an unbeatable tic tac toe game
Originally Posted by Veli
- 06-29-2005 #7Just Joined!
- Join Date
- Feb 2005
- Location
- Delft, Holland
- Posts
- 95
But that isn't AI, it's not Intelligent.I would make an if-argument for every combination. You would end up with a whole lot of if arguments that way, if you should cover all posibilities, so I decided that there had to be a better way of doing it.
- 06-29-2005 #8Linux Newbie
- Join Date
- Nov 2004
- Posts
- 239
maybe you dont have to be intelligent to play tic tac toe
I had to do a similar thing, I think we used game trees, which are binary trees with branches for every condition in the game....the trees start off massive but you can prune them down until you have a clear path to victory
- 06-29-2005 #9Linux User
- Join Date
- Dec 2004
- Location
- Speed School of Engineering
- Posts
- 267
if your doing this on flash, and it will be online, make an *actual* learning program that will learn by playing against real humans, rather than a simulated opponent. That way, the longer the game is online, the better the AI will become
- 06-29-2005 #10Linux Guru
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 3,284
does anyone have any AI links they could put foward as "recommend reading"? ..maybe sites you've found useful in the past.
This sounds like some interesting stuff


Reply With Quote
