Skip to content

Commit

Permalink
fix: don't need to calculate promotions for zobrist hash
Browse files Browse the repository at this point in the history
  • Loading branch information
znxftw committed Dec 2, 2024
1 parent 9a6124b commit b366b93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Rudim/Board/BoardState.Moves.cs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ private ulong GetBoardHash()
currentHash ^= ZobristTable[12, (int)EnPassantSquare];
}

return Moves.Where(move => move.IsPromotion()).Aggregate(currentHash, (current, move) => current ^ ZobristTable[13, (int)move.Type.Piece]);
return currentHash;
}

public static void ClearMoveCache()
Expand Down

0 comments on commit b366b93

Please sign in to comment.