one program please can someone help me
Posted: Thu Mar 19, 2009 8:04 am
i ve got a problem with this program, is about a robot which can move one position right (MR) in a 4x4 table. movements left(ML) down(MD) or up(MU) are not allowed.The pr_move is the position that came from, move is the position tha we want to go right(MR).x is the row that is the row and y is the coloumn. it cant move diagonial. the code has a problem and it cant run. if someone can help me i would appreciate
(defun move_robot (move '('pr_move x y))
(cond ((eq move 'ML) ('NO_MOVE))
((eq move 'MU) ('NO_MOVE))
((eq move 'MD) ('NO_MOVE))
((eq move 'MR) (cond ((eq pr_move 'ML) (princ ('ML x (+ y 1))))
((eq pr_move 'MR) (princ ('MR x (+ y 1))))
((eq pr_move 'MU) (princ ('MU x (+ y 1))))
((eq pr_move 'MD) (princ ('MD x (+ y 1))))
)
)
)
)
(defun move_robot (move '('pr_move x y))
(cond ((eq move 'ML) ('NO_MOVE))
((eq move 'MU) ('NO_MOVE))
((eq move 'MD) ('NO_MOVE))
((eq move 'MR) (cond ((eq pr_move 'ML) (princ ('ML x (+ y 1))))
((eq pr_move 'MR) (princ ('MR x (+ y 1))))
((eq pr_move 'MU) (princ ('MU x (+ y 1))))
((eq pr_move 'MD) (princ ('MD x (+ y 1))))
)
)
)
)