# Artificial intelligence

Show 30 post(s) from this thread on one page
Page 1 of 2 1 2 Last
• 06-27-2005
Veli
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
zachtib
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
Veli
thanks, that is a lot better than what I thougt of.
• 06-28-2005
Morgoth
What were you thinking of?
• 06-28-2005
Veli
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
zachtib
Quote:

Originally Posted by Veli
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.

ah ha! the brute-force method. Long and tedious, but when you finish, you have an unbeatable tic tac toe game
• 06-29-2005
Morgoth
Quote:

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.
But that isn't AI, it's not Intelligent.
• 06-29-2005
dark_lord_kodd
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
zachtib
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
jasonlambert
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 :)
Show 30 post(s) from this thread on one page
Page 1 of 2 1 2 Last