game.scmwhich loads all the others in. So, the first thing you should do is to copy the whole collection of files and modify
game.scmso that it loads in your copy of the other files, rather than the original copies. That way you will always be able to load your whole set of files in just by loading in your
game.scm. If you add any additional files (for example, for newly added classes), you should extend your
game.scmto load in the new files as well.
To make a copy of all the files, the simplest approach would be to use the shell to copy the whole directory containing the files. If you in a shell window type
cp -r ~max/MC28/gack .(note that this command ends with a space and then a period), you will get a subdirectory called gack containing all the files. Ask for help with this if you need it. You can then open up the
game.scmfile in this directory and edit it to contain the full pathname of the directory, as the place to load the remaining files from.
game.scm file contains the following:
;; This file loads in all the other files that are part of the game, ;; Adventures in the Imaginary Land of Gack. ;; ;; The order in which the files are loaded in is important, since ;; for example a class's superclass needs to be defined before the ;; class is. ;; As a convenience, the load-in procedure does a load from the ;; correct directory; change this when you copy the files: (define load-in (lambda (filename) (load (string-append "/Net/solen/u8/Faculty/em/max/MC28/gack/" filename ".scm")))) ;; First comes the underlying object-oriented programming system (load "/mcs-server/Public/ConcAbs/oops") ;; Now the various classes; they are laid out below to show the ;; subclassing hierarchy. For example, a witch is a kind of auto-person ;; (i.e., automatic person), which is a kind of person, which is a kind ;; of named object. (load-in "named-object") (load-in "person") (load-in "auto-person") (load-in "witch") (load-in "wizard") (load-in "place") (load-in "thing") (load-in "scroll") (load-in "registry") ;; The next file contains some procedures used by various classes (load-in "utilities") ;; The gack file creates the specific people/places/things that ;; constitute the Land of Gack (load-in "gack") ;; The interface file provides the play procedure which can be ;; invoked as a normal user's interface to the game, so that ;; you can say (go north) instead of (person/go player 'north). (load-in "interface")
When you make changes, it will be least confusing if you save the
changes out and then re-load
game.scm, thereby getting a
fresh copy of the whole game. That way you won't encounter weird
problems like having two persons both called Max (one is bad enough!)
or having two different person classes, one old and one new.
Once you have copies of the files made and loaded in, you are to do exercises 14.33, 14.34, and 14.35, on pages 593 to 595.