(self)
Checks for a draw due to insufficient mating material.
Checks for a draw due to insufficient mating material.
Checks for a draw due to insufficient mating material .
def is_insufficient_material(self):
        """Checks for a draw due to insufficient mating material."""
        # Enough material to mate.
        if self.pawns or self.rooks or self.queens:
            return False

        # A single knight or a single bishop.
        if sparse_pop_count(self.occupied) <= 3:
            return True

        # More than a single knight.
        if self.knights:
            return False

        # All bishops on the same color.
        if self.bishops & BB_DARK_SQUARES == 0:
            return True
        elif self.bishops & BB_LIGHT_SQUARES == 0:
            return True
        else:
            return False
def is_insufficient_material ( self ) : # Enough material to mate. if self . pawns or self . rooks or self . queens : return False # A single knight or a single bishop. if sparse_pop_count ( self . occupied ) <= 3 : return True # More than a single knight. if self . knights : return False # All bishops on the same color. if self . bishops & BB_DARK_SQUARES == 0 : return True elif self . bishops & BB_LIGHT_SQUARES == 0 : return True else : return False