ANSWER TO EXERCISE 67 | |
Object -> genies_lamp "brass lamp" with name "brass" "lamp", before [; Rub: if (self hasnt general) give self general; else give self ~general; "A genie appears from the lamp, declaring:^^ ~Mischief is my sole delight:^ If white means black, black means white!~^^ She vanishes away with a vulgar wink."; ]; Object -> white_stone "white stone" with name "white" "stone"; Object -> black_stone "black stone" with name "black" "stone"; ... [ BeforeParsing; if (genies_lamp hasnt general) return; for (wn=1::) { switch(NextWordStopped()) { 'white': parse->(wn*2-3) = 'black'; 'black': parse->(wn*2-3) = 'white'; -1: return; } } ]; |