1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use crate::bitboard::Bitboard;
use crate::bitboard_consts;
use crate::types::{Color, File};
#[inline]
pub fn advance_forward(c: Color, b: Bitboard) -> Bitboard {
match c {
Color::White => b.shr(8),
Color::Black => b.shl(8),
}
}
#[inline]
pub fn advance_left(c: Color, b: Bitboard) -> Bitboard {
let b = b & !bitboard_consts::file(File::A);
match c {
Color::White => b.shr(9),
Color::Black => b.shl(7),
}
}
#[inline]
pub fn advance_right(c: Color, b: Bitboard) -> Bitboard {
let b = b & !bitboard_consts::file(File::H);
match c {
Color::White => b.shr(7),
Color::Black => b.shl(9),
}
}