;path taken by the Robot is indicated by numbers (1 2 3...) ; where 1 -> first step; 2 -> second step; 3 -> third step and so on ; Door is indicated by '=' ; Wall (Black field) is indicated by 'X' ; path without obstacles (white field) is indicated by '-' (require "add_wall.lsp") (require "print.lsp") (require "findpath.lsp") (require "smallest.lsp") (require "finddoor.lsp") (defun laby() ;set the size of the labyrinth (setq labyrinth (make-array '(10 10))) ;initialize array (dotimes (x 10) (dotimes (y 10) (setf (aref labyrinth x y) '-))) ;add wall to the Labyrinth (add_wall) (format t "~%") (print 'Initial_state) (print '--------------) (format t "~%") (print_lab labyrinth) (format t "~%") ;get the row and col number of the robot (>) position (dotimes (x 10) (dotimes (y 10) (cond ((EQ (aref labyrinth x y) '>) (progn (setq col y) (setq row x)))))) ;initialize cnt to 0 (setq cnt 0) ;find the path to the door (find_path row col cnt) (format t "~%") (format t "~%") ;print the final path taken by the Robot to the door (indicated by !) (print 'Final_state) (print '--------------) (format t "~%") (print_lab labyrinth) (format t "~%") )