Skip to content

Conversation

@sowson
Copy link

@sowson sowson commented Aug 17, 2024

Hi @kz04px, I simplified my case, I would like to contribute if you agree? Thanks! ;-).

@kz04px
Copy link
Owner

kz04px commented Aug 20, 2024

The perft values should already be correct, but you've changed them. I don't think this can be right. Perhaps there's a misunderstanding in how castling works under chess 960?

Take this code when castling king side, for example:

-const auto king_path = (squares_between(ksq, squares::G1) | Bitboard(squares::G1)) & ~Bitboard(ksq);
+const auto king_path = (squares_between(ksq, castle_king_to[0]) | Bitboard(castle_king_to[0])) & ~Bitboard(ksq);

king_path is a mask of the squares the king travels through to get to its destination square of g1. This never changes no matter what the starting position is.

@sowson
Copy link
Author

sowson commented Aug 20, 2024

Can you please take a look at https://support.chess.com/en/articles/8614060-how-do-i-castle-in-chess960 ? It explains what I did.

@sowson
Copy link
Author

sowson commented Sep 11, 2025

Hi @kz04px, can you reconsider using this change? ;-).

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

Successfully merging this pull request may close these issues.

2 participants