(self)
Checks if the game is over due to checkmate, stalemate or insufficient
        mating material.
Checks if the game is over due to checkmate, stalemate or insufficient
        mating material.
Checks if the game is over due to checkmate stalemate or insufficient mating material .
def is_game_over(self):
        """
        Checks if the game is over due to checkmate, stalemate or insufficient
        mating material.
        """
        if self.is_insufficient_material():
            return True

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