Skip to content
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

Closed
lrozenblyum opened this issue Dec 7, 2013 · 4 comments
Closed

King's movement - castling #76

lrozenblyum opened this issue Dec 7, 2013 · 4 comments
Milestone

Comments

@lrozenblyum
Copy link
Owner

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.

@lrozenblyum
Copy link
Owner Author

It's easier to start from move execution itself than from conditions when it's allowed, so I'll start from position generation ...

@lrozenblyum
Copy link
Owner Author

Currently position generation cases:
a) white short
b) white long
c) black short
d) black long

@lrozenblyum
Copy link
Owner Author

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)

@lrozenblyum lrozenblyum mentioned this issue May 2, 2014
lrozenblyum added a commit that referenced this issue Jun 30, 2014
This makes obvious that castling is done in #76
lrozenblyum added a commit that referenced this issue Jun 30, 2014
…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)
@lrozenblyum
Copy link
Owner Author

#91 reference added

@lrozenblyum lrozenblyum added this to the 0.1 milestone Feb 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant