-- The Towers Of Hanoi -- AppleScript -- Copyright (C) 2003 Amit Singh. All Rights Reserved. -- http://hanoi.kernelthread.com -- -- Tested on Mac OS X 10.2.4 -- on doHanoi(n, f, u, t) if n <= 1 then log f & " --> " & t else doHanoi(n - 1, f, t, u) log f & " --> " & t doHanoi(n - 1, u, f, t) end if end doHanoi on hanoi(n) if n < 0 or n > 10 then log "usage: hanoi(n) where 1 <= n <= 10" else doHanoi(n, 1, 2, 3) end if end hanoi hanoi(3)