Zigzag by tanakh

main=interact f
f(s:c)=unlines[[c!!max(1-mod(j+i)m*mod(j-i)m)0|m<-[2*n],j<-[0..m*n+i]]|n<-[read[s]-1],i<-[0..n]]

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

download

return to the top page