Tower of Hanoi by notogawa

main=readLn>>=(f[]!!)
f x=putStr["ABC\n"!!a|a<-reverse x++3:2#x]:f(1#x++0:0#x)
n#x=[mod(n-m)3|m<-x]

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

download

return to the top page