Skip to content

Commit 41cbb11

Browse files
committed
1 parent cbd809f commit 41cbb11

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

chess/syzygy.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,12 +1738,14 @@ def probe_dtz_no_ep(self, board):
17381738
board.push(move)
17391739
try:
17401740
v = -self.probe_dtz(board)
1741+
1742+
if v > 0 and v + 1 < best:
1743+
if v == 1 and board.is_checkmate():
1744+
v = 0
1745+
best = v + 1
17411746
finally:
17421747
board.pop()
17431748

1744-
if v > 0 and v + 1 < best:
1745-
best = v + 1
1746-
17471749
return best
17481750
else:
17491751
best = -1

0 commit comments

Comments
 (0)