Jump to content

Towers of Hanoi: Difference between revisions

No edit summary
Line 329:
(format t "Move from ~A to ~A.~%" from to)
(move (- n 1) via to from))))</lang>
 
=={{header|Emacs Lisp}}==
{{Trans|Common Lisp}}
<lang lisp>
(defun move (n from to via)
(cond ((= n 1)
(print (format "Move from %S to %S" from to)))
(t
(progn
(move (- n 1) from via to)
(print (format "Move from %S to %S" from to))
(move (- n 1) via to from)))))
</lang>
 
=={{header|D}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.