Castling legality check

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Castling legality check

Postby mjlef » 04 Jan 2007, 18:22

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
mjlef
 
Posts: 64
Joined: 29 Mar 2006, 22:04

Re: Castling legality check

Postby H.G.Muller » 04 Jan 2007, 19:02

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.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 5 guests