[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:
parent
a2f88f0fde
commit
1da827a3bb
3 changed files with 91 additions and 23 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue