Hanoi in Emacs Lisp

Just for fun.

(defun hanoi (ndisks source dest)
  (cond ((= ndisks 1)
	 (format "%d -> %d, " source dest))
	(t
	 (let ((rest-pole (rest-pole source dest))
	       (top-disks (- ndisks 1)))
	   (concat (hanoi top-disks source rest-pole)
		   (format "%d -> %d, " source dest)
		   (hanoi top-disks rest-pole dest))))))

(defun rest-pole (source dest)
  (- 6 source dest))

(hanoi 5 1 3)