Skip to content

Conversation

@okmsbun
Copy link
Contributor

@okmsbun okmsbun commented Feb 14, 2024

I did something like this to solve this problem. If there was a castling move containing the values of the map here, I forced it to change it with its key. Before solving this problem, this needs to be solved first.

On the game analysis screen, I reduced eight castling alternatives to four. In all moves, there will be a movement just like the movement in the keys. Is this logic correct? If true, is this function the place of application?

@veloce
Copy link
Contributor

veloce commented Feb 16, 2024

I think the logic is correct, also Node looks like a good place to put this.

Since the alternative castling notation is always tricky it would be good to also add a new test to the Node tests to ensure all types of castling moves produces the same branch id.

@okmsbun
Copy link
Contributor Author

okmsbun commented Feb 20, 2024

I also added the tests. It now works like on the lichess.org website.

In the 3 pictures below, I played "e1g1", but it behaves as if I played "e1h1". So everything seems fine. It behaves the same as the Lichess.org website.

before after lichess.org
Screenshot_1708439848 Screenshot_1708439896 Screenshot 2024-02-20 at 17 40 40

Copy link
Contributor

@veloce veloce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thank you!

@veloce veloce merged commit 3cd94c4 into lichess-org:main Feb 21, 2024
@okmsbun okmsbun deleted the alternative_castling branch February 21, 2024 11:09
@okmsbun okmsbun restored the alternative_castling branch February 22, 2024 13:15
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