Magic square by notogawa

main=do n<-readLn;mapM putStrLn[unwords[r$take 3$r$"  "++show(1+n*mod(y-2*x)n+mod(y-x+div n 2)n)|x<-[1..n]]|y<-[1..n]]
r=reverse

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

download

return to the top page