1
<HTML><HEAD><TITLE>Answer to Exercise 67</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 67</B><TR><TD><TD>
8
Object -> genies_lamp "brass lamp"
9
with name "brass" "lamp",
11
[; Rub: if (self hasnt general) give self general;
12
else give self ~general;
13
"A genie appears from the lamp, declaring:^^
14
~Mischief is my sole delight:^
15
If white means black, black means white!~^^
16
She vanishes away with a vulgar wink.";
18
Object -> white_stone "white stone" with name "white" "stone";
19
Object -> black_stone "black stone" with name "black" "stone";
22
if (genies_lamp hasnt general) return;
24
{ switch(NextWordStopped())
25
{ 'white': parse->(wn*2-3) = 'black';
26
'black': parse->(wn*2-3) = 'white';
34
<HR>Back to <A HREF="../section26.html#ex67">the exercise in section 26</A><HR>
35
<SMALL><I>Mechanically translated to HTML from third edition as revised 16 May 1997. Copyright © Graham Nelson 1993, 1994, 1995, 1996, 1997: all rights reserved.</I></SMALL></BODY></HTML>