\\沿着方形螺旋向前移动移动(z)={my(w=最大值(abs(实数(z)),abs(imag(z);如果(imag(z)==-w,z+1,实(z)==-w,z-I,图像(z)==+w,z-1,z+I);}\\Z->N+tr(v)=如果(v>=0,1+2*v,-2*v)\\遮罩vv=[0]小时=[0]dd=[0]aa=[0]需要=矢量(5000)u=1{打印(“0 0”);z=0;对于(n=0,oo,v=tr(实数(z));h=tr(imag(z));d=tr(实(z)-imag(z));a=tr(实数(z)+imag(z));而(#vv<v,vv=concat(vv,vector(#vv)));而(#hh<h,hh=concat(hh,矢量(#hh));而(#dd<d,dd=concat(dd,向量(#dd));而(#aa<a,aa=concat(aa,向量(#aa));x=比特(比特(vv[v],hh[h]),比特(dd[d],aa[a]);w=估价(x+1,2);vv[v]+=2^w;hh[h]+=2^w;dd[d]+=2^w;aa[a]+=2^w;如果(imag(z)==0&w>0&w<=需要,想要[w]=abs(z);while(想要[u],打印(u“”想要[u]);如果需要(u++>#,断裂(2););););z=移动(z););}退出