Skip to content

Bug fix - Incorrect minimum value when starting from black position - #55

Open
Gideon-Zucker wants to merge 3 commits into
chesskit-app:masterfrom
Gideon-Zucker:sync_back_to_chesskit_incorrect_minimum_value_when_starting_from_black_position
Open

Bug fix - Incorrect minimum value when starting from black position#55
Gideon-Zucker wants to merge 3 commits into
chesskit-app:masterfrom
Gideon-Zucker:sync_back_to_chesskit_incorrect_minimum_value_when_starting_from_black_position

Conversation

@Gideon-Zucker

Copy link
Copy Markdown
Contributor

This PR fixes an issue where the move tree is represented incorrectly for games where we started from a position where black player makes the first move.

Consider the following fen:
rnbqk2r/pp2bppp/4pn2/2pp4/2PP1B2/2N2N1P/PP2PPP1/R2QKB1R b KQkq - 0 6

Black to move and plays cxd4
white responds with cxd5
black then plays Nxd5
and white plays Nxd5

With the current implementation white moves will be offset by 1 and the move tree would look like:

cxd5 cxd4
Nxd5 Nxd5
Where it should look like:

(empty) cxd4
cxd5 Nxd5
Nxd5 ....
This PR fixes the issue, by asking for a color to move first when providing the value for the minimum index which all other indices rely on.

@Gideon-Zucker Gideon-Zucker changed the title Bugfix - Incorrect minimum value when starting from black position Bug fix - Incorrect minimum value when starting from black position Jan 29, 2025
@pdil
pdil self-requested a review February 5, 2025 03:27
@pdil pdil added the bug A bug or issue that should be resolved label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A bug or issue that should be resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants