comment { The Towers Of Hanoi Rebol Copyright (C) Amit Singh 2003. All Rights Reserved. http://hanoi.kernelthread.com Last tested under Rebol 042. http://www.rebol.com Usage: hanoi n } REBOL [ Title: "Hanoi" Date: 21-Mar-2003 Author: "Amit Singh" ] movedisk: func [f t] [ prin f prin " --> " print t ] H: func [n f u t] [ either equal? n 1 [ movedisk f t ][ H do [n - 1] f t u movedisk f t H do [n - 1] u f t ] ] hanoi: func [n] [ either lesser? n 1 [ print "usage: hanoi n, where n > 0" ][ H n 1 2 3 ] ]