diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-01-29 03:55:40 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-01-29 03:55:40 +0300 |
commit | 6b322dd8ea6e5a636a93be8a643f4c17abe43e90 (patch) | |
tree | b750bc3e671aef092d52f6e24e94a048ec594b9a /src/board/mod.rs | |
parent | 482cea1ebd9a43963fe0160fd081c97367534b7a (diff) | |
download | chessnost-6b322dd8ea6e5a636a93be8a643f4c17abe43e90.tar.gz |
feat: account for queen mobility but scaled down
Diffstat (limited to 'src/board/mod.rs')
-rw-r--r-- | src/board/mod.rs | 6 |
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), } |