-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathfirst-floor.zap
1344 lines (1211 loc) · 34.1 KB
/
first-floor.zap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.FUNCT LETTER-F
EQUAL? PRSA,V?READ,V?EXAMINE \FALSE
FSET? LETTER,WETBIT \?ELS10
CALL WET-PAPER
RTRUE
?ELS10: PRINTR "The letter looks exactly like the letter in your exquisitely designed game package."
.FUNCT PHOTO-F
EQUAL? PRSA,V?EXAMINE,V?READ \FALSE
FSET? PHOTO,WETBIT \?CND6
CALL WET-PAPER
RTRUE
?CND6: FSET? PHOTO,READBIT /?CND9
FSET PHOTO,READBIT
?CND9: PRINTR "The photo looks exactly like the one that came in your game package."
.FUNCT BUCK-F,OARG=0
ZERO? OARG /?ELS5
EQUAL? OARG,M-OBJDESC? /TRUE
ZERO? BUCK-TURNED? \?CND10
EQUAL? SOUTH-JUNCTION-VISITS,2 \?CND10
SET 'BUCK-DIR,P?SOUTH
?CND10: CRLF
PRINTI "A life-size statue of Buck Palace, one of the stars of Uncle Buddy's talent stables, stands here. He's holding a bazooka pointing "
CALL SAY-BUCK-DIR
PRINTC 46
ZERO? BUCK-TURNED? \TRUE
EQUAL? SOUTH-JUNCTION-VISITS,2 \TRUE
PRINTI " Hmmm. It looks as if"
CALL TPRINT,BUCK
PRINTI ", has changed position."
RTRUE
?ELS5: EQUAL? PRSA,V?TURN \?ELS21
ZERO? PRSI \?ELS26
PRINTR "Next time, say which direction to turn it."
?ELS26: EQUAL? PRSI,INTDIR \FALSE
EQUAL? P-DIRECTION,BUCK-DIR \?ELS30
CALL ITS-ALREADY,STR?108
RSTACK
?ELS30: SET 'BUCK-DIR,P-DIRECTION
SET 'BUCK-TURNED?,TRUE-VALUE
ZERO? STEPS-THROUGH-BUCK \?ELS35
EQUAL? P-DIRECTION,P?WEST \?ELS35
SET 'STEPS-THROUGH-BUCK,1
JUMP ?CND33
?ELS35: EQUAL? STEPS-THROUGH-BUCK,1 \?ELS39
EQUAL? P-DIRECTION,P?EAST \?ELS39
SET 'STEPS-THROUGH-BUCK,2
JUMP ?CND33
?ELS39: EQUAL? STEPS-THROUGH-BUCK,2 \?ELS43
EQUAL? P-DIRECTION,P?NORTH \?ELS43
SET 'STEPS-THROUGH-BUCK,3
JUMP ?CND33
?ELS43: SET 'STEPS-THROUGH-BUCK,0
?CND33: PRINTI "You turn"
CALL TPRINT,BUCK
PRINTI ", to the "
CALL SAY-BUCK-DIR
EQUAL? STEPS-THROUGH-BUCK,3 \?CND48
PRINTI ", and hear a click from off to the north"
FCLEAR OAK-DOOR,LOCKEDBIT
?CND48: PRINTR "."
?ELS21: EQUAL? PRSA,V?EXAMINE \?ELS52
PRINTI "It's pretty much what you would expect of a sculpture of Buck Palace. One hand is holding a pair of Uzi machine guns and his other hand is gripping a bazooka on his shoulder which he is pointing "
CALL SAY-BUCK-DIR
PRINTR ". Several belts of ammunition crisscross his half-naked chest. He's wearing a double belt of grenades around his waist, and has a high-powered rifle stuck in one of his combat boots and a bayonet between his teeth. Of course Buck Palace, the fighting letter carrier, would not be complete without his government-issue mailbag over his shoulder. The statue is on a round, rotating pedestal, encircled by a compass rose."
?ELS52: EQUAL? PRSA,V?MOVE,V?PUSH \FALSE
PRINTI "The "
CALL DPRINT,BUCK
PRINTI " turns slightly, then twists back with the bazooka pointing "
CALL SAY-BUCK-DIR
PRINTR "."
.FUNCT SAY-BUCK-DIR
EQUAL? BUCK-DIR,P?NORTH,FALSE-VALUE \?ELS5
SET 'BUCK-DIR,P?NORTH
PRINTI "north"
RTRUE
?ELS5: EQUAL? BUCK-DIR,P?EAST \?ELS7
PRINTI "east"
RTRUE
?ELS7: EQUAL? BUCK-DIR,P?SOUTH \?ELS9
PRINTI "south"
RTRUE
?ELS9: EQUAL? BUCK-DIR,P?WEST \?ELS11
PRINTI "west"
RTRUE
?ELS11: EQUAL? BUCK-DIR,P?NE \?ELS13
PRINTI "northeast"
RTRUE
?ELS13: EQUAL? BUCK-DIR,P?NW \?ELS15
PRINTI "northwest"
RTRUE
?ELS15: EQUAL? BUCK-DIR,P?SE \?ELS17
PRINTI "southeast"
RTRUE
?ELS17: EQUAL? BUCK-DIR,P?SW \FALSE
PRINTI "southwest"
RTRUE
.FUNCT FLASHLIGHT-F
EQUAL? PRSA,V?EXAMINE \?ELS5
FSET? FLASHLIGHT,WETBIT \?ELS10
PRINTR "The soggy flashlight is switched on, but isn't working."
?ELS10: PRINTI "The rugged-looking "
CALL DPRINT,FLASHLIGHT
PRINTI " is turned "
FSET? FLASHLIGHT,ONBIT \?ELS15
PRINTI "on"
JUMP ?CND13
?ELS15: PRINTI "off"
?CND13: PRINTR "."
?ELS5: EQUAL? PRSA,V?LAMP-ON \?ELS19
FSET? FLASHLIGHT,WETBIT \FALSE
PRINTR "You turn it on, but nothing happens!"
?ELS19: EQUAL? PRSA,V?OPEN \FALSE
PRINTR "I'll bet you were the kind of kid who always took their toys apart."
.FUNCT STAIRS-F
EQUAL? PRSA,V?PUSH-DOWN \?ELS5
CALL MOVE-OBJ-DOWN
RSTACK
?ELS5: EQUAL? PRSA,V?SKI \?ELS7
CALL DO-WALK,P?DOWN
RSTACK
?ELS7: EQUAL? PRSA,V?CLIMB-UP \?ELS9
CALL DO-WALK,P?UP
RSTACK
?ELS9: EQUAL? PRSA,V?CLIMB-DOWN \FALSE
CALL DO-WALK,P?DOWN
RSTACK
.FUNCT FOYER-F,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "This is the elegant foyer, covered in rich mahogany paneling. Your footsteps echo sharply in this large, hollow space. A broad, graceful staircase sweeps upstairs. Pillared archways beckon you east, west and north. The front door to the south is "
FSET? OAK-DOOR,OPENBIT \?ELS8
PRINTI "open"
JUMP ?CND6
?ELS8: PRINTI "closed"
?CND6: PRINTI ". There is a coat closet by the front door. The door to the closet is "
FSET? FOYER-CD,OPENBIT \?ELS13
PRINTI "open"
JUMP ?CND11
?ELS13: PRINTI "closed"
?CND11: PRINTC 46
RTRUE
.FUNCT FOYER-CD-F
EQUAL? PRSA,V?OPEN \FALSE
FSET? FOYER-CD,OPENBIT /FALSE
EQUAL? CLOSET-FLOOR,FOYER /FALSE
EQUAL? HERE,FOYER \FALSE
CALL OPEN-DOOR-TO-SHAFT
FSET FOYER-CD,OPENBIT
RTRUE
.FUNCT FOYER-STAIRS-F
EQUAL? PRSA,V?PUSH-DOWN \?ELS5
CALL MOVE-OBJ-DOWN
RSTACK
?ELS5: EQUAL? PRSA,V?EXAMINE \?ELS7
PRINTI "The stairs are made of rich mahogany and lead "
EQUAL? HERE,FOYER \?ELS10
PRINTI "up"
JUMP ?CND8
?ELS10: PRINTI "down"
?CND8: PRINTR "."
?ELS7: EQUAL? PRSA,V?CLIMB-UP \?ELS14
CALL DO-WALK,P?UP
RSTACK
?ELS14: EQUAL? PRSA,V?SKI,V?CLIMB-DOWN \FALSE
CALL DO-WALK,P?DOWN
RSTACK
.FUNCT TO-UPSTAIRS-HALL-MIDDLE
FSET? NEWEL,NEWEL-TURNED-BIT /?ELS5
PRINTI "You start to go up, but suddenly the staircase flattens out. After you awkwardly slide back down, the flattened stairs return to normal."
CRLF
RFALSE
?ELS5: PRINTI "You climb up the stairs to the..."
CRLF
CRLF
RETURN UPSTAIRS-HALL-MIDDLE
.FUNCT NEWEL-F
EQUAL? PRSA,V?TURN \?ELS5
FSET? NEWEL,NEWEL-TURNED-BIT \?ELS8
FCLEAR NEWEL,NEWEL-TURNED-BIT
JUMP ?CND6
?ELS8: FSET NEWEL,NEWEL-TURNED-BIT
?CND6: PRINTI "You turn"
CALL TPRINT,NEWEL
PRINTR " and hear a click from the staircase."
?ELS5: EQUAL? PRSA,V?EXAMINE \FALSE
PRINTR "It's a life-size, wooden replica of the head of one of Uncle Buddy's rivals, Roger Corman."
.FUNCT FOYER-CLOSET-ENTER-F
FSET? FOYER-CD,OPENBIT /?ELS5
CALL ITS-CLOSED,FOYER-CD
RFALSE
?ELS5: EQUAL? CLOSET-FLOOR,FOYER \?ELS7
RETURN CLOSET
?ELS7: EQUAL? CLOSET-FLOOR,CELLAR \?ELS9
RETURN CLOSET-TOP
?ELS9: PRINTI "You enter the shaft and plunge down a floor. A bit shaken, you find yourself at..."
CRLF
CRLF
RETURN SHAFT-BOTTOM
.FUNCT CELLAR-F,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "You are in a musty cellar. One of Uncle Buddy's old movie props, a huge, over-teched "
CALL DPRINT,COMPUTER
PRINTI " is here. There is a"
FSET? CELLAR-CD,OPENBIT \?ELS8
PRINTI "n open"
JUMP ?CND6
?ELS8: PRINTI " closed"
?CND6: PRINTI " closet door to the south. A staircase leads up."
RTRUE
.FUNCT CELLAR-PSEUDO
EQUAL? PRSA,V?EXAMINE \FALSE
CALL V-LOOK
RSTACK
.FUNCT CELLAR-CD-F
EQUAL? PRSA,V?OPEN \FALSE
FSET? CELLAR-CD,OPENBIT /FALSE
EQUAL? CLOSET-FLOOR,CELLAR /FALSE
EQUAL? HERE,CELLAR \FALSE
CALL OPEN-DOOR-TO-SHAFT
FSET CELLAR-CD,OPENBIT
RTRUE
.FUNCT CELLAR-CLOSET-ENTER-F
FSET? CELLAR-CD,OPENBIT /?ELS5
CALL ITS-CLOSED,CELLAR-CD
RFALSE
?ELS5: EQUAL? CLOSET-FLOOR,CELLAR \?ELS7
RETURN CLOSET
?ELS7: PRINTI "You step down a foot into the..."
CRLF
CRLF
RETURN SHAFT-BOTTOM
.FUNCT DISPLAY-LIGHTS-F
EQUAL? PRSA,V?READ,V?EXAMINE \FALSE
FSET? COMPUTER,ONBIT \?ELS10
PRINTI "You study the display of lights and see:"
CRLF
CRLF
CALL FIXED-FONT-ON
GET DISPLAY-TABLE,0
PRINT STACK
CRLF
GET DISPLAY-TABLE,1
PRINT STACK
CRLF
GET DISPLAY-TABLE,2
PRINT STACK
CRLF
GET DISPLAY-TABLE,3
PRINT STACK
CRLF
GET DISPLAY-TABLE,4
PRINT STACK
CRLF
GET DISPLAY-TABLE,5
PRINT STACK
CRLF
GET DISPLAY-TABLE,6
PRINT STACK
CRLF
CALL FIXED-FONT-OFF
RSTACK
?ELS10: PRINTI "The "
CALL DPRINT,DISPLAY-LIGHTS
PRINTR " are off."
.FUNCT COMPUTER-F
EQUAL? PRSA,V?EXAMINE \?ELS5
PRINTI "It's the huge, massive, steel contraption of"
CALL APRINT,COMPUTER
PRINTI " that saved the earth from the maurading marketeers in ""Plan Nine from Marketing."" The front of"
CALL TPRINT,COMPUTER
PRINTI " is covered with rows of lights. Beneath the lights are a slot and a button. There is a hopper on one end of it. The "
CALL DPRINT,COMPUTER
PRINTI " is "
FSET? COMPUTER,ONBIT \?ELS8
PRINTI "on"
JUMP ?CND6
?ELS8: PRINTI "off"
?CND6: PRINTR "."
?ELS5: EQUAL? PRSA,V?PUT \?ELS12
EQUAL? PRSI,COMPUTER \?ELS12
GETPT PRSO,P?CARD-NUM
ZERO? STACK /?ELS19
FSET? COMPUTER,ONBIT /?ELS24
PRINT NO-DATA
RTRUE
?ELS24: FSET? PRSO,WETBIT \?ELS26
MOVE PRSO,HERE
PRINTI "The "
CALL DPRINT,COMPUTER
PRINTR " starts to suck in the wet punch card, then spits it back out at you."
?ELS26: PRINTI "The "
CALL DPRINT,COMPUTER
PRINTI " sucks in the card, making a slurping noise"
IN? TOUPEE,RESET-BUTTON \?CND29
PRINTI ", then begins to rumble like something inside is trying to get out"
?CND29: PRINTI ". It pauses as if it were thinking about what to do next, then"
CALL TPRINT,DISPLAY-LIGHTS
PRINTI " change."
CRLF
GETP PRSO,P?CARD-NUM
GET CARD-TABLE,STACK
PUT DISPLAY-TABLE,WHERE-TO-PRINT,STACK
INC 'WHERE-TO-PRINT
INC 'CARD-COUNT
MOVE PRSO,COMPUTER
EQUAL? CARD-COUNT,7 \TRUE
FSET TOUPEE,CARDS-RIGHT-BIT
RTRUE
?ELS19: GETP PRSO,P?SIZE
EQUAL? STACK,1 \?ELS36
FSET? COMPUTER,ONBIT \?ELS41
PRINTI "The "
CALL DPRINT,COMPUTER
PRINTI " sucks in"
CALL TPRINT,PRSO
PRINTI ", pauses momentarily, then spits out"
CALL TPRINT,PRSO
PRINTI " with a whining noise."
CRLF
MOVE PRSO,HERE
RTRUE
?ELS41: PRINT NO-DATA
RTRUE
?ELS36: PRINTI "How are you going to fit"
CALL TPRINT,PRSO
PRINTI " in"
CALL TPRINT,COMPUTER
PRINTR "'s card slot?"
?ELS12: EQUAL? PRSA,V?LAMP-ON \?ELS47
FSET? COMPUTER,ONBIT \?ELS52
CALL ITS-ALREADY,STR?47
RSTACK
?ELS52: PRINTI "The "
CALL DPRINT,COMPUTER
PRINTI "'s machinery begins to roar as you turn it on. The seven rows of display lights on the front of"
CALL TPRINT,COMPUTER
PRINTI " flash on and off in unison several times as it comes to life."
CRLF
FSET COMPUTER,ONBIT
FSET CELLAR,ONBIT
RTRUE
?ELS47: EQUAL? PRSA,V?LAMP-OFF \?ELS56
FSET? COMPUTER,ONBIT \?ELS56
PRINTI "The "
CALL DPRINT,COMPUTER
PRINTI " winds down slowly coming to a stop and the lights of the display dim and go out. "
CALL RESET-COMPUTER
FCLEAR CELLAR,ONBIT
FCLEAR COMPUTER,ONBIT
RTRUE
?ELS56: EQUAL? PRSA,V?RESET \FALSE
CALL PERFORM,V?PUSH,RESET-BUTTON
RTRUE
.FUNCT RESET-COMPUTER
FIRST? COMPUTER \?ELS3
EQUAL? CARD-COUNT,1 \?ELS6
PRINTI "A punch card drops"
JUMP ?CND4
?ELS6: LESS? CARD-COUNT,3 \?ELS11
PRINTI "A couple of"
JUMP ?CND9
?ELS11: LESS? CARD-COUNT,4 \?ELS13
PRINTI "A few"
JUMP ?CND9
?ELS13: LESS? CARD-COUNT,8 \?CND9
PRINTI "Some"
?CND9: PRINTI " punch cards drop"
?CND4: PRINTI " into"
CALL TPRINT,HOPPER
PRINTC 46
CRLF
JUMP ?CND1
?ELS3: CRLF
?CND1: SET 'WHERE-TO-PRINT,0
CALL ROB,COMPUTER,HOPPER
SET 'CARD-COUNT,0
PUT DISPLAY-TABLE,0,COMPUTER-LIGHTS
PUT DISPLAY-TABLE,1,COMPUTER-LIGHTS
PUT DISPLAY-TABLE,2,COMPUTER-LIGHTS
PUT DISPLAY-TABLE,3,COMPUTER-LIGHTS
PUT DISPLAY-TABLE,4,COMPUTER-LIGHTS
PUT DISPLAY-TABLE,5,COMPUTER-LIGHTS
PUT DISPLAY-TABLE,6,COMPUTER-LIGHTS
RTRUE
.FUNCT RESET-BUTTON-F
EQUAL? PRSA,V?PUSH \?ELS5
FSET? COMPUTER,ONBIT \?ELS10
PRINTI "All"
CALL TPRINT,DISPLAY-LIGHTS
PRINTI " flash off and on several times. "
CALL RESET-COMPUTER
RSTACK
?ELS10: PRINTR "You hear a click, but that's all."
?ELS5: EQUAL? PRSA,V?EXAMINE \FALSE
PRINTR "It's a small button labeled ""Reset."""
.FUNCT TOUPEE-F
EQUAL? PRSA,V?EXAMINE \?ELS5
PRINTR "Ah, ahem, well, it looks like Uncle Buddy's toupee. One of the worst kept secrets in Hollywood."
?ELS5: EQUAL? PRSA,V?ROLL-UP \FALSE
PRINTR "Now come on, it's not that kind of a rug!"
.FUNCT PUNCH-CARD-F
EQUAL? PRSA,V?EXAMINE \?ELS5
PRINTI "The surface of"
CALL TPRINT,PRSO
PRINTI " is covered with holes"
FSET? PRSO,WETBIT \?CND6
PRINTI " and it's rather soggy"
?CND6: PRINTR "."
?ELS5: EQUAL? PRSA,V?READ \FALSE
PRINTR "Only a computer can read a punch card!"
.FUNCT PERSIAN-RUG-F
EQUAL? PRSA,V?TAKE \?ELS5
PRINT SPINACH
CRLF
RTRUE
?ELS5: EQUAL? PRSA,V?PUT-ON \?ELS7
EQUAL? PRSI,PERSIAN-RUG \?ELS7
CALL PERFORM,V?DROP,PRSO
RTRUE
?ELS7: EQUAL? PRSA,V?LOOK-UNDER,V?MOVE,V?ROLL-UP \FALSE
PRINTR "You move the rug but don't find any trap door. Amidst your sorrow you return the carpet to its original splendor."
.FUNCT BLUE-CANDLE-F
CALL CANDLE-F,BLUE-CANDLE
RSTACK
.FUNCT WHITE-CANDLE-F
CALL CANDLE-F,WHITE-CANDLE
RSTACK
.FUNCT RED-CANDLE-F
CALL CANDLE-F,RED-CANDLE
RSTACK
.FUNCT GENERIC-CANDLE-F,NUM,LIT-CANDLE
EQUAL? PRSA,V?LAMP-OFF \FALSE
SET 'NUM,0
FSET? RED-CANDLE,FLAMEBIT \?ELS8
CALL VISIBLE?,RED-CANDLE
ZERO? STACK /?ELS8
INC 'NUM
SET 'LIT-CANDLE,RED-CANDLE
JUMP ?CND6
?ELS8: FSET? WHITE-CANDLE,FLAMEBIT \?ELS12
CALL VISIBLE?,WHITE-CANDLE
ZERO? STACK /?ELS12
INC 'NUM
SET 'LIT-CANDLE,WHITE-CANDLE
JUMP ?CND6
?ELS12: FSET? BLUE-CANDLE,FLAMEBIT \?CND6
CALL VISIBLE?,BLUE-CANDLE
ZERO? STACK /?CND6
INC 'NUM
SET 'LIT-CANDLE,BLUE-CANDLE
?CND6: EQUAL? NUM,1 \FALSE
RETURN LIT-CANDLE
.FUNCT CANDLE-F,CANDLE,SIZE,FEET,I-CANDLE,CANDLE-WAX
GETP PRSO,P?SIZE >SIZE
EQUAL? CANDLE,RED-CANDLE \?ELS3
SET 'FEET,RED-FEET
SET 'I-CANDLE,I-RED-CANDLE-BURN
SET 'CANDLE-WAX,RED-WAX
JUMP ?CND1
?ELS3: EQUAL? CANDLE,WHITE-CANDLE \?ELS5
SET 'FEET,WHITE-FEET
SET 'I-CANDLE,I-WHITE-CANDLE-BURN
SET 'CANDLE-WAX,WHITE-WAX
JUMP ?CND1
?ELS5: EQUAL? CANDLE,BLUE-CANDLE \?CND1
SET 'FEET,BLUE-FEET
SET 'I-CANDLE,I-BLUE-CANDLE-BURN
SET 'CANDLE-WAX,BLUE-WAX
?CND1: EQUAL? PRSA,V?EXAMINE \?ELS12
EQUAL? SIZE,1 \?CND13
CALL WAX-FEET,FEET
RTRUE
?CND13: PRINTI "It's "
LESS? SIZE,10 \?CND16
PRINTI "what's left of "
?CND16: PRINTI "a thin, wax statuette of a Hindu god, dressed in a long gown. "
GRTR? SIZE,7 \?CND19
PRINTI "The foot-high god is holding up its "
EQUAL? PRSO,WHITE-CANDLE \?ELS24
PRINTI "lef"
JUMP ?CND22
?ELS24: PRINTI "righ"
?CND22: PRINTI "t hand, showing "
EQUAL? PRSO,RED-CANDLE \?ELS29
PRINTI "three"
JUMP ?CND27
?ELS29: EQUAL? PRSO,WHITE-CANDLE \?ELS31
PRINTI "seven"
JUMP ?CND27
?ELS31: PRINTI "five"
?CND27: PRINTI " fingers. "
?CND19: FSET? PRSO,ONBIT \?ELS36
PRINTI "The wax statuette is lit, and a bit of wax is dripping down it"
JUMP ?CND34
?ELS36: GRTR? SIZE,1 \?CND34
PRINTI "A wick is sticking up from "
GRTR? SIZE,4 \?ELS44
PRINTI "the top of the statuette"
JUMP ?CND34
?ELS44: PRINTI "the little that remains of the statuette"
?CND34: LESS? SIZE,10 \?CND47
GRTR? SIZE,1 \?CND47
PRINTI ". The wax statuette has burned down to the god's "
GET CANDLE-DESC,SIZE
PRINT STACK
?CND47: PRINTR "."
?ELS12: EQUAL? PRSA,V?PUT \?ELS53
EQUAL? PRSI,CANDLE \?ELS53
PRINTR "You can't possibly do that."
?ELS53: EQUAL? PRSA,V?BURN,V?LAMP-ON \?ELS57
EQUAL? PRSO,BLUE-CANDLE,WHITE-CANDLE,RED-CANDLE \?ELS57
CALL SET-FLAME-SOURCE
ZERO? STACK \TRUE
FSET? PRSI,FLAMEBIT \?ELS67
FSET? PRSO,FLAMEBIT \?ELS72
PRINTR "It's already lit."
?ELS72: EQUAL? SIZE,1 \?ELS74
PRINTI "It's all used up. "
CALL WAX-FEET,FEET
RSTACK
?ELS74: FSET PRSO,ONBIT
FSET PRSO,FLAMEBIT
FCLEAR PRSO,NDESCBIT
CALL QUEUE,I-CANDLE,-1
MOVE CANDLE-WAX,CANDLE
PRINTI "You light"
CALL TPRINT,PRSO
PRINTR " and a bit of wax begins to dribble down the god."
?ELS67: EQUAL? PRSI,RED-CANDLE,GREEN-MATCH,RED-MATCH /?THN79
EQUAL? PRSI,WHITE-CANDLE,BLUE-CANDLE \FALSE
?THN79: PRINTI "But"
CALL TPRINT,PRSI
PRINTR "'s not lit!"
?ELS57: EQUAL? PRSA,V?LAMP-OFF \?ELS82
FSET? PRSO,ONBIT \?ELS87
CALL BLOW-OUT-CANDLE,CANDLE
RSTACK
?ELS87: PRINTR "The wax god isn't lit."
?ELS82: EQUAL? PRSA,V?CLOSE,V?OPEN \?ELS91
CALL CANT-OPEN-CLOSE
RSTACK
?ELS91: EQUAL? PRSA,V?TAKE \FALSE
FCLEAR PRSO,NDESCBIT
RFALSE
.FUNCT CANDLE-BURN,CANDLE,FEET,I-CANDLE,SIZE
GETP CANDLE,P?SIZE
SUB STACK,1
PUTP CANDLE,P?SIZE,STACK
GETP CANDLE,P?SIZE >SIZE
EQUAL? SIZE,1 \?CND1
CALL VISIBLE?,CANDLE
ZERO? STACK /?CND4
CRLF
?CND4: LOC CANDLE
MOVE FEET,STACK
CALL BLOW-OUT-CANDLE,CANDLE
REMOVE CANDLE
CALL DEQUEUE,I-CANDLE
?CND1: EQUAL? SIZE,2 \?CND7
EQUAL? CANDLE,RED-CANDLE \?ELS12
CALL QUEUE,I-RED-ALMOST-OUT,5
JUMP ?CND7
?ELS12: EQUAL? CANDLE,WHITE-CANDLE \?ELS14
CALL QUEUE,I-WHITE-ALMOST-OUT,5
JUMP ?CND7
?ELS14: EQUAL? CANDLE,BLUE-CANDLE \?CND7
CALL QUEUE,I-BLUE-ALMOST-OUT,5
?CND7: CALL ACCESSIBLE?,CANDLE
ZERO? STACK /FALSE
EQUAL? SIZE,8,6,4 /?THN24
EQUAL? SIZE,2 \FALSE
?THN24: CRLF
PRINTI "The "
CALL DPRINT,CANDLE
PRINTI " has burned down to the god's "
GET CANDLE-DESC,SIZE
PRINT STACK
PRINTR "."
.FUNCT I-RED-ALMOST-OUT
CALL QUEUE,I-RED-NEARLY-OUT,2
CALL ACCESSIBLE?,RED-CANDLE
ZERO? STACK /FALSE
CRLF
PRINTI "The "
CALL DPRINT,RED-CANDLE
PRINTR " is almost out!"
.FUNCT I-WHITE-ALMOST-OUT
CALL QUEUE,I-WHITE-NEARLY-OUT,2
CALL ACCESSIBLE?,WHITE-CANDLE
ZERO? STACK /FALSE
CRLF
PRINTI "The "
CALL DPRINT,WHITE-CANDLE
PRINTR " is almost out!"
.FUNCT I-BLUE-ALMOST-OUT
CALL QUEUE,I-BLUE-NEARLY-OUT,2
CALL ACCESSIBLE?,BLUE-CANDLE
ZERO? STACK /FALSE
CRLF
PRINTI "The "
CALL DPRINT,BLUE-CANDLE
PRINTR " is almost out!"
.FUNCT I-RED-NEARLY-OUT
CALL ACCESSIBLE?,RED-CANDLE
ZERO? STACK /FALSE
CRLF
PRINTI "The "
CALL DPRINT,RED-CANDLE
PRINTR " is nearly out!"
.FUNCT I-WHITE-NEARLY-OUT
CALL ACCESSIBLE?,WHITE-CANDLE
ZERO? STACK /FALSE
CRLF
PRINTI "The "
CALL DPRINT,WHITE-CANDLE
PRINTR " is nearly out!"
.FUNCT I-BLUE-NEARLY-OUT
CALL ACCESSIBLE?,BLUE-CANDLE
ZERO? STACK /FALSE
CRLF
PRINTI "The "
CALL DPRINT,BLUE-CANDLE
PRINTR " is nearly out!"
.FUNCT I-RED-CANDLE-BURN
ZERO? RED-MID-BURN /?ELS5
PUSH RED-MID-BURN
JUMP ?CND1
?ELS5: PUSH 10
?CND1: CALL QUEUE,I-RED-CANDLE-BURN,STACK
SET 'RED-MID-BURN,FALSE-VALUE
CALL CANDLE-BURN,RED-CANDLE,RED-FEET,I-RED-CANDLE-BURN
RSTACK
.FUNCT I-WHITE-CANDLE-BURN
ZERO? WHITE-MID-BURN /?ELS5
PUSH WHITE-MID-BURN
JUMP ?CND1
?ELS5: PUSH 10
?CND1: CALL QUEUE,I-WHITE-CANDLE-BURN,STACK
SET 'WHITE-MID-BURN,FALSE-VALUE
CALL CANDLE-BURN,WHITE-CANDLE,WHITE-FEET,I-WHITE-CANDLE-BURN
RSTACK
.FUNCT I-BLUE-CANDLE-BURN
ZERO? BLUE-MID-BURN /?ELS5
PUSH BLUE-MID-BURN
JUMP ?CND1
?ELS5: PUSH 10
?CND1: CALL QUEUE,I-BLUE-CANDLE-BURN,STACK
SET 'BLUE-MID-BURN,FALSE-VALUE
CALL CANDLE-BURN,BLUE-CANDLE,BLUE-FEET,I-BLUE-CANDLE-BURN
RSTACK
.FUNCT FEET-F
EQUAL? PRSA,V?BURN,V?LAMP-ON \FALSE
PRINTR "They're just wax. You can't light them."
.FUNCT BLOW-OUT-CANDLE,CANDLE,DONT-TELL=0,C,FEET
FCLEAR CANDLE,ONBIT
FCLEAR CANDLE,FLAMEBIT
EQUAL? CANDLE,RED-CANDLE \?ELS3
SET 'FEET,RED-FEET
CALL QUEUED?,I-RED-CANDLE-BURN >C
ZERO? C /?ELS6
GET C,C-TICK >RED-MID-BURN
JUMP ?CND4
?ELS6: SET 'RED-MID-BURN,FALSE-VALUE
?CND4: CALL STOP-RED-BURNING
JUMP ?CND1
?ELS3: EQUAL? CANDLE,WHITE-CANDLE \?ELS10
SET 'FEET,WHITE-FEET
CALL QUEUED?,I-WHITE-CANDLE-BURN >C
ZERO? C /?ELS13
GET C,C-TICK >WHITE-MID-BURN
JUMP ?CND11
?ELS13: SET 'WHITE-MID-BURN,FALSE-VALUE
?CND11: CALL STOP-WHITE-BURNING
JUMP ?CND1
?ELS10: EQUAL? CANDLE,BLUE-CANDLE \?CND1
SET 'FEET,BLUE-FEET
CALL QUEUED?,I-BLUE-CANDLE-BURN >C
ZERO? C /?ELS20
GET C,C-TICK >BLUE-MID-BURN
JUMP ?CND18
?ELS20: SET 'BLUE-MID-BURN,FALSE-VALUE
?CND18: CALL STOP-BLUE-BURNING
?CND1: ZERO? DONT-TELL \?CND23
CALL ACCESSIBLE?,CANDLE
ZERO? STACK /?CND23
PRINTI "The "
CALL DPRINT,CANDLE
PRINTI " goes out."
GETP CANDLE,P?SIZE
EQUAL? STACK,1 \?ELS30
PRINTC 32
CALL WAX-FEET,FEET
JUMP ?CND23
?ELS30: EQUAL? PRSI,POND /TRUE
CRLF
?CND23: CALL SAY-IF-NOT-LIT
RTRUE
.FUNCT WAX-FEET,FEET
CALL ACCESSIBLE?,FEET
ZERO? STACK /FALSE
PRINTI "There's nothing left but"
CALL APRINT,FEET
PRINTR "."
.FUNCT STOP-RED-BURNING
CALL DEQUEUE,I-RED-CANDLE-BURN
CALL DEQUEUE,I-RED-ALMOST-OUT
CALL DEQUEUE,I-RED-NEARLY-OUT
RSTACK
.FUNCT STOP-WHITE-BURNING
CALL DEQUEUE,I-WHITE-CANDLE-BURN
CALL DEQUEUE,I-WHITE-ALMOST-OUT
CALL DEQUEUE,I-WHITE-NEARLY-OUT
RSTACK
.FUNCT STOP-BLUE-BURNING
CALL DEQUEUE,I-BLUE-CANDLE-BURN
CALL DEQUEUE,I-BLUE-ALMOST-OUT
CALL DEQUEUE,I-BLUE-NEARLY-OUT
RSTACK
.FUNCT GENERIC-WAX-F,RED-HERE=0,BLUE-HERE=0,WHITE-HERE=0
EQUAL? PRSA,V?SCRAPE-OFF \?CND1
CALL VISIBLE?,WAX-COAT-1
ZERO? STACK /?ELS8
RETURN WAX-COAT-1
?ELS8: CALL VISIBLE?,WAX-COAT-2
ZERO? STACK /FALSE
RETURN WAX-COAT-2
?CND1: FSET? RED-CANDLE,ONBIT \?ELS15
CALL VISIBLE?,RED-CANDLE
ZERO? STACK /?ELS15
SET 'RED-HERE,TRUE-VALUE
JUMP ?CND13
?ELS15: FSET? WHITE-CANDLE,ONBIT \?ELS19
CALL VISIBLE?,WHITE-CANDLE
ZERO? STACK /?ELS19
SET 'WHITE-HERE,TRUE-VALUE
JUMP ?CND13
?ELS19: FSET? BLUE-CANDLE,ONBIT \?CND13
CALL VISIBLE?,BLUE-CANDLE
ZERO? STACK /?CND13
SET 'BLUE-HERE,TRUE-VALUE
?CND13: ZERO? BLUE-HERE /?ELS30
ZERO? RED-HERE \?ELS30
ZERO? WHITE-HERE \?ELS30
RETURN BLUE-WAX
?ELS30: ZERO? RED-HERE /?ELS34
ZERO? BLUE-HERE \?ELS34
ZERO? WHITE-HERE \?ELS34
RETURN RED-WAX
?ELS34: ZERO? WHITE-HERE /FALSE
ZERO? BLUE-HERE \FALSE
ZERO? RED-HERE \FALSE
RETURN WHITE-WAX
.FUNCT WAX-F
EQUAL? PRSO,RED-WAX \?ELS5
FSET? RED-CANDLE,FLAMEBIT /?ELS5
EQUAL? PRSA,V?PUT-ON,V?POUR \?ELS12
PRINTI "The "
CALL DPRINT,PRSO
PRINTR " is not lit."
?ELS12: CALL PERFORM,PRSA,RED-CANDLE,PRSI
RTRUE
?ELS5: EQUAL? PRSI,RED-WAX \?ELS16
FSET? RED-CANDLE,FLAMEBIT /?ELS16
CALL PERFORM,PRSA,PRSO,RED-CANDLE
RTRUE
?ELS16: EQUAL? PRSO,WHITE-WAX \?ELS20
FSET? WHITE-CANDLE,FLAMEBIT /?ELS20
EQUAL? PRSA,V?PUT-ON,V?POUR \?ELS27
PRINTI "The "
CALL DPRINT,PRSO
PRINTR " is not lit."
?ELS27: CALL PERFORM,PRSA,WHITE-CANDLE,PRSI
RTRUE
?ELS20: EQUAL? PRSI,WHITE-WAX \?ELS31
FSET? WHITE-CANDLE,FLAMEBIT /?ELS31
CALL PERFORM,PRSA,PRSO,WHITE-CANDLE
RTRUE
?ELS31: EQUAL? PRSO,BLUE-WAX \?ELS35
FSET? BLUE-CANDLE,FLAMEBIT /?ELS35
EQUAL? PRSA,V?PUT-ON,V?POUR \?ELS42
PRINTI "The "
CALL DPRINT,PRSO
PRINTR " is not lit."
?ELS42: CALL PERFORM,PRSA,BLUE-CANDLE,PRSI
RTRUE
?ELS35: EQUAL? PRSI,BLUE-WAX \?ELS46
FSET? BLUE-CANDLE,FLAMEBIT /?ELS46
CALL PERFORM,PRSA,PRSO,BLUE-CANDLE
RTRUE
?ELS46: EQUAL? PRSA,V?RUB,V?TAKE \?ELS50
PRINTR "You'd burn your fingers."
?ELS50: EQUAL? PRSA,V?PUT \?ELS52
EQUAL? PRSI,BLUE-WAX,WHITE-WAX,RED-WAX \?ELS52
CALL PERFORM,V?PUT-ON,PRSI,PRSO
RTRUE
?ELS52: EQUAL? PRSA,V?POUR \?ELS56
EQUAL? PRSO,BLUE-WAX,WHITE-WAX,RED-WAX \?ELS56
CALL PERFORM,V?PUT-ON,PRSO,PRSI
RTRUE
?ELS56: EQUAL? PRSA,V?DROP \?ELS60
PRINTR "Huh?"
?ELS60: EQUAL? PRSA,V?PUT-ON \FALSE
EQUAL? PRSO,BLUE-WAX,RED-WAX,WHITE-WAX \FALSE
FSET? PRSI,WAXED-BIT \?ELS69
CALL YOU-ALREADY
RSTACK
?ELS69: FSET? PRSI,FLAMEBIT \?ELS71
PRINT YOU-CANT
PRINTR "put wax on it while it's burning."
?ELS71: EQUAL? PRSI,GREEN-MATCH,RED-MATCH \?ELS73
FSET PRSI,WAXED-BIT
LOC WAX-COAT-1
ZERO? STACK /?ELS76
MOVE WAX-COAT-2,PRSI
JUMP ?CND74
?ELS76: MOVE WAX-COAT-1,PRSI
?CND74: PRINTR "The match head is now covered with a thin coating of candle wax."
?ELS73: PRINTI "You drip a bit of wax onto"
CALL TPRINT,PRSI
PRINTR ". Rather pointless, really."
.FUNCT PORTRAIT-F
EQUAL? PRSA,V?PULL,V?LOOK-BEHIND,V?MOVE /?THN6
EQUAL? PRSA,V?SWING,V?RAISE \?ELS5
?THN6: FSET? WALL-SAFE,INVISIBLE /?ELS12
CALL YOU-ALREADY
RSTACK
?ELS12: FCLEAR WALL-SAFE,INVISIBLE
PRINTI "You swing"
CALL TPRINT,PORTRAIT
PRINTI " away from the wall and find"
CALL APRINT,WALL-SAFE
PRINTC 46
FSET? GREEN-CARD,INVISIBLE \?ELS19
FCLEAR GREEN-CARD,INVISIBLE
PRINTI " A "
CALL DPRINT,GREEN-CARD
PRINTR " flutters to the floor."
?ELS19: CRLF
RTRUE
?ELS5: EQUAL? PRSA,V?TAKE \?ELS23
PRINTR "It seems to be attached to the wall on one side."
?ELS23: EQUAL? PRSA,V?COVER \?ELS25
EQUAL? PRSO,WALL-SAFE \?ELS25
FSET WALL-SAFE,INVISIBLE
PRINTI "You cover"
CALL TPRINT,WALL-SAFE
PRINTI " with"
CALL TRPRINT,PORTRAIT
RSTACK
?ELS25: EQUAL? PRSA,V?EXAMINE \FALSE
PRINTR "It's a very conservative portrait of Aunt Hildegarde sitting in a Victorian-style chair with Uncle Buddy standing behind her, wearing a black-and-white checkered polyester leisure suit."
.FUNCT WALL-SAFE-F
EQUAL? PRSA,V?TURN-RIGHT,V?TURN-LEFT \?ELS5
EQUAL? PRSI,INTNUM \?ELS5
GRTR? P-NUMBER,10 \?ELS12
PRINTR "The dial only goes to 10."
?ELS12: SET 'DIAL-NUMBER,P-NUMBER
PRINTI "You turn the dial to "
PRINTN DIAL-NUMBER
PRINTC 46
FSET? WALL-SAFE,OPENBIT /?ELS17
ZERO? STEPS-THROUGH-WALL-SAFE \?ELS17
EQUAL? PRSA,V?TURN-RIGHT \?ELS17
EQUAL? DIAL-NUMBER,3 \?ELS17
SET 'STEPS-THROUGH-WALL-SAFE,1
JUMP ?CND15
?ELS17: FSET? WALL-SAFE,OPENBIT /?ELS21
EQUAL? STEPS-THROUGH-WALL-SAFE,1 \?ELS21
EQUAL? PRSA,V?TURN-LEFT \?ELS21
EQUAL? DIAL-NUMBER,7 \?ELS21
SET 'STEPS-THROUGH-WALL-SAFE,2
JUMP ?CND15
?ELS21: FSET? WALL-SAFE,OPENBIT /?ELS25
EQUAL? STEPS-THROUGH-WALL-SAFE,2 \?ELS25
EQUAL? PRSA,V?TURN-RIGHT \?ELS25
EQUAL? DIAL-NUMBER,5 \?ELS25
SET 'STEPS-THROUGH-WALL-SAFE,3
FCLEAR WALL-SAFE,LOCKEDBIT
PRINTI " You hear a faint click."
JUMP ?CND15
?ELS25: SET 'STEPS-THROUGH-WALL-SAFE,0
?CND15: CRLF
RTRUE
?ELS5: EQUAL? PRSA,V?TURN-RIGHT,V?TURN-LEFT,V?TURN \?ELS31
EQUAL? PRSI,FALSE-VALUE,ROOMS \?ELS36
PRINTR "You didn't say what number you wanted to turn the dial to, or the direction."
?ELS36: EQUAL? PRSI,INTNUM \?ELS38
PRINTI "You didn't say whether you wanted to turn the dial RIGHT to "
PRINTN P-NUMBER
PRINTI " or LEFT to "
PRINTN P-NUMBER
PRINTR "."
?ELS38: PRINTR "Huh?"
?ELS31: EQUAL? PRSA,V?EXAMINE \?ELS42
PRINTI "It's a rather large safe with a dial which can be set to any number between 0 and 10. The dial is set to "
PRINTN DIAL-NUMBER
PRINTI ". "
RFALSE
?ELS42: EQUAL? PRSA,V?CLOSE \FALSE
FSET? WALL-SAFE,OPENBIT \FALSE
FSET WALL-SAFE,LOCKEDBIT
SET 'STEPS-THROUGH-WALL-SAFE,0
RFALSE