Yesterday I got Exotherm to find all the places a piece could conceivably move. Today I used that to generate a list of all hypothetical moves, and then that to generate the list of legal moves. Castling is a bit of a special case, so castles are only inserted into the move list in the last stage. Legality in general is somewhat tough because of atomic's check rules, e.g. being next to the other king makes it impossible to be in check.
After writing the move list generator but before handling legality, I made the FICS bot script select and play a random move when it's to move in a game, resigning if the server says the move was illegal. With the obvious caveats, that worked! After implementing legality testing, resignations almost went away. There was a bug in the hypothetical move executor such that it thought any king move to the C or G files was castling, so it mangled the board state whenever that happened. Fixing that has, as far as I can tell, made its legality tester perfect.
No comments:
Post a Comment