Skip to content

Conversation

@Amir-Zucker
Copy link
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.

…placed .minimum static let with a static function that accepts initial color
@Amir-Zucker Amir-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