VeloCT_Base / src /bitboard.rs
Taperx's picture
Deploy Base model with clean official lichess-bot folder
3014f14
Raw
History Blame Contribute Delete
408 Bytes
pub type Bitboard = u64;
pub const EMPTY: Bitboard = 0;
pub const FILE_A: Bitboard = 0x0101010101010101;
pub const FILE_H: Bitboard = 0x8080808080808080;
#[inline(always)]
pub fn pop_lsb(bb: &mut Bitboard) -> u8 {
let lsb = bb.trailing_zeros() as u8;
*bb &= *bb - 1;
lsb
}
#[inline(always)]
pub fn get_bit(bb: Bitboard, sq: crate::types::Square) -> bool {
(bb & (1 << (sq as u8))) != 0
}