Skip to content

Commit 2ea2c09

Browse files
committed
fix: black not having close castling rights removed after B pawn moves
1 parent 71d352b commit 2ea2c09

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

move_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ type perfTest struct {
2121
// https://www.chessprogramming.org/Perft_Results
2222
var perfResults = []perfTest{
2323
{pos: unsafeOFEN("ppkn/4/4/NKPP w NCFncf - 0 1"), nodesPerDepth: []int{
24-
10, 84, 642, 4348, 29171, 183118,
24+
10, 84, 642, 4373, 29389, 185151,
2525
}},
2626
{pos: unsafeOFEN("ppkn/4/2P1/NK1P w NCFncf - 0 1"), nodesPerDepth: []int{
27-
10, 75, 538, 3407,
27+
10, 75, 538, 3432,
2828
}},
2929
}
3030

position.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func (pos *Position) updateCastleRights(m *Move) CastleRights {
367367
if didPieceMove(pos, m, BlackKing, D4) {
368368
removeCastlingRight(&cr, "n")
369369
}
370-
if didPieceMove(pos, m, BlackKing, D4) {
370+
if didPieceMove(pos, m, BlackKing, B4) {
371371
removeCastlingRight(&cr, "c")
372372
}
373373
if didPieceMove(pos, m, BlackKing, A4) {

0 commit comments

Comments
 (0)