wave line by moriA

r=reverse
main=do(a:s)<-getLine;mapM putStrLn[b:t|n<-r[0..99],b:t<-[r$g$r$map(n#)$scanl f(9,a)s]]
m#(n,c)|m/=n=' '|1>0=c
f(n,a)b=(n+min(length[a..b]-1)1,b)
g(' ':s)=g s;g s=s

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

download

return to the top page