Skip to content

Commit

Permalink
fix: black not having close castling rights removed after B pawn moves
Browse files Browse the repository at this point in the history
  • Loading branch information
dechristopher committed Mar 5, 2021
1 parent 71d352b commit 2ea2c09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions move_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ type perfTest struct {
// https://www.chessprogramming.org/Perft_Results
var perfResults = []perfTest{
{pos: unsafeOFEN("ppkn/4/4/NKPP w NCFncf - 0 1"), nodesPerDepth: []int{
10, 84, 642, 4348, 29171, 183118,
10, 84, 642, 4373, 29389, 185151,
}},
{pos: unsafeOFEN("ppkn/4/2P1/NK1P w NCFncf - 0 1"), nodesPerDepth: []int{
10, 75, 538, 3407,
10, 75, 538, 3432,
}},
}

Expand Down
2 changes: 1 addition & 1 deletion position.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (pos *Position) updateCastleRights(m *Move) CastleRights {
if didPieceMove(pos, m, BlackKing, D4) {
removeCastlingRight(&cr, "n")
}
if didPieceMove(pos, m, BlackKing, D4) {
if didPieceMove(pos, m, BlackKing, B4) {
removeCastlingRight(&cr, "c")
}
if didPieceMove(pos, m, BlackKing, A4) {
Expand Down

0 comments on commit 2ea2c09

Please sign in to comment.