I've done a small amount of AI programming, (but never used a Neural Network, which seems to be the main structure for producing a 'learning' program). Instead I used Genetic Algortihms, in which you 'evolve' a program rather than 'teach' it. I managed to get a program to learn how to play a German board game called 'Adel Verpflichtet' This involved producing a 'strategy' that competed against other 'strategies'. Once all strategies had been tested, they would 'mate'. The strategies that performed the best would have a better chance of 'mating' IN the mating process, two strategies would 'cross' at a certain point (the strategies were represented as character strings; a point in the string would be chosen and the two strategies would swap their data from that point on). The resulting new strategies were then placed in the next generation. This worked well enough that when I sat down to play the computer at the end of evolution (100 generations), the computer not only beat me but completely routed me. ------------ (Side note: I never (well, almost never) play computer/console games. I spend my entire day in front of a computer, so when I get home that's the last place I want to be. Instead, I have a large selection of quality board games [and a much larger selection of not-so-quality board games!], most of which are German games, and get together with groups of friends to play these games. 'Adel Verpflichtet', 'Die Siedler van Catan', and 'Ra' are but a few prime examples.) (Side Note 2: Since analyzing the computer's strategy, I have only lost the game once in the past five years. And that was to my wife, who also knows the computer's strategy....)
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
we started on the tic-tac-toe game in a c++ class a few years ago, but never finished it. the idea was to make the computer "learn" by keeping track of losing combinations. obviously, if the computer lost with a certain set of moves in response to the opponent's moves, the computer would not make that move again. simple in theory - just a pain in the neck to keep track of. i wrote another pseudo-ai game for the same class. it is the game of NIM - you have a jar full of marbles. you and the computer take turns removing marbles from the jar. the one who takes the last marble loses. the rule is that you can take NO MORE than half of the marbles, but you MUST take AT LEAST one. there is a way to win the game every time if you go first. so, my computer has stupid mode and smart mode. if you play the computer in smart mode and it goes first (or you go first and make a mistake), the computer wins. if you play the computer in stupid mode, you will win (unless you are stupid). of course, that is not AI, but some of my non-programmer friends think it must be.
Joined: Aug 20, 2001
Interesting rules for NIM. I always knew it as you could take 1, 2, or 3 marbles. And there were always 21 marbles in the JAR. And you will win every time if you opponent goes first. (When you opponent takes x marbles, you take 4-x marbles)
Joined: Apr 12, 2001
hmmm, we must be using a variation of the game. there is not a limit on the number of marbles in the jar for us... and if your opponent goes first and knows how to win, you will lose. the trick to win our variation is to leave (power-of-two - 1 )in the jar after your turn. so, if you start with 21 marbles and you go first, you want to take 6 marbles to leave 15... and so on until there are 3 marbles left and it is the opponent's turn. the most the opponent can take is 1, leaving 2 and you take 1 leaving the last marble for the opponent.
We have forums that deal with AI at http://forums.embeddedthought.com My colleague is very much into AI and really knows his stuff. You all should check it out. We would be willing to add some more Categories that deal with AI if we have some interested parties participating at the site.
Wonder if anyone tried to program some artifical intell. into a program to play a game or something. I am working on it for tic tac toe. I had this as a project in my senior year CS class. Essentially, you build a tree where each node corresponds to a game state space. That is, for every possible human move you construct all possible computer moves, and for every one of those, you construct all possible human moves again. Since there are only 9 spots in tic-tac-toe, your tree has only 9 levels. Once you build a tree, you evaluate the position at each node at the bottom of the tree. Subsequently, you traverse back from the best node on the bottom up to the current level and make a move. It's just a hundred lines of code or so. This is just one way to do AI, of course. There are other techniques, such as neural networks, genetic programming, fuzzy logic, or even plain old regression techniques. Eugene.
gee...and i thought i was doing good by having my Ship Captain and Crew game not roll for a better score if it had already won (since it rerolled 3's and saved 4's it would have been possible for it to reroll and get a lower score) :roll: