Magic square by koyama41

main=interact$f.read
f n=unlines[unwords[p$show$mod(i-2*j)n*n+mod(i-j+n`div`2)n+1|j<-[1..n]]|i<-[1..n]]
p x@[_,_,_]=x
p x=p$' ':x

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

download

return to the top page