(self, square)
Gets the piece at the given square.
Gets the piece at the given square.
Gets the piece at the given square .
def piece_at(self, square):
        """Gets the piece at the given square."""
        mask = BB_SQUARES[square]
        color = int(bool(self.occupied_co[BLACK] & mask))

        if mask & self.pawns:
            return Piece(PAWN, color)
        elif mask & self.knights:
            return Piece(KNIGHT, color)
        elif mask & self.bishops:
            return Piece(BISHOP, color)
        elif mask & self.rooks:
            return Piece(ROOK, color)
        elif mask & self.queens:
            return Piece(QUEEN, color)
        elif mask & self.kings:
            return Piece(KING, color)
def piece_at ( self , square ) : mask = BB_SQUARES [ square ] color = int ( bool ( self . occupied_co [ BLACK ] & mask ) ) if mask & self . pawns : return Piece ( PAWN , color ) elif mask & self . knights : return Piece ( KNIGHT , color ) elif mask & self . bishops : return Piece ( BISHOP , color ) elif mask & self . rooks : return Piece ( ROOK , color ) elif mask & self . queens : return Piece ( QUEEN , color ) elif mask & self . kings : return Piece ( KING , color )