Tower of Hanoi by nn

o='\n'
h={n,a,b,c->n--&&[h(n,a,c,b),print(a),o+=c,h(n,b,a,c)]}
h(System.in.read()%8,'A','B','C')
print o

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

download

return to the top page