slope lines by notogawa

import List
main=interact$unlines.reverse.g.lines
g x=zipWith h[1-l x..]$transpose$f x
f[x]=[x]
f(a:x)=[t,s]#(t++q):s:s:s:f x where s=f x#q;t=[x]#q++a
q=' ':q
h n|n<0=drop(-2*n)|0<1=(take(2*n)q++)
a#b=take(maximum$map l a)b
l=length

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

download

return to the top page