~ubuntu-branches/ubuntu/gutsy/inform/gutsy

« back to all changes in this revision

Viewing changes to html/answers2/answer84.html

  • Committer: Bazaar Package Importer
  • Author(s): Mark Baker
  • Date: 2004-03-29 23:52:44 UTC
  • Revision ID: james.westby@ubuntu.com-20040329235244-fox1z1yv7d6vojoo
Tags: upstream-6.30
ImportĀ upstreamĀ versionĀ 6.30

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<HTML><HEAD><TITLE>Answer to Exercise 84</TITLE></HEAD>
 
2
<BODY BGCOLOR="#FFFFFF">
 
3
<TABLE><TR><TD Valign="top"><IMG SRC="../icons/exercise.gif" ALT="??"><TD bgcolor="#FAA89B"><B>ANSWER TO EXERCISE 84</B><TR><TD><TD>
 
4
<P>
 
5
 
 
6
In the <TT>Initialise</TT> routine, move <TT>newplay</TT> somewhere and
 
7
<TT>ChangePlayer</TT> to it, where:
 
8
<PRE>
 
9
Object newplay "yourself"
 
10
  with description "As good-looking as ever.", number 0,
 
11
       add_to_scope nose,
 
12
       capacity 5,
 
13
       before
 
14
       [;  Inv: if (nose has general) print "You're holding your nose.  ";
 
15
           Smell: if (nose has general)
 
16
                     "You can't smell a thing with your nose held.";
 
17
       ],
 
18
  has  concealed animate proper transparent;
 
19
 
 
20
Object nose "nose"
 
21
  with name "nose", article "your",
 
22
       before
 
23
       [; Take: if (self has general)
 
24
                   "You're already holding your nose.";
 
25
                if (children(player) &#62; 1) "You haven't a free hand.";
 
26
                give self general; player.capacity=1;
 
27
               "You hold your nose with your spare hand.";
 
28
          Drop: if (self hasnt general) "But you weren't holding it!";
 
29
                give self ~general; player.capacity=5;
 
30
                print "You release your nose and inhale again.  ";
 
31
                &#60;&#60;Smell&#62;&#62;;
 
32
       ],
 
33
  has  scenery;
 
34
</PRE>
 
35
 
 
36
</TABLE>
 
37
<HR>Back to <A HREF="../section28.html#ex84">the exercise in section 28</A><HR>
 
38
<SMALL><I>Mechanically translated to HTML from third edition as revised 16 May 1997. Copyright &#169; Graham Nelson 1993, 1994, 1995, 1996, 1997: all rights reserved.</I></SMALL></BODY></HTML>