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

Incorrect castling san move? #403

Closed
pmz opened this issue Apr 27, 2019 · 2 comments
Closed

Incorrect castling san move? #403

pmz opened this issue Apr 27, 2019 · 2 comments

Comments

@pmz
Copy link

pmz commented Apr 27, 2019

With a rank 1 like so:
R N B Q K . . R
board.push_san("Kg1") returns ValueError: illegal san: 'Kg1'
but board.push_san("Kh1") properly castles king side. Of course, "O-O" works as well.

This is confusing to me. My understanding is that this is the way to castle in a chess960 game?
But I'm playing a classical game of chess (chess960=False), so castling should be done by moving the king to g1.

What am I missing?

@niklasf
Copy link
Owner

niklasf commented Apr 28, 2019

SAN for castling is O-O (kingside) and O-O-O (queenside). If anything it's a bug that Kh1 is accepted. Will fix.

@pmz
Copy link
Author

pmz commented Apr 28, 2019

Thanks for the quick reply @niklasf
And thanks for python-chess, this is a great project.

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

2 participants