No description
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/ |
||
---|---|---|
bitboard | ||
board | ||
chessfriend | ||
core | ||
doc | ||
explorer | ||
moves | ||
perft | ||
position | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
ChessFriend.code-workspace | ||
Makefile | ||
rustfmt.toml |