This function works but I also need the condition that the path has to include the library.
(defun depth1 (queue finish)
(cond ((null queue) nil)
((equal finish (caar queue)) (print queue)
(reverse (car queue)))
(t (print queue)
(depth1 (append (expand (car queue)) (cdr queue)) finish))))
My attempt but didn't work:
(defun depth1 (queue finish)
(cond ((null queue) nil)
AND(((equal finish (caar queue))(member 'library queue)) (print queue)
(reverse (car queue)))
(t (print queue)
(depth1 (append (expand (car queue)) (cdr queue)) finish))))
Lisp function help
Forum rules
Please respect your teacher's guidelines. Homework is a learning tool. If we just post answers, we aren't actually helping. When you post questions, be sure to show what you have tried or what you don't understand.
Please respect your teacher's guidelines. Homework is a learning tool. If we just post answers, we aren't actually helping. When you post questions, be sure to show what you have tried or what you don't understand.