; Solves the problem of the towers of Hanoi. ; Alejandro Luque, 1999 ; You may change this function to make it do whatever you want. (defun move_disk (from to) (msg "Move " from " to " to t) ) ; The actual function that solves the problem. (defun real_hanoi (n from to aux) (cond ((equal n 1) (move_disk from to)) (t (prog nil (real_hanoi (sub1 n) from aux to) (move_disk from to) (real_hanoi (sub1 n) aux to from) ) ) ) ) ; The function you invoke. (defun hanoi (n) (real_hanoi n 'a 'b 'c)) (msg "Type (hanoi n) to solve the Hanoi towers problem of order n" t)