Bug fix - Incorrect minimum value when starting from black position #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.