Page 1 of 1

Castling legality check

PostPosted: 04 Jan 2007, 18:22
by mjlef
In NOW, I have always done the full castling legality check during move generation, including the test for attacks of the to and position the king moves over. Of course, if I was more clever, I would just do the fast, simple tests during move generation, and do the more expensive attacks checks only if the move is played.

What do you all do?

Mark

Re: Castling legality check

PostPosted: 04 Jan 2007, 19:02
by H.G.Muller
I do the tests after the move is played, like for any other King move. Only difference is that I also test if the Rook is in check.

In micro-Max I even test the from-square, since it is not aware of the in-check status. This also makes it easier: for both castlings I have to test the skipped square and the squares left and right of it.