;;; ;;; CS 200 ;;; Problem Set 6 ;;; ;;; ps6.ss ;;; ;;; Loads all the necessary files. ;;; Put your new code in here. ;;; (require-library "trace.ss") (load "listprocs.ss") (load "objects.ss") (load "adventure.ss") ;;; ;;; Set up the world every time we load ;;; (you may want to comment this out when you are debugging) ;;; (set-up-charlottansville) ;;; ;;; Question 4: ;;; ;;; You shouldn't modify make-lecturer (define (make-lecturer name) (let ((super (make-object name))) (lambda (message) (if (eq? message 'lecture) (lambda (self stuff) (ask self 'say stuff) (ask self 'say (list "you should be taking notes"))) (get-method super message))))) ;;; ;;; The beginning of an ever-expanding game script ;;; (define (play-game-first) (set-up-charlottansville) ;;; Put some people in our world (install-object Evan-Davis Cabal-Hall) (install-object Jeffus-Thomasson Cdrs-Hill) (install-object Officer-Krispy Green) ;;; Start playing (play-interactively-as Jeffus-Thomasson) ) ;;; ;;; This version of play game depends on you defining make-student and make-police-officer first: ;;; (define (play-game) (let ((aph (make-student 'alyssa-p-hacker)) (ben (make-student 'ben-bitdiddle)) (krumpke (make-police-officer 'officer-krumpke))) (set-up-charlottansville) (install-object aph green) (ask ben 'make-restless 3) (install-object ben cdrs-hill) (ask krumpke 'make-restless 2) (install-object krumpke bart-statue) ;;; Start playing (play-interactively-as aph) ) )