Quote: "it works wow its really THAT simple? cool!"
Depends on what you want to do. It's much more complex to find a path through a maze than it is to guess a random number! But all AI is is providing an algorithm for the computer to figure out a solution to a problem and then act on the solution making it look like the computer has made a decision. For example, if two objects are a certain distance from a computer controlled object, be it a sprite or a 3d object or wahtever, if you want the computer object to move towards the closer object, a simple AI would be to use the distance formula to check which object is closer and then move the computer object towards that.
Quote: "This seems the best place to ask this question without starting my own thread.
What's the best way to make AI for tic-tac-toe?
"
I made a TicTacToe game for one of the DBC challenges a while back. You can check it out at
http://zimnox.com/dbcc/index.php?page=view&challenge=Grid%20Challenge or click on the DBC chaleenges thread and on the first page, go to the zimnox website and look for the grid challenge.
The way I did the AI was to give everything a numeric value. An empty square = 0 . A player's mark in a square = 1, and the computer's mark in a square = -1 . A win was determined by adding the values of 3 squares in a row in any of the 8 possible directions after each turn. If there was a return of +3 then the player had won. If there was a value of -3 then the computer won. If all the squares were played and no rows added up to 3 or -3, then the game was a tie (or a cat as we used to call it). For the computer to choose it's square, it looks for a win first (-3), then it looks to see if the player might win on the next turn (is there a +2 somewhere and an empty square?), then it looks to see if the middle square is open, then it looks for the highest score it can get.
Enjoy your day.