~ubuntu-branches/ubuntu/hoary/inform/hoary

« back to all changes in this revision

Viewing changes to html/answers1/answer29.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 29</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 29</B><TR><TD><TD>
 
4
<P>
 
5
 
 
6
 
 
7
<PRE>
 
8
Object Zen "Zen" Flight_Deck
 
9
  with name "zen" "flight" "computer",
 
10
       initial "Square lights flicker unpredictably across a hexagonal
 
11
                fascia on one wall, indicating that Zen is on-line.",
 
12
       grammar [;  return -'zen,'; ],
 
13
       orders
 
14
       [;  Show: "The main screen shows a starfield,
 
15
                  turning through ", noun, " degrees.";
 
16
           Go:  "~Confirmed.~  The ship turns to a new bearing.";
 
17
           SetTo: if (noun==0) "~Confirmed.~  The ship comes to a stop.";
 
18
               if (noun&#62;12) "~Standard by ", (number) noun,
 
19
                            " exceeds design tolerances.~";
 
20
               "~Confirmed.~  The ship's engines step to
 
21
                standard by ", (number) noun, ".";
 
22
           Take: if (noun~=force_wall) "~Please clarify.~";
 
23
                "~Force wall raised.~";
 
24
           Drop: if (noun~=blasters)   "~Please clarify.~";
 
25
              "~Battle-computers on line.
 
26
                Neutron blasters cleared for firing.~";
 
27
           NotUnderstood: "~Language banks unable to decode.~";
 
28
           default: "~Information. That function is unavailable.~";
 
29
       ],
 
30
  has  talkable proper static;
 
31
Object -&#62; force_wall "force wall"     with name "force" "wall" "shields";
 
32
Object -&#62; blasters "neutron blasters" with name "neutron" "blasters";
 
33
...
 
34
Verb "zen,"   * "scan" number "orbital"        -&#62; Show
 
35
              * "set" "course" "for" Planet    -&#62; Go
 
36
              * "speed" "standard" "by" number -&#62; SetTo
 
37
              * "raise" held                   -&#62; Take
 
38
              * "clear" held "for" "firing"    -&#62; Drop;
 
39
</PRE>
 
40
 
 
41
Dealing with <TT>Ask</TT>, <TT>Answer</TT> and <TT>Tell</TT> are left to the reader.
 
42
</TABLE>
 
43
<HR>Back to <A HREF="../section16.html#ex29">the exercise in section 16</A><HR>
 
44
<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>