Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
def h(s): t=[s[0][0]];x=y=g=0;b="A" for j in range(len(bin(len(s)))-3):b=b.translate({65:"-BF+AFA+FB-",66:"+AF-BFB-FA+"}) for c in b:g+=(c<"-")-(c=="-");a=c=="F";x;a=c>"B";x,y=[[x,y],[[x+1-g%4,y],[x,y+g%4-2]][g%2]][a];t+=[s[x][y]]*a return t
Python 3, 327289275271239235 bytes
def h(s): t=[s[0][0]];x=y=g=0;b="A" for j in range(len(bin(len(s)))-3):b=b.translate({65:"-BF+AFA+FB-",66:"+AF-BFB-FA+"}) for c in b:g+=(c<"-")-(c=="-");a=c=="F";x,y=[[x,y],[[x+1-g%4,y],[x,y+g%4-2]][g%2]][a];t+=[s[x][y]]*a return t
Python 3, 327289275271239234 bytes
def h(s): t=[s[0][0]];x=y=g=0;b="A" for j in range(len(bin(len(s)))-3):b=b.translate({65:"-BF+AFA+FB-",66:"+AF-BFB-FA+"}) for c in b:g+=(c<"-")-(c=="-");a=c>"B";x,y=[[x,y],[[x+1-g%4,y],[x,y+g%4-2]][g%2]][a];t+=[s[x][y]]*a return t
def h(s): t=[s[0][0]];x=y=g=0;b="A" for j in range(len(bin(len(s)))-3):b=b.translate({65:"-BF+AFA+FB-",66:"+AF-BFB-FA+"}) for c in b:g+=(c=="+"c<"-")-(c=="-");a=c=="F";x,y=[[x+1y=[[x,y],[[x+1-g%4,y],[x,y+g%4-2]][g%2]if a else(x,y);t+=[s[x][y]]*a2]][g%2]][a];t+=[s[x][y]]*a return t
Python 3, 327289275271239 bytes
def h(s): t=[s[0][0]];x=y=g=0;b="A" for j in range(len(bin(len(s)))-3):b=b.translate({65:"-BF+AFA+FB-",66:"+AF-BFB-FA+"}) for c in b:g+=(c=="+")-(c=="-");a=c=="F";x,y=[[x+1-g%4,y],[x,y+g%4-2]][g%2]if a else(x,y);t+=[s[x][y]]*a return t
Python 3, 327289275271239 235 bytes
def h(s): t=[s[0][0]];x=y=g=0;b="A" for j in range(len(bin(len(s)))-3):b=b.translate({65:"-BF+AFA+FB-",66:"+AF-BFB-FA+"}) for c in b:g+=(c<"-")-(c=="-");a=c=="F";x,y=[[x,y],[[x+1-g%4,y],[x,y+g%4-2]][g%2]][a];t+=[s[x][y]]*a return t