aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-01-26 16:33:06 +0300
committereug-vs <eugene@eug-vs.xyz>2023-01-26 16:33:06 +0300
commit7755ec638a1fbef2bb87f7cf0378e01dc650c17c (patch)
tree30e184aadfb4567add73377d5bcdd3908be9b958
parent79c2ddb687267816299d5c6f7a7551cf59bdf6b1 (diff)
downloadchessnost-7755ec638a1fbef2bb87f7cf0378e01dc650c17c.tar.gz
feat: include All-nodes in transposition table
-rw-r--r--src/board/engine.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/board/engine.rs b/src/board/engine.rs
index 821e65a..8bd409b 100644
--- a/src/board/engine.rs
+++ b/src/board/engine.rs
@@ -181,6 +181,14 @@ impl Board {
node_type: NodeType::PV,
score,
});
+ } else {
+ self.transposition_table[(self.hash % TTABLE_SIZE) as usize] = Some(TranspositionTableItem {
+ hash: self.hash,
+ best_move: mov,
+ depth: depth_left, // TODO: should be actual depth searched
+ node_type: NodeType::All,
+ score,
+ });
}
} else {
self.unmake_move(mov, captured_piece, ep_target_before, castling_rights_before, hash_before);