(self, square)
Removes a piece from the given square if present.
Removes a piece from the given square if present.
Removes a piece from the given square if present .
def remove_piece_at(self, square):
        """Removes a piece from the given square if present."""
        mask = BB_SQUARES[square]

        if not self.occupied & mask:
            return

        self.pawns &= ~mask
        self.knights &= ~mask
        self.bishops &= ~mask
        self.rooks &= ~mask
        self.queens &= ~mask
        self.kings &= ~mask

        color = int(bool(self.occupied_co[BLACK] & mask))

        self.occupied ^= mask
        self.occupied_co[color] ^= mask
        self.occupied_l90 ^= BB_SQUARES[SQUARES_L90[square]]
        self.occupied_r45 ^= BB_SQUARES[SQUARES_R45[square]]
        self.occupied_l45 ^= BB_SQUARES[SQUARES_L45[square]]
def remove_piece_at ( self , square ) : mask = BB_SQUARES [ square ] if not self . occupied & mask : return self . pawns &= ~ mask self . knights &= ~ mask self . bishops &= ~ mask self . rooks &= ~ mask self . queens &= ~ mask self . kings &= ~ mask color = int ( bool ( self . occupied_co [ BLACK ] & mask ) ) self . occupied ^= mask self . occupied_co [ color ] ^= mask self . occupied_l90 ^= BB_SQUARES [ SQUARES_L90 [ square ] ] self . occupied_r45 ^= BB_SQUARES [ SQUARES_R45 [ square ] ] self . occupied_l45 ^= BB_SQUARES [ SQUARES_L45 [ square ] ]