Commit graph

4 commits

Author SHA1 Message Date
2394afc210 [board] Implement a TrailingBitScanner
This bit scanner iterates populated bits in a BitBoard from the trailing (least-significant) end.

Rename BitScanner → LeadingBitScanner.
Factor implementation of these two into a macro.
Clean up iterator returned by BitBoard::occupied_squares
Implement BitBoard::occupied_squares_trailing
2024-01-06 19:46:09 -08:00
adc2f76e00 [board] Change the type of BitScanner.shift form u32 to usize 2023-12-31 09:27:16 -08:00
e23c20486e [board] Build error and warning fixes
- Remove unused import from bit_scanner.rs
- Rename PieceShape → Shape in the Position tests
2023-12-26 09:16:55 -07:00
1da827a3bb [board] Implement a BitScanner on u64
This struct implements an Iterator that returns the positions of the 1 bits in the u64.
BitBoard takes this iterator and maps it into Squares in the pieces() method.

This is laying the groundwork for an iterator over the pieces in a Position. 👀
2023-12-23 23:04:18 -07:00