User blog:QuasarBooster/Python code for P進大好きbot's latest function

This one's gonna be a doozy. I'll be blunt: I don't understand how this thing works, but it blows my mind. All I did was translate each instruction verbatim into Python and confirmed that it matched the outputs he gave. It gives you 0 when you give it 1, it gives you 9 when you give it 12, it gives you a googol when you give it 100, and it crashes your computer when you give it 11000, etc. I then removed all of the variables that were used only once (there were a lot of those). That's about everything I wanted to say. def 萃(x): d=lambda n:0 if n%10 else 1+d(n//10) n0=d(x) a0=x//10**n0 b0=len(str(a0))-1 c0=a0//10**b0 d0=a0-c0*10**b0 if d0<1:return (n0>0)*10**x if d0<10: n1=d(b0) a1=b0//10**n1 A=萃(a1) if c0==9: if A<1: if 萃(1+10*n1)<1:return 10**((n0>1)*x) if 萃(1+10*n1)<2: if n0<2:return [10**x,9][n0<1] else: z=萃(a0*10**n0//10) return (1+9*10**(z//10**d(z)*10**(萃(10+100*n1)//10)))*10**z else: if n0<1:return 萃(1+10*n1) else: y=萃(10**n0*(1+10*n1)) return (1+9*10**(10**(y//10**(d(y)+1))))*10**y if A<2: if 萃(1+10*n1)<1: if n0<1:return 9 if n0<2:return (1+9*10**萃(a1*10))*10**x else: y=萃(a0*10**n0//10) d1=y//10**d(y) z=萃(a0*10) return (d1+z//10**(d(z)+1)*10**len(str(d1)))*10**y if 萃(1+10*n1)<2: if n0<1:return 9 if n0<2:return (1+99*10**(萃(a1*10)*10**n1))*10**x else: y=萃(a0*10**n0//10) return (1+9*10**(y//10**d(y)*10**(萃(10+100*n1)//10)))*10**y else: if n0<1:return 萃(1+10*n1) else: y=萃(10**n0*(1+10*n1)) return (1+9*10**((1+99*10**(萃(a1*10)*10**n1))*10**(y//10**(d(y)+1))))*10**y else: if n0<1:return A       else: y=萃(a1*10**n0) return (1+9*10**(y//10**d(y)*10**n1))*10**y else: if A<1: if n1<1: if n0<2:return [10**x,9][n0<1] else: y=萃(a0*10**n0//10) return (1+9*10**(10**(y//10**d(y))))*10**y return [1+10*n0,9+10*n1][n0<1] if A<2: if n0<1:return 9 if n0<2:return (1+91*10**(萃(a1*10)*10**n1))*10**x else: y=萃(a0*10**n0//10) return (1+9*10**(10**(y//10**d(y))))*10**y if A<10: if n0<1:return 9 else: y=萃(a1*10**n0) return (1+10**(y//10**d(y)*10**n1))*10**y else: n2=A//10 if n2<=n1: if n0<1:return A         else: y=萃(a1*10**n0) return (1+10**(y//10**d(y)*10**n1))*10**y else: if n0<1:return 9 if n0<2: y=萃(a1*10) return (1+10**(y//10**d(y)*10**n1))*10**y else: y=萃(a0*10**n0//10) b1=len(str(y//10**d(y)))-1 z=萃(a1*10**(b1//10**d(b1))) return (1+10**(z//10**d(z)*10**n1))*10**y else: b1=len(str(d0))-1 d1=1+c0*10**(b0-b1) if d1==91:return d0**(n0>0)*10**(x*(n0>1)) else: y=萃(d1*10**n0) if n0*y<1:return y     return (d0+y//10**(d(y)+1)*10**(b1+1))*10**y
 * 1) condensed, ~1765 chr, 94 ln