chessfriend/board
Eryn Wells 1c94f157e6 [board] First pass at computing checks
Calculate checks using a method described on a blog post I read.[1] This requires
knowing some details about the move that was just made: the origin and target
squares. The piece moved is also passed to the method, though it could look it up.

First look for a direct check, where the piece that just moved is now attacking
the king.

Second, look for revealed checks, where the moved piece reveals a ray from a
sliding piece that attacks the king.

This check information is collected into a CheckingPieces struct that describes
for the newly active player how they can get out of check. The push mask is a
BitBoard of the set of squares the player can move to in order to block the check.
The capture mask is the set of pieces that must be captured to resolve the check.
And the king moves BitBoard shows the squares the king can move to, accounting for
the opposing player's sight.

[1]: https://peterellisjones.com/posts/generating-legal-chess-moves-efficiently/
2025-07-12 20:26:41 -07:00
..
src [board] First pass at computing checks 2025-07-12 20:26:41 -07:00
Cargo.toml [board, position] Implement Zobrist hashing 2025-06-05 08:22:34 -07:00