(self)
Checks if the current position is a stalemate.
Checks if the current position is a stalemate.
Checks if the current position is a stalemate .
def is_stalemate(self):
        """Checks if the current position is a stalemate."""
        if self.is_check():
            return False

        try:
            next(self.generate_legal_moves().__iter__())
            return False
        except StopIteration:
            return True
def is_stalemate ( self ) : if self . is_check ( ) : return False try : next ( self . generate_legal_moves ( ) . __iter__ ( ) ) return False except StopIteration : return True