Leapfrogging by oerjan

m@main=do l<-getLine;putStrLn$0?[i|c<-['1'..'9'],(i,d)<-zip[1..]l,c==d];m
m?(n:r)|s<-sum[1|n<=m]="><"!!s:show(abs$m-n+s)++(n-s)?r
_?_=""

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

download

return to the top page