We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Board.gives_checkmate()
1 parent 4d9b3bf commit f8575f9Copy full SHA for f8575f9
chess/__init__.py
@@ -1980,6 +1980,17 @@ def gives_check(self, move: Move) -> bool:
1980
finally:
1981
self.pop()
1982
1983
+ def gives_checkmate(self, move: Move) -> bool:
1984
+ """
1985
+ Probes if the given move would put the opponent in checkmate. The move
1986
+ must be at least pseudo-legal.
1987
1988
+ self.push(move)
1989
+ try:
1990
+ return self.is_checkmate()
1991
+ finally:
1992
+ self.pop()
1993
+
1994
def is_into_check(self, move: Move) -> bool:
1995
king = self.king(self.turn)
1996
if king is None:
0 commit comments