November 2010
Intermediate to advanced
504 pages
12h 45m
English
Next, let’s create a command to pick up objects in our world. To do so, we modify the variable *object-locations* that we’re using to track the location of objects:
(defun pickup (object)(cond ((member object
(objects-at *location* *objects* *object-locations*))
(push (list object 'body) *object-locations*) `(you are now carrying the ,object)) (t '(you cannot get that.))))
The pickup function uses the member function to see if ...