(defun find_door(row col cnt) (setq found 0) ;Check if the dor is nearby ;This avoids following close to the door and not finding it (cond ((and (< (+ col 1) 10) (EQ (aref labyrinth row (+ col 1)) '=)) (setf (aref labyrinth row col) cnt) (setf (aref labyrinth row (+ col 1)) '!) (setq found 1)) ) (cond ((and (> (- col 1) -1) (EQ (aref labyrinth row (- col 1)) '=)) (setf (aref labyrinth row col) cnt) (setf (aref labyrinth row (- col 1)) '!) (setq found 1)) ) (cond ((and (< (+ row 1) 10) (EQ (aref labyrinth (+ row 1) col) '=)) (setf (aref labyrinth row col) cnt) (setf (aref labyrinth (+ row 1) col) '!) (setq found 1)) ) (cond ((and (< (- row 1) 10) (EQ (aref labyrinth (- row 1) col) '=)) (setf (aref labyrinth row col) cnt) (setf (aref labyrinth (- row 1) col) '!) (setq found 1)) ) )