I go through SPEL casting in Lisp , and this is the proposed solution for handling collecting objects:
(define *location* 'living-room)
(define *object-locations*
'((whiskey-bottle living-room)
(bucket living-room)
(chain garden)
(frog garden)))
(define (pickup-object object)
(cond [(is-at? object *location* *object-locations*)
(push! (list object 'body) *object-locations*)
(string-append "You're now carrying the " (symbol->string object) ".")]
[else "There no such object in here."]))
Am I the only one who considers this ineffective? As far as I understand, the function push! consadds a new pairto *object-locations*every time a player takes an object. Although this may not be a serious problem in such a small game, as if you could add the option to put items from inventory, the list *object-locations*could grow indefinitely ... Should you not pickup-objectreplace cdrof (whiskey-bottle living-room), for example, instead of adding another copy pair?
Lisp ... - , , , Lisp ?