-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
King's movement - castling #76
Comments
It's easier to start from move execution itself than from conditions when it's allowed, so I'll start from position generation ... |
Currently position generation cases: |
Implementing #83 thus added castling both king-side and queen-side to list of allowed moves (via source-> destination square like "e1", "g1" not using 0-0 notation) |
This makes obvious that castling is done in #76
…testing) I've created a version of LegalPlayer who is castling-addicted: it prefers not to move king&rooks except it's castling possibility Manual testing shows #76 can be closed. This commit is a start of era of EVALUATING different moves and choosing some of them as the best one depending on a desired strategy. Current 'castling-addicted' player is 2'nd strategy I use after the simplest first one (get any legal move)
#91 reference added |
The castling is rather a complex topic, therefore I introduce a separate sub-issue of #65
(0) This is a move of the king and either rook of the same colour along the player’s first rank, counting as a single move of the king and executed as follows: the king is transferred from its original square two squares towards the rook on its original square, then that rook is transferred to the square the king has just crossed.
(1) The right to castle has been lost:
if the king has already moved, or
with a rook that has already moved.
(2) Castling is prevented temporarily:
if the square on which the king stands, or the square which it must cross, or the square which it is to occupy, is attacked by one or more of the opponent's pieces, or
if there is any piece between the king and the rook with which castling is to be effected.
The text was updated successfully, but these errors were encountered: