vocabulary update
This commit is contained in:
parent
d17fae4fce
commit
5d1fa02280
3 changed files with 133 additions and 84 deletions
11
src/setup.rs
11
src/setup.rs
|
|
@ -92,7 +92,10 @@ impl Setup {
|
|||
(file < 8).then_some(())?;
|
||||
setup.set(
|
||||
unsafe {
|
||||
Square::from_coords(File::transmute(file), Rank::transmute(rank))
|
||||
Square::from_coords(
|
||||
File::new_unchecked(file),
|
||||
Rank::new_unchecked(rank),
|
||||
)
|
||||
},
|
||||
Some(Piece { role, color }),
|
||||
);
|
||||
|
|
@ -495,13 +498,13 @@ impl Setup {
|
|||
let n = n_b_k ^ b ^ k;
|
||||
let r = r_q_k ^ q ^ k;
|
||||
let p = p_b_q ^ b ^ q;
|
||||
ByColor::new(|color| {
|
||||
ByColor::with(|color| {
|
||||
let mask = match color {
|
||||
Color::White => w,
|
||||
Color::Black => !w,
|
||||
};
|
||||
ByRole::new(|kind| {
|
||||
mask & match kind {
|
||||
ByRole::with(|role| {
|
||||
mask & match role {
|
||||
Role::Pawn => p,
|
||||
Role::Knight => n,
|
||||
Role::Bishop => b,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue