Skip to content

Commit b0ce7cd

Browse files
fix syzygy (#1161)
1 parent 4067259 commit b0ce7cd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/engine_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ def dtz_scorer(tablebase: chess.syzygy.Tablebase, board: chess.Board) -> int | f
12061206
For a zeroing move (capture or pawn move), a DTZ of +/-0.5 is returned.
12071207
"""
12081208
dtz: int | float = -tablebase.probe_dtz(board)
1209-
dtz = dtz if board.halfmove_clock else math.copysign(.5, dtz)
1209+
dtz = dtz if board.halfmove_clock or not dtz else math.copysign(.5, dtz)
12101210
return dtz + (math.copysign(board.halfmove_clock, dtz) if dtz else 0)
12111211

12121212

0 commit comments

Comments
 (0)