Add magic bitboard generation
This commit is contained in:
parent
3410ba518e
commit
d268db38c1
4 changed files with 75 additions and 3 deletions
|
|
@ -14,7 +14,6 @@ pub struct Magic {
|
|||
|
||||
impl Magic {
|
||||
/// Compute the index into the magics database for this set of `blockers`.
|
||||
#[allow(unused)] // FIXME: remove once used
|
||||
pub fn get_index(&self, blockers: Bitboard) -> usize {
|
||||
let relevant_occupancy = (blockers & self.mask).0;
|
||||
let base_index = ((relevant_occupancy.wrapping_mul(self.magic)) >> self.shift) as usize;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue