spiral by nn

x,l,i;main(n,y,u,j){n=getchar()&7;for(y=u=n-1;n--;x=i++%2?++l:--u)for(j=n-~n;j--;i%2?x>l?x--:y<u&&y++:x<u?x++:y>l&&y--)printf("%d%d ",x,y);}

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

download

return to the top page