Sep 27, 2004, 04:53 PM

Man, I'm trying to program a chess AI...

This is really a cool task actually. Probably one of the most challenging I had...

The "theory" is very simple, you just need to list all possible moves, then the possible replies, then the possible re-replies ecc... up to a point, and at that point evaluate the position "statically' (say just counting how many pieces are left and giving some points to every piece), then procede backwards finding the best move for the player given that the opponent (and you too) will play the optimal move each turn...

the crazy thing is that I'm doing this in Matlab (since I have to learn it for my studies), which is pretty good in the sense that vector operations are built in and many math stuff too, the problem is that it's quite slow I guess...

In the end I managed to get the basic stuff done (oh by the way now all my pieces move like queens, It was the most "challenging" piece so I sticked to that one :-P)

So I organized data in this way: for every piece on the chessboard I listed all possible moves and all the positions in which you may arrive with that piece (that identifies all possible moves), then you create all the corresponding positions (chessboard matrices), and then you should continue iteratively for a while before the "static" evaluation, but it looks that I manage only to look 1 move ahead before the CPU starts taking ages...

I just realized that it might be more convenient to store the information of the chessboards not as matrixes representing the chessboard, but simply by the position of the pieces. However this is quite unnatural and may lead to problems.

I really encourage you to spend a few days trying to set up a "brute force" program, nothing really fancy, just to check out what a cool challenge it is

that's also a really cool idea for a new contest!

This is really a cool task actually. Probably one of the most challenging I had...

The "theory" is very simple, you just need to list all possible moves, then the possible replies, then the possible re-replies ecc... up to a point, and at that point evaluate the position "statically' (say just counting how many pieces are left and giving some points to every piece), then procede backwards finding the best move for the player given that the opponent (and you too) will play the optimal move each turn...

the crazy thing is that I'm doing this in Matlab (since I have to learn it for my studies), which is pretty good in the sense that vector operations are built in and many math stuff too, the problem is that it's quite slow I guess...

In the end I managed to get the basic stuff done (oh by the way now all my pieces move like queens, It was the most "challenging" piece so I sticked to that one :-P)

So I organized data in this way: for every piece on the chessboard I listed all possible moves and all the positions in which you may arrive with that piece (that identifies all possible moves), then you create all the corresponding positions (chessboard matrices), and then you should continue iteratively for a while before the "static" evaluation, but it looks that I manage only to look 1 move ahead before the CPU starts taking ages...

I just realized that it might be more convenient to store the information of the chessboards not as matrixes representing the chessboard, but simply by the position of the pieces. However this is quite unnatural and may lead to problems.

I really encourage you to spend a few days trying to set up a "brute force" program, nothing really fancy, just to check out what a cool challenge it is

that's also a really cool idea for a new contest!