1
0
Fork 0

vocabulary update

This commit is contained in:
Paul-Nicolas Madelaine 2025-11-05 23:37:02 +01:00
parent d17fae4fce
commit 5d1fa02280
3 changed files with 133 additions and 84 deletions

View file

@ -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,