diff --git a/Chess/nimfish/nimfishpkg/search.nim b/Chess/nimfish/nimfishpkg/search.nim index fab1526..28bb94e 100644 --- a/Chess/nimfish/nimfishpkg/search.nim +++ b/Chess/nimfish/nimfishpkg/search.nim @@ -52,7 +52,6 @@ proc newSearchManager*(board: Chessboard, transpositions: TTable): SearchManager result.transpositionTable = transpositions - proc isSearching*(self: SearchManager): bool = ## Returns whether a search for the best ## move is in progress @@ -222,19 +221,19 @@ proc search(self: SearchManager, depth, ply: int, alpha, beta: Score): Score {.d # one because then we wouldn't have a move to return. # In practice this should not be a problem return - # when defined(useTT): - # if ply > 0: - # let query = self.transpositionTable.get(self.board.position.zobristKey, depth.uint8) - # if query.success: - # case query.entry.flag: - # of Exact: - # return query.entry.score - # of LowerBound: - # if query.entry.score >= beta: - # return query.entry.score - # of UpperBound: - # if query.entry.score <= alpha: - # return query.entry.score + when defined(useTT): + if ply > 0: + let query = self.transpositionTable.get(self.board.position.zobristKey, depth.uint8) + if query.success: + case query.entry.flag: + of Exact: + return query.entry.score + of LowerBound: + if query.entry.score >= beta: + return query.entry.score + of UpperBound: + if query.entry.score <= alpha: + return query.entry.score if self.board.drawnByRepetition(): return Score(0) if depth == 0: