[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. 👀
This commit is contained in:
Eryn Wells 2023-12-23 23:04:18 -07:00
parent a2f88f0fde
commit 1da827a3bb
3 changed files with 91 additions and 23 deletions

View file

@ -25,7 +25,7 @@ impl Square {
Ok(Square::from_index_unsafe(index))
}
fn from_index_unsafe(index: u8) -> Square {
pub(crate) fn from_index_unsafe(index: u8) -> Square {
Square {
rank: index / 8,
file: index % 8,