Omnimaga
Calculator Community => TI Calculators => TI-BASIC => Topic started by: TiAddict on July 26, 2012, 06:25:36 pm
-
Hello, im back to programming! And im creating a game, but im having hard time with programming the decision algorithm of AI. Can someone show me how "chess" AI algorithm work? Thank you! :D
-
I wouldn't know that, i guess you could hard code every piece, or maybe look up the algorythm, so making chess-game? Much luck, and hope it turns out to be good and creative
Edit: hardcoding should be like this:
Make it tile-based, store all places in list or string, first let the ai check the opponents board, then check ai's pieces and let him look for the most important piece he could defeat atm, and else let him do a move to be close to defeating a piece, and just go on every move like that
-
I know thepenguin made a really nice chess program, you can find that here (http://www.ticalc.org/archives/news/articles/14/147/147694.html).
I also remember that he put his formula for determining the moves somewhere. It assigns each possible move a rating based on what pieces it can attack, what pieces can attack it, and how it compared to its original possition. I forget the exact formula :P
P.S. You could rename your topic to something more descriptive like Chess AI.
-
One minor issue is that this would be a basics project? And thepenguin has an axe/asm version of the chess, so implementing the formula could e rather hard, i'm sure you could work it out with the same methode for the formula, but you would have to change a lot to have it working in basic
Edit: i haven't read it completely myself but here's a link to an descission algorythm theorie http://en.m.wikipedia.org/wiki/Minimax (http://en.m.wikipedia.org/wiki/Minimax)