-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Crazyhouse en passant bug with DropMove #24
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to debug this. For now I just commented about the code, not the bug itself.
I need to take the time to replay the bug myself to understand why it occurs in crazyhouse.
a = a.playSan('Bd8'); | ||
|
||
a = a.playSan('Nc3'); | ||
printBoard(a, printLegalMoves: true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No print should be left
|
||
a = a.playSan( | ||
'Q@f7'); // Bug: copyWith() is given null for epSquare, which then copies White's epSquare of f6 forward to Black | ||
final List<Move> legalMoves = printBoard(a, printLegalMoves: true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a bit weird to define legalMoves using a printBoard
function; I think you can just use a list literal instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned with this whole file. While I understand how it can help you to understand better a situation and see the legal moves for a position I think it should stay private code.
If that code was meant to be in the repo I'd name things differently (MyExpectations
is a bit vague) and put doc comments.
You're comparing the number of legal moves in a position. In a way it's like perft
, so I think this whole test should be replaced by a perft test.
Perft has the advantage of being a standard and I prefer dartchess to use such standards. Another great advantage is that you can run perft tests on other chess libraries to ensure even more the validity.
Fixes #23