Magic square by Carlos Gutierrez

scale=!n=read()
for(p=n/2+1;i++<q=n^2;){s[o=p]=i
if(p+=2*n>q)p-=q
if(!p++%n)p-=n
if(s[p])p=o+n}
for(;v=s[++j];){if(v<A)" "
if(v<100)" "
print v
if(j%n)" "else"
"}

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

download

return to the top page