Hilbert Curve FIXED by tromp

f(x,y,m){return(y=m-abs(m-y))-m&&m-x?f(x<m?y:x-m,x<m?x:y,m/2):x-m-1&&y-1;}main(l,n,y,x){for(x=y=n=1<<(getchar()-47);y;)putchar(!--x?x=n,y-=2,10:"_ |"[l=f(x,y-1+x%2,n)?l!=f(x-1,y-1,n):x%2*2]);}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page