;; The list '(0 1 2 3 4 5 6 7 b) represents the following 8 puzzle: ;; ;; +---+---+---+ ;; | 0 | 1 | 2 | ;; +---+---+---+ ;; | 3 | 4 | 5 | ;; +---+---+---+ ;; | 6 | 7 | | ;; +---+---+---+ ;; ;; Thus, the 'b' in the list represents the blank tile. (defun test () (let ( start-state goal-state answer ) (setf start-state '(0 1 2 3 4 5 6 b 7)) (setf goal-state '(0 1 2 3 4 5 6 7 b)) (setf answer (solve start-state goal-state)) (print-result answer start-state goal-state) ) ) (defun print-result (answer start goal) (format t "Start state: ~a~%" start) (format t "Goal state: ~a~%" goal) (format t "Depth of nearest solution: ~a~%" answer) )