allocate mem(2^31); tr(v)=if (v>=0, 1+2*v, -2*v) big = 100000 s = [] S = [] seen(z)=my (x=tr(real(z)),y=tr(imag(z)));if (max(x,y)>big, setsearch(S,z), x>#s, 0, bittest(s[x],y)) see(z)=my (x=tr(real(z)),y=tr(imag(z)));if (max(x,y)>big, S=setunion(S,Set(z)); return, x>#s, s=concat(s,vector(x-#s))); s[x]=bitor(s[x],2^y) dz = [1+I, 2*I, I-1, -1-I, -2*I, 1-I] { dir = 1; mid points = [0]; new mid points = [0]; print ("0 0"); total = 0; for (n=1, M=2^13, print (n " " total += #mid points); if (n #new mid points, new mid points = concat(new mid points, vector(#new mid points)); ); new mid points[mm] = zz; ); ); ); ); mid points = Set(new mid points[1..mm]); dir *= I; ); ); } quit