simplify PosMap + BoardValueMap logic

This commit is contained in:
2025-02-26 23:58:52 -05:00
parent abee9447ab
commit 8719d31c38
2 changed files with 15 additions and 7 deletions

View File

@@ -20,7 +20,6 @@ impl BoardValueMap {
/// Weights from: https://repub.eur.nl/pub/7142/ei2005-47.pdf
pub fn new() -> Self {
let mut map = PosMap::new();
assert_eq!(
Board::BOARD_SIZE,
8,
@@ -37,11 +36,6 @@ impl BoardValueMap {
[-20, -50, -2, -2, -2, -2, -50, -20],
[100, -20, 10, 5, 5, 10, -20, 100],
];
for (i, j) in Board::all_positions() {
map.set(i, j, POSITION_VALUES[i as usize][j as usize])
}
Self(map)
Self(PosMap::from(POSITION_VALUES))
}
}