aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-01-29 03:55:40 +0300
committereug-vs <eugene@eug-vs.xyz>2023-01-29 03:55:40 +0300
commit6b322dd8ea6e5a636a93be8a643f4c17abe43e90 (patch)
treeb750bc3e671aef092d52f6e24e94a048ec594b9a /src
parent482cea1ebd9a43963fe0160fd081c97367534b7a (diff)
downloadchessnost-6b322dd8ea6e5a636a93be8a643f4c17abe43e90.tar.gz
feat: account for queen mobility but scaled down
Diffstat (limited to 'src')
-rw-r--r--src/board/mod.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/board/mod.rs b/src/board/mod.rs
index 2b186d4..6df55ab 100644
--- a/src/board/mod.rs
+++ b/src/board/mod.rs
@@ -33,7 +33,6 @@ pub struct Board {
attacks: Attacks,
}
-
#[derive(Debug, Clone, Copy, PartialEq, Eq, num_enum::FromPrimitive)]
#[repr(usize)]
pub enum PieceType {
@@ -518,7 +517,10 @@ impl Board {
}
}
PieceType::Queen => {
- // We do not include queen moves in mobility!
+ for source in serialize_bitboard(*piece) {
+ // Scale down mobility because we don't want our queen to be rushing too much
+ mobility += pop_count(self.attacks.queen(self.occupancy, source) & (empty | opponent_occupancy)) as f32 / 3.0;
+ }
}
incorrect_type => panic!("Incorrect piece type: {:?}", incorrect_type),
}