Magic square by nn

for(n=readline(i=j=o='');j||i++<(j=n);)o+=/...$/('  '+((i+2*--j)%n*n+(i+j+(n>>1))%n+1))+(j?' ':'\n')
print(o)

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

download

return to the top page