diff options
-rw-r--r-- | src/board/engine.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/board/engine.rs b/src/board/engine.rs index f2f6d10..95d7145 100644 --- a/src/board/engine.rs +++ b/src/board/engine.rs @@ -289,7 +289,18 @@ impl Board { principal_variation.push(transposition.mov); return (transposition.score, principal_variation); } - _ => {} // TODO: prune when out ouf bounds + NodeType::Cut => { + if transposition.score >= beta { + principal_variation.push(transposition.mov); + return (beta, principal_variation); + } + } + NodeType::All => { + if transposition.score <= alpha { + principal_variation.push(transposition.mov); + return (alpha, principal_variation); + } + } } } } @@ -365,7 +376,7 @@ impl Board { node_type: NodeType::PV, score, }); - } else { + } else if self.transposition().is_none() { self.transposition_table[(self.hash % TTABLE_SIZE) as usize] = Some(TranspositionTableItem { hash: self.hash, mov, |