-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
FeatureRequest: hasCastled(bool white) #258
Comments
Something I wanted earlier as well! |
I doubt Seb finds the time to do additional none-bugged features himself. You should do the Pullrequest to give him the chance to include the feature in the first place i think. But the Idea is nice although i can't see a way to use it in case of evaluation but i'm up to see ur version if it makes it to the video and probably also be code-reviewed then :) |
@selim What if the opponent manually castles their king by moving the king and rook to the correct positions. Does that count as castling? |
I guess so. Depends on if you are interested in the castling move itself or judging the safety of the king. I'd argue that this would make the king safer than if it hadn't moved at all so yes I would count it as castling for my purposes ;) |
Update: Sebastian has added board.GameMoveHistory which lets you look at the moves played so far, making this very easy to check. Thanks everyone! |
The problem is that GameMoveHistory is not updated during the bot search. So from my point of view it's kind of useless. We still need to maintain a custom history while using bot, right? |
Hi, the only tools related to castling as far as I know are:
Move.IsCastles
board.HasKingsideCastleRight(bool white)
board.HasQueensideCastleRight(bool white)
With this we can easily check if our own bot has castled, but since we can't access the oponent's last move (unless there's a board.LastMove function I'm not aware of) it's difficult to check if the oponent has.
We could, on our bot's turn, manually check the values of the oponent's 4 castling-related squares to check if they have castled. I've tried this and it's quite costly in terms of tokens.
I've looked at the Board.cs class and I think I can easily implement the functionality I'm looking for, but obviously that would be a waste of time if this change is deemed unreasonable for a pull request.
I think it's still early enough in the challenge to consider adding this feature, so let me know if that would be of interest.
Thanks!
The text was updated successfully, but these errors were encountered: