aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-01-31 19:48:48 +0300
committereug-vs <eugene@eug-vs.xyz>2023-01-31 19:48:48 +0300
commitfd0d63aa8fafc6cb46699d75604c329427d158a9 (patch)
tree102b13ca3fada723511d7ea37070372ec5704e0b
parentc7272893c271258456d9556a6b59ea6ef1ab5225 (diff)
downloadchessnost-fd0d63aa8fafc6cb46699d75604c329427d158a9.tar.gz
fix: correclty index piece-square tables
-rw-r--r--src/board/engine.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/board/engine.rs b/src/board/engine.rs
index e27b004..8521082 100644
--- a/src/board/engine.rs
+++ b/src/board/engine.rs
@@ -168,8 +168,8 @@ impl Board {
material += serialize_bitboard(*bitboard).iter().fold(0., |acc, square| {
acc + piece_type.static_eval() + bonus_table[
match color {
- Color::White => *square as usize,
- Color::Black => square.mirror() as usize,
+ Color::White => square.mirror() as usize,
+ Color::Black => *square as usize,
}
]
});