;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Problem Set Code ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; This file defines things that are specifically needed by students ;;; to solve the problem set. ;;; This is required to make the code work, but will be replaced by ;;; the solution to the priority-sort question in the problem set. (define (priority-sort elemlist key-value) elemlist) (define (include-knapsack) (make :name "REI Backpack" :nick '(backpack) :location loc:upsonlab :description (echos "This is a student's backpack, well weathered by the" "wonderful Ithaca weather. It looks like it's great" "for carrying things.")) (make :name "Cornell Bookbag" :nick '(bookbag) :location loc:extensions :description (echos "This is a relatively new book bag. It doesn't look" "like it's been used very much yet.")) ;; Return this so student's can't get a hold of the object (void)) (define (include-money) (for-each (lambda (x) (when (zero? (random 3)) (make :name "1 Dollar" :nick '(dollar) :location x :description (echos "It's green, it's got George on one" "side. What else could it be... it's" "money.")))) *location*)) (define (new-include-money) (for-each (lambda (x) (when (zero? (random 3)) (make :location x :description (echos "It's green, it's got George on one" "side. What else could it be... it's" "money.")))) *location*))