Answer to Exercise 26

| ANSWER TO EXERCISE 26
    Object -> tricorder "tricorder"
      with name "tricorder",
           grammar [; return 'tc,'; ],
           orders
           [;  Examine: if (noun==player) "~You radiate life signs.~";
                   print "~", (The) noun, " radiates ";
                   if (noun hasnt animate) print "no ";
                  "life signs.~";
               default: "The tricorder bleeps.";
           ],
           life
           [;  Ask, Answer, Tell: "The tricorder is too simple.";
           ],
      has  talkable;
    ...
    Verb "tc,"    * noun      -> Examine;

Back to the exercise in section 16

Mechanically translated to HTML from third edition as revised 16 May 1997. Copyright © Graham Nelson 1993, 1994, 1995, 1996, 1997: all rights reserved.