我在 lisp 中的代码如下:
(defun solve-hanoi(from) (hanoi (length from) from '() '()))
(defun hanoi(height from to aux) (when (>= height 1)
(hanoi (- height 1) from aux to)
(format t "~%Move ~a from ~a to ~a" (nth 0 from) from to)
(push (pop from) to)
(hanoi (- height 1) aux to from)))
我是 lisp 的新手,不知道我做错了什么。对此的帮助将不胜感激,因为我已经在这几个小时了。
谢谢。