Recently I was on a board gaming forum and noticed that a Java developer had taken a new board game and created a Java version of it in about 1 week. This impressed me. It wasn't perfect, but it was certainly fully playable with full graphics and some kind of artificial intelligence.
I was instantly inspired to copy his effort using Adobe Flex as a learning exercise. But then it began to dawn on me that I have no idea how to incorporate artificial intelligence into a game. Ugh... a prerequisite was born. So I decided to start looking into AI.
I am just in the very early stages, but here's a small demo that I came up with in just a few hours. The logic is 100% javascript and there's no true AI (at least I don't think it can be called AI). The computer uses a brute force method of determining where to move. Is that AI or not?
Ooine's Fabulous JavaScript Tic-Tac-Toe
Considering that there are only 9 possible moves in Tic Tac Toe, brute force is an acceptable method to use. However, in your typical Euro board game, the potential actions are much more varied, and often boil down to a sort of "floating probability". I don't know if that's a real term, but I'm using it to mean that the probability of a particular action will vary depending upon the future thread of actions that other players take.
But anyway... I guess I have a lot of reading to do.
--- update ---
In playing with my little program, I have come to realize the following situation with Tic-Tac-Toe.
X|X|X
X|O|X
X|X|F
If the first players choose any corner ("F" for example), as the second player, choosing any space marked "X" above is a guaranteed loss. The ONLY valid choice is the center space ("O" in the example), which will result in a tie.
I guess I should have learned this from The Wopper.
There are no comments for this entry.
[Add Comment]