1
! Through the Looking-Glass
2
! An Inform tutorial by Gareth Rees
3
! All rights given away
6
! 5/1/2003 - Updated to Inform 6.21 Library 6/10
9
Constant Story "THROUGH THE LOOKING GLASS";
10
Constant Headline "^An Interactive Tutorial^by Gareth Rees^";
17
location = Drawing_Room;
18
StartDaemon(white_kitten);
19
StartDaemon(black_kitten);
20
print "^^^^^It's a cold winter day outside, but in the
21
looking-glass house it's summer. All you need to do is
22
pretend there's a way of getting through into it
26
[ UntangleSub; "What curious ideas you have!"; ];
29
if (second ~= mirror) "What a strange idea!";
30
if (noun == hearth or mirror || (player notin mantelpiece &&
31
player notin armchair))
32
"You can't see that in the looking-glass.";
33
print "The looking-glass ";
34
if (noun == player) print "Alice";
35
else PrintShortName(noun);
36
if (player in mantelpiece) " looks very misty and blurred.";
37
print " looks just like the real ";
38
if (noun == player) print "Alice";
39
else PrintShortName(noun);
40
" only all reversed, left for right.";
44
* "at" noun "in" noun -> Reflect;
47
* noun "in" noun -> Reflect;
49
Verb "roll" "untangle" "wind"
51
* "up" noun -> Untangle
52
* noun "up" -> Untangle;
54
Object Drawing_Room "Drawing room"
57
description "The gentle sound of snow against the window pane
58
suggests that it's cold outside, and you're glad to be
59
here in the warmth. The drawing-room is reflected in the
60
large looking-glass on the wall above the mantelpiece,
61
and a very comfortable room it is too, with a warm
62
hearth, a soft rug and an arm-chair that you can curl up
65
if (player in mantelpiece && (action == ##Exit ||
66
(action == ##Go && noun == d_obj or out_obj)))
67
"That's not the way to get down from a mantelpiece!";
68
if (player in mantelpiece &&
69
action ~= ##Examine or ##Enter or ##Go &&
70
action ~= ##ThrownAt or ##ThrowAt or ##Reflect)
71
if ((noun > 0 && noun notin mantelpiece &&
72
noun ~= mantelpiece or mirror && noun notin player) ||
73
(second > 0 && second notin mantelpiece &&
74
second ~= mantelpiece or mirror && second notin player))
75
"Not from up here you can't!";
78
Object red_queen "red queen"
80
with name "red" "queen",
82
if (white_kitten.state == 1 || black_kitten.state == 1)
85
description "She's a fierce little chess piece.",
88
if (white_kitten.state == 1)
89
white_kitten.state = 3;
90
if (black_kitten.state == 1)
91
black_kitten.state = 3;
92
PutOn,Transfer,Insert:
93
if (second == chess_board)
94
"Alone on the chess board, the red queen is monarch of
98
Object chess_board "chess board" Drawing_Room
100
with name "chess" "board" "checker" "chequer" "chessboard",
101
initial "An abandoned chess board lies on the floor.",
102
description "It's left here from the game you were playing
103
just now, but the pieces are all missing - the kittens
104
will insist on playing with them.";
106
Object hearth "hearth" Drawing_Room
108
with name "hearth" "fire" "place" "fireplace";
110
Object rug "rug" Drawing_Room
111
has concealed static supporter enterable
112
! general if you've found the red queen under it
113
with name "hearthrug" "hearth-rug" "rug" "indian" "arabian" "beautiful"
115
description "It's a beautiful rug, made in some far off
116
country, perhaps India or Araby, wherever those might
119
Take: "The rug is much too large and heavy for you to carry.";
120
Push,Pull: "But a hearth-rug is meant to be next to the
123
if (player in mantelpiece || player in armchair)
124
"You're unable to reach the rug from here.";
126
"You try to lift up a corner of the rug, but fail. After
127
a while, you realise that this is because you are
128
standing on it. How curious the world is!";
129
if (self hasnt general) {
131
move red_queen to player;
132
"You lift up a corner of the rug and, peering
133
underneath, discover the red queen from the chess
138
Object armchair "arm-chair" Drawing_Room
139
has static concealed supporter enterable
140
! general if its by the mantelpiece
141
with name "arm" "chair" "armchair" "arm-chair",
143
print "It's a huge arm-chair, the perfect place for a kitten
144
or a little girl to curl up in and doze. It has been
145
pushed over to the ";
146
if (self has general) "fireplace.";
151
if (player notin Drawing_Room)
152
print_ret "You'll have to get off ", (the) parent(player),
154
if (white_kitten in player || black_kitten in player)
155
"Not with a kitten in your arms!";
156
if (white_kitten.state == 3) i = white_kitten;
157
else if (black_kitten.state == 3) i = black_kitten;
159
print_ret "You are about to start moving the chair when you
160
notice that ", (the) i, " is right in the way. It's a
161
good thing you spotted it, or you would have squashed
162
flat the poor little thing.";
163
if (self has general) {
165
"You push the arm-chair away from the hearth.";
168
"You push the arm-chair over to the hearth.";
170
move player to armchair;
171
"You jump into the warm and comfortable arm-chair.";
174
Object mantelpiece "mantelpiece" Drawing_Room
175
has concealed supporter enterable
176
with name "mantel" "mantelpiece",
177
description "It's higher off the ground than your head, but
178
it looks wide enough and sturdy enough to support you.",
181
if (player notin armchair)
182
"The mantelpiece is much too high to climb up onto.";
183
if (armchair hasnt general)
184
"You can't reach the mantelpiece from here.";
185
if (children(player) > 0)
186
"Your hands are too full.";
187
move player to mantelpiece;
188
"You scramble up onto the mantelpiece.";
190
if (player notin self && (player notin armchair ||
191
armchair hasnt general))
192
"The mantelpiece is so high that you can't reach.";
195
Object mirror "looking-glass" Drawing_Room
197
with name "mirror" "looking" "glass" "looking-glass",
199
if (player in mantelpiece)
200
"Strangely, the glass is beginning to melt away,
201
just like a bright silvery mist.";
202
if (player in armchair)
203
"In the looking-glass you can see the drawing-room of
204
the looking-glass house. What you can see is very
205
much the same as this drawing-room, only all
206
reversed, left for right. But you are sure that out
207
of the corners of the glass, where you can't see, the
208
looking-glass world is quite different from yours.";
209
"In the looking-glass you can see the ceiling of the
210
drawing-room of the looking-glass house. It looks much
211
the same as the ceiling of your drawing-room.";
214
if (action ~= ##Examine or ##ThrownAt or ##Reflect &&
215
player notin mantelpiece)
216
"You can't reach the looking-glass from where you're
219
"Your hand goes right through the silvery mist!";
220
ThrownAt: "You don't want seven years' bad luck, do you?";
222
! Really, move Alice to the looking-glass house.
224
"Your hand goes right through the silvery mist, and in
225
another moment the rest of you follows, and you are
226
through the glass...";
229
Object worsted "ball of worsted" Drawing_Room
230
! general if its in a tangle
231
with name "ball" "of" "worsted" "fine" "blue" "wool",
233
if (white_kitten.state ~= 2 &&
234
black_kitten.state ~= 2)
235
"^A discarded ball of worsted lies on the floor here.";
239
if (self has general)
240
"It's in a terrible tangle. All that time you spent
241
rolling it up, and now look at it!";
242
"It's a ball of fine blue wool, all rolled up in preparation
243
for some embroidery.";
248
"You're as quick as can be at rolling up balls of wool,
249
though you say so yourself! Soon it's neat and tidy again.";
253
if (white_kitten.state == 2)
254
white_kitten.state = 3;
255
if (black_kitten.state == 2)
256
black_kitten.state = 3;
259
Object chess_pieces "chess pieces" Drawing_Room
261
with parse_name [ w colour n;
263
if (w == 'white' or 'red') {
268
if (w == 'pawn' or 'rook' or 'castle' ||
269
w == 'knight' or 'horse' or 'bishop' ||
270
w == 'king' || (w == 'queen' &&
271
(colour == 'white' || rug hasnt general))) return n + 1;
275
"Alas, that chess piece seems to be missing. Those
279
Object window "window" Drawing_Room
281
with name "window" "pane",
282
description "Outside the window it's snowing gently, and you're
283
glad to be in here in the warmth.",
285
Open: "You wouldn't want to catch a chill, would you? Better
286
leave the window shut.";
287
Search: <<Examine self>>;
290
Property other_kitten;
291
Property state; ! 1=red queen, 2=ball of wool, 3=arm-chair, 0=held
295
! general if it's been described this turn
296
with parse_name [ w ok n;
300
if (w == 'kittens' or 'cats') {
301
ok = 1; n++; parser_action=##PluralFound;
303
if (w == 'kitten' or 'kitty' or 'cat' ||
304
w == ((self.&name)-->0)) {
312
switch (self.state) {
313
1: print_ret "^A ", (name) self, " is playing with the red
315
2: print_ret "^A ", (name) self, " is playing with a ball of
317
3: if (self has general) rtrue;
318
if ((self.other_kitten).state == 3) {
319
i = self.other_kitten;
321
"^Two kittens, one white and one black, are playing
322
together by the arm-chair.";
324
print_ret "^A ", (name) self, " is playing by the
330
print_ret "What a beautiful kitten ", (the) self, " is. Why,
331
it's quite definitely your favourite of the pair, and
332
much prettier than that naughty ", (name)
333
self.other_kitten, ".";
337
print_ret (The) self, " twitches its whiskers and looks at
338
you with such a clever expression that you are certain it
339
understands every word you are saying.";
341
print_ret "You give ", (the) self, " a little kiss on its
342
nose, and it looks sweetly and demurely at you.";
343
Attack: "You would never do such a beastly thing to such
344
a defenceless little animal!";
346
print_ret (The) self, " bats a paw at ", (the) noun, ".";
348
if (noun ~= red_queen or worsted) {
349
if (action == ##ThrowAt) {
350
move noun to Drawing_Room;
351
print "You toss ", (the) noun, " onto the floor, but ",
354
else print (The) self;
355
print_ret " just examines ", (the) noun, " with a
356
quizzical expression.";
358
print "You toss ", (the) noun, " onto the floor and ", (the) self;
360
print " squirms out of your grasp and";
361
move noun to Drawing_Room;
362
move self to Drawing_Room;
363
print " scampers after it";
364
if (noun == worsted) {
365
give worsted general;
367
print ", quickly turning the neat ball into a tangle";
374
if (self.other_kitten in player)
375
"You can't hold two kittens at once!";
378
print_ret "You pick up ", (the) self, ". What a beautiful
384
move self to Drawing_Room;
385
print_ret (The) self, " squirms out of your arms and scampers
387
Transfer,PutOn,Insert:
389
print (The) self, " jumps off ", (the) parent(self);
390
move self to Drawing_Room;
391
", landing lightly on the floor before scampering away.";
395
self.number = 1 - self.number;
396
if (self.number == 1 || random(3) == 2) rtrue;
399
switch (self.state) {
400
0: switch(random(5)) {
401
1: " mews plaintively.";
402
2: " purrs quietly to itself.";
403
3: " purrs contentedly to itself.";
404
4: " rubs its ears against you.";
405
5: move self to Drawing_Room;
407
" squirms out of your arms and scampers away.";
409
1: switch (random(5)) {
410
1: " bats at the red queen with its paw.";
411
2: " stops playing and sits up, pretending to be
412
innocent of any kittenish tendancies.";
413
3: " knocks the red queen across the floor and chases
415
4: " stops to wash itself.";
416
5: " bites the red queen and shakes it to make sure that
419
2: give worsted general;
421
1: " bats at the ball of worsted with its paw.";
422
2: " pushes the ball of worsted across the floor and
424
3: " leaps onto the ball of worsted and grapples bravely
426
4: " jumps into the ball of worsted and gets tangled up
427
in a mess of threads.";
428
5: " stops playing and scratches its ears.";
430
3: if ((self.other_kitten).state == 3 && random(2) == 1) {
433
1: print " chases after ";
434
2: print " jumps on top of ";
436
4: print " scampers around the arm-chair and ";
437
5: print " bats at ";
439
print (the) self.other_kitten;
442
2: " and they roll around on the floor.";
443
4: " chases after it.";
448
1: " scampers after a speck of dust.";
449
2: " rolls around on the floor.";
450
3: " sits up and washes its tail.";
451
4: " scratches its head on the arm-chair.";
452
5: " chases its tail.";
457
Object white_kitten "white kitten" Drawing_Room
461
other_kitten black_kitten;
463
Object black_kitten "black kitten" Drawing_Room
467
other_kitten white_kitten;
b'\\ No newline at end of file'