27 lines
797 B
Common Lisp
27 lines
797 B
Common Lisp
|
(let ((equipment '(armor (head
|
||
|
(dragon-helmet)
|
||
|
legs (empty)
|
||
|
arms (empty))
|
||
|
weapon (left
|
||
|
(wooden-shield)
|
||
|
right (empty))
|
||
|
ring (left
|
||
|
(empty)
|
||
|
right (empty)))))
|
||
|
(defun get-armor()
|
||
|
(getf equipment 'armor))
|
||
|
(defun get-helmet()
|
||
|
(getf (get-armor) 'head))
|
||
|
(defun get-legs()
|
||
|
(getf (get-armor) 'legs))
|
||
|
(defun get-arms()
|
||
|
(getf(get-armor) 'legs))
|
||
|
|
||
|
(defun change-helmet (helmet)
|
||
|
"Useage: (change-helmet 'god-helmet"
|
||
|
(setf (car (get-helmet)) helmet))
|
||
|
(defun change-legs (legs)
|
||
|
(setf (car (get-legs)) legs))
|
||
|
(defun change-arms (arms)
|
||
|
(setf (car (get-arms)) arms)))
|