From 41389a25e6e2aac395810029cce070cddec6ae86 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 1 Feb 2023 01:38:13 +0300 Subject: fix: assign negative values for E2/E7 king squares --- src/board/engine.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/board/engine.rs b/src/board/engine.rs index 835a9b6..10fb604 100644 --- a/src/board/engine.rs +++ b/src/board/engine.rs @@ -84,7 +84,7 @@ const KING_BONUS: [f32; 64] = [ -0.30, -0.40, -0.40, -0.50, -0.50, -0.40, -0.40, -0.30, -0.20, -0.30, -0.30, -0.40, -0.40, -0.30, -0.30, -0.20, -0.10, -0.20, -0.20, -0.20, -0.20, -0.20, -0.20, -0.10, - 0.20, 0.20, 0.00, 0.00, 0.00, 0.00, 0.20, 0.20, + 0.20, 0.20, 0.00, -0.10, -0.10, 0.00, 0.20, 0.20, 0.20, 0.10, 0.30, -0.20, 0.00, 0.10, 0.30, 0.20 ]; @@ -671,11 +671,13 @@ mod tests { assert!(KING_BONUS[Square::G1.mirror() as usize] > 0.0); assert!(KING_BONUS[Square::C1.mirror() as usize] > 0.0); assert!(KING_BONUS[Square::D1.mirror() as usize] < 0.0); + assert!(KING_BONUS[Square::E2.mirror() as usize] < 0.0); assert_eq!(KING_BONUS[Square::E8 as usize], 0.0); assert!(KING_BONUS[Square::G8 as usize] > 0.0); assert!(KING_BONUS[Square::C8 as usize] > 0.0); assert!(KING_BONUS[Square::D8 as usize] < 0.0); + assert!(KING_BONUS[Square::E2 as usize] < 0.0); } mod evaluation { -- cgit v1.2.3