Uncomment tt cutoff code
This commit is contained in:
parent
316a63303c
commit
9a41ba50ff
|
@ -52,7 +52,6 @@ proc newSearchManager*(board: Chessboard, transpositions: TTable): SearchManager
|
||||||
result.transpositionTable = transpositions
|
result.transpositionTable = transpositions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
proc isSearching*(self: SearchManager): bool =
|
proc isSearching*(self: SearchManager): bool =
|
||||||
## Returns whether a search for the best
|
## Returns whether a search for the best
|
||||||
## move is in progress
|
## 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.
|
# one because then we wouldn't have a move to return.
|
||||||
# In practice this should not be a problem
|
# In practice this should not be a problem
|
||||||
return
|
return
|
||||||
# when defined(useTT):
|
when defined(useTT):
|
||||||
# if ply > 0:
|
if ply > 0:
|
||||||
# let query = self.transpositionTable.get(self.board.position.zobristKey, depth.uint8)
|
let query = self.transpositionTable.get(self.board.position.zobristKey, depth.uint8)
|
||||||
# if query.success:
|
if query.success:
|
||||||
# case query.entry.flag:
|
case query.entry.flag:
|
||||||
# of Exact:
|
of Exact:
|
||||||
# return query.entry.score
|
return query.entry.score
|
||||||
# of LowerBound:
|
of LowerBound:
|
||||||
# if query.entry.score >= beta:
|
if query.entry.score >= beta:
|
||||||
# return query.entry.score
|
return query.entry.score
|
||||||
# of UpperBound:
|
of UpperBound:
|
||||||
# if query.entry.score <= alpha:
|
if query.entry.score <= alpha:
|
||||||
# return query.entry.score
|
return query.entry.score
|
||||||
if self.board.drawnByRepetition():
|
if self.board.drawnByRepetition():
|
||||||
return Score(0)
|
return Score(0)
|
||||||
if depth == 0:
|
if depth == 0:
|
||||||
|
|
Loading…
Reference in New Issue