-
Notifications
You must be signed in to change notification settings - Fork 27
/
jester.zap
1467 lines (1347 loc) · 40.5 KB
/
jester.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
.SEGMENT "0"
.FUNCT JESTER-F,ARG
EQUAL? ARG,M-OBJDESC? /TRUE
EQUAL? ARG,M-OBJDESC \?CCL5
PRINTI " The jester "
IN? COOKPOT,HERE \?CCL8
PRINTI "is here, "
PRINT COOK-DESC
RTRUE
?CCL8: EQUAL? HERE,TAX-OFFICE \?CCL10
IN? ZORKMID-COIN,LOCAL-GLOBALS \?CCL10
PRINT BOOKKEEPER-DESC
RTRUE
?CCL10: ZERO? J-ON-RAFT /?CCL14
PRINTI "lies on an inner tube. His eyes twinkle at you behind his sunglasses."
RTRUE
?CCL14: PRINTI "is nearby, watching you with great amusement."
RTRUE
?CCL5: EQUAL? ARG,M-WINNER \?CCL16
EQUAL? PRSA,V?SAY \?CCL19
EQUAL? HERE,ENTRANCE-HALL \?CCL19
FSET? PORTCULLIS,OPENBIT \FALSE
?CCL19: EQUAL? PRSA,V?SAY \?CCL24
IN? EAST-KEY,JESTER /FALSE
?CCL24: EQUAL? PRSA,V?SAY \?CCL28
EQUAL? HERE,OUBLIETTE /FALSE
?CCL28: PRINTI """Don't waste your breath, for I'd go to any length to avoid a conversation with such depth as yours. Also, silence is the height of fashion nowadays."""
CRLF
CALL1 STOP
RSTACK
?CCL16: EQUAL? PRSA,V?EXAMINE \?CCL32
ZERO? J-ON-RAFT /?CCL35
PRINTR "The jester is wearing dark glasses and floating around on an inner tube."
?CCL35: IN? COOKPOT,HERE \?CCL37
PRINTI "The jester is "
PRINT COOK-DESC
CRLF
RTRUE
?CCL37: EQUAL? HERE,TAX-OFFICE \?CCL39
IN? ZORKMID-COIN,LOCAL-GLOBALS \?CCL39
PRINTI "The jester is "
PRINT BOOKKEEPER-DESC
CRLF
RTRUE
?CCL39: FSET? GOGGLES,WORNBIT \?CCL43
PRINT YOU-SEE
PRINTR " right through the jester's clothes as though they were transparent! Embarassed, you turn away. (But not before noticing that the jester has pink butterflies stitched onto his underwear.)"
?CCL43: PRINTR "The jester is dressed in a green skin-tight suit, and is wearing a hat with many pointy ends. From each end dangles a gaudy little bell. The jester's eyes twinkle with mischievous energy."
?CCL32: EQUAL? PRSA,V?SHOW,V?GIVE \?CCL45
EQUAL? HERE,MARSH,NICE-LUNCH-SPOT \?CCL45
EQUAL? PRSO,FOX,ROOSTER,WORM \?CCL45
PRINTR """Mon Dieu! I must have all zee ingredients together!"""
?CCL45: EQUAL? PRSA,V?GIVE \?CCL50
EQUAL? PRSO,PIGEON \?CCL50
CALL2 META-LOC,PERCH
EQUAL? STACK,HERE \?CCL55
PRINTR "The jester takes the pigeon, looks it over, shrugs, and hands it back."
?CCL55: PRINTI "The jester recedes to a point and vanishes, a look of comical surprise splattered across his wide face."
IN? SHELL-TABLE,HERE \?CND56
PRINTI " The table and shells disappear as well."
?CND56: CRLF
ICALL1 REMOVE-J
SET 'J-DISPOSED,MOVES
LOC PERCH
ZERO? STACK /?CCL60
LOC PERCH
MOVE PIGEON,STACK
RETURN 2
?CCL60: REMOVE PIGEON
RETURN 2
?CCL50: EQUAL? PRSA,V?SHOW \?CCL64
EQUAL? PRSO,NUT \?CCL67
ZERO? NUT-OPENED /?CCL70
SET 'NUT-SHOWN,TRUE-VALUE
PRINTR """True, no one has seen this 'ere me -- but thousands may see it in years to be!"""
?CCL70: PRINTR """Uncertain and skeptical I must be; countless people may have gazed upon this before me."""
?CCL67: EQUAL? PRSO,UNOPENED-NUT,NUT-SHELL \FALSE
PRINTI "The jester cocks one eyebrow"
EQUAL? HERE,WEST-WING \?CND73
PRINTI " and a smile dances at the corners of his mouth"
?CND73: PRINT PERIOD-CR
RTRUE
?CCL64: EQUAL? PRSA,V?KILL,V?EAT \?CCL76
ZERO? ALLIGATOR /?CCL76
PRINTR "The jester jumps nimbly away from your snapping jaws."
?CCL76: EQUAL? PRSA,V?RESEARCH \FALSE
CALL PICTURED-ENTRY,J-ILL,FALSE-VALUE
RSTACK
.SEGMENT "CASTLE"
.FUNCT J-ENTRY
PRINTI """Jesters employ physical, verbal, and magical trickery for the entertainment of king and court. The most recent Royal Jester, the favorite of Lord Wurb Flathead, is named Barbazzo "
GET MID-NAMES,MID-NAME-NUM
PRINT STACK
PRINTR " Fernap."""
.ENDSEG
.SEGMENT "0"
.FUNCT MID-NAME-F
CALL2 VISIBLE?,JESTER
ZERO? STACK /?CCL3
GET MID-NAME-WORDS,MID-NAME-NUM
CALL NOUN-USED?,MID-NAME,STACK
ZERO? STACK /?CCL3
CALL2 PERFORM-PRSA,JESTER
RSTACK
?CCL3: CALL2 HANDLE,MID-NAME
ZERO? STACK \?CCL7
EQUAL? PRSA,V?FOLLOW \FALSE
?CCL7: PRINT BY-THAT-NAME
CALL1 STOP
RSTACK
.FUNCT OTHER-J-NAMES-F
CALL2 VISIBLE?,JESTER
ZERO? STACK /?CCL3
CALL2 PERFORM-PRSA,JESTER
RSTACK
?CCL3: CALL2 HANDLE,OTHER-J-NAMES
ZERO? STACK \?CCL5
EQUAL? PRSA,V?FOLLOW \FALSE
?CCL5: PRINT BY-THAT-NAME
CALL1 STOP
RSTACK
.FUNCT J-GARMENT-F
EQUAL? PRSO,J-POCKET,J-SHOE,J-HAT \?CCL3
CALL2 TOUCHING?,PRSO
ZERO? STACK /?CCL3
PRINTR "The jester dances spryly out of reach."
?CCL3: EQUAL? PRSA,V?LOOK-UNDER,V?LOOK-INSIDE,V?EXAMINE \?CCL7
IN? ZORKMID-BILL,PRSO \?CCL7
FSET? GOGGLES,WORNBIT \?CCL7
PRINT YOU-SEE
PRINTI " right through"
ICALL1 TPRINT-PRSO
PRINTR " as if it were made of glass -- and sure enough, there's the zorkmid bill!"
?CCL7: EQUAL? PRSA,V?EXAMINE \?CCL12
EQUAL? PRSO,J-HAT \?CCL12
PRINTR "It has many floppy tips, with bells dangling from each one."
?CCL12: EQUAL? PRSA,V?POINT \FALSE
EQUAL? HERE,GAMING-ROOM \FALSE
FSET? ZORKMID-BILL,TOUCHBIT /FALSE
IN? ZORKMID-BILL,PRSO \?CCL22
MOVE ZORKMID-BILL,PROTAGONIST
FSET ZORKMID-BILL,TOUCHBIT
PRINTI "The jester looks sheepish. He removes the bill and hands it to you. ""You're pretty slick; you've discovered my trick."""
ICALL1 J-EXITS
ICALL2 INC-SCORE,12
RTRUE
?CCL22: PRINTI "The jester howls with glee, and "
EQUAL? PRSO,J-POCKET \?CCL25
PRINTI "turns his pocket inside out"
JUMP ?CND23
?CCL25: EQUAL? PRSO,J-HAT \?CCL27
PRINTI "removes his hat"
JUMP ?CND23
?CCL27: PRINTI "removes his shoe"
?CND23: PRINTI ". Nothing. "
CALL1 ANOTHER-SHELL-GAME
RSTACK
.FUNCT I-JESTER,CALLED-BY-DOORBELL,PLUR,APPEAR-PROB
ZERO? TIME-STOPPED /?CND1
ICALL2 DEQUEUE,I-JESTER
RFALSE
?CND1: SET 'APPEAR-PROB,J-APPEAR-PROB
EQUAL? HERE,FR-OFFICES,OFFICES-WEST,OFFICES-EAST /?CCL4
EQUAL? HERE,OFFICES-NORTH,OFFICES-SOUTH \?CND3
?CCL4: ADD FLOOR-NUMBER,40
DIV STACK,40
DIV APPEAR-PROB,STACK >APPEAR-PROB
?CND3: ICALL QUEUE,I-JESTER,-1
IN? PROTAGONIST,DB /?CTR8
EQUAL? HERE,INQUISITION,PLAIN /?CTR8
EQUAL? HERE,ENTRANCE-HALL \?CCL9
FSET? PORTCULLIS,OPENBIT /?CCL9
ZERO? CALLED-BY-DOORBELL \?CCL9
?CTR8: RANDOM 5
ICALL QUEUE,I-JESTER,STACK
RFALSE
?CCL9: ZERO? LIT \?CCL17
RANDOM 5
ICALL QUEUE,I-JESTER,STACK
ICALL1 RETURN-FROM-MAP
PRINTI " You hear jingling bells and a familiar laugh in the darkness."
FSET? SECRET-PASSAGE,TOUCHBIT /?CND18
PRINTR " ""Trouble finding a light? I'm just the man to set you right! Tighten your belt and pull up your socks and re-read the book from your ZORK ZERO box! Or,"" the voice asks suspiciously, ""maybe you're one of those software pirates? In that case, I hope you fall into a bottomless pit."""
?CND18: CRLF
RTRUE
?CCL17: ZERO? DO-J \?CTR20
RANDOM 100
LESS? APPEAR-PROB,STACK /?CCL21
?CTR20: SET 'DO-J,FALSE-VALUE
ICALL2 DEQUEUE,I-JESTER
ICALL1 RETURN-FROM-MAP
PRINTI " "
IN? JESTER,HERE /?CND24
ZERO? TURNED-INTO /?CCL28
ICALL1 REMOVE-J
PRINTI "You suddenly notice another "
ICALL2 DPRINT,TURNED-INTO
PRINTI ", wearing a jester's costume. Laughing, it says, ""I'd heard that there was a dauntless adventurer around, but there's no one here but us "
GETP TURNED-INTO,P?PLURAL >PLUR
ZERO? PLUR /?CCL31
PRINT PLUR
JUMP ?CND29
?CCL21: INC 'J-APPEAR-PROB
RFALSE
?CCL31: ICALL2 DPRINT,TURNED-INTO
PRINTC 115
?CND29: PRINTI "!"" Still laughing, the jester/"
ICALL2 DPRINT,TURNED-INTO
PRINTR " vanishes."
?CCL28: CALL2 VISIBLE?,OTTO
ZERO? STACK /?CCL33
PRINTI "You spot a fly wearing a tiny floppy green hat with bells at the tips. Otto spots the fly as well, and begins to salivate. In a high, thin imitation of the jester's voice, the fly cries ""Help me!"" -- but Otto's tongue moves before you can, and in a split-second the jester/fly is gonzo."
RTRUE
?CCL33: IN? PROTAGONIST,YACHT \?CCL35
SET 'J-ON-RAFT,TRUE-VALUE
PRINTI "You notice the jester, floating next to the yacht in an inner tube, wearing sunglasses and lots of tanning lotion."
JUMP ?CND24
?CCL35: FSET? JESTER,TOUCHBIT \?CCL37
PRINTI "The jester appears."
EQUAL? HERE,ICKY-CAVE \?CCL40
IN? SICKLY-WITCH,HERE \?CCL40
PRINT WITCH-REMOVES-J
RTRUE
?CCL40: FSET? HERE,BEYONDBIT \?CND24
PRINTI " ""Hi! Small world, isn't it!"""
JUMP ?CND24
?CCL37: FSET JESTER,TOUCHBIT
PRINTI "You suddenly notice a wiry fellow with an outrageous costume and a feral grin. ""I'm the jester of the castle, I may pester, I may hassle; and I often speak in rhyme, for it helps to pass the time!"""
?CND24: MOVE JESTER,HERE
ICALL2 THIS-IS-IT,JESTER
EQUAL? PRSA,V?TAKE \?CCL46
EQUAL? PRSO,EAST-KEY \?CCL46
FSET? EAST-KEY,TRYTAKEBIT \?CCL46
MOVE EAST-KEY,JESTER
PRINTI " He snatches the key before you can take it."
JUMP ?CND44
?CCL46: EQUAL? HERE,PITS \?CND44
FSET? LANTERN,TRYTAKEBIT \?CND44
PRINTR " He has an enormous slice of watermelon which he devours with juicy abandon, rind and all, and then spits out a stream of pits, which land and turn into even more bottomless pits. ""Don't you hate pits? I know I do!"""
?CND44: CRLF
PRINTI " "
EQUAL? HERE,ENTRANCE-HALL \?CCL55
FSET? PORTCULLIS,OPENBIT \?CCL58
PRINTI "The jester looks at the open portcullis. ""Oh, right! My memory is no longer so great; I've already opened this gate!"""
ICALL1 J-EXITS
JUMP ?CND53
?CCL58: ICALL2 SETUP-ORPHAN,STR?44
PRINTI """If you're quick as a fiddle, and answer this riddle, you'll get what you're hopin' -- the gate will be open!"" The jester clears his throat. """
GETP HERE,P?RIDDLE
PRINT STACK
CRLF
JUMP ?CND53
?CCL55: IN? EAST-KEY,JESTER \?CCL60
ICALL2 SETUP-ORPHAN,STR?44
PRINTI """Before you get this key, you must answer this riddle for me!"" The jester poses theatrically. """
GETP SOLAR,P?RIDDLE
PRINT STACK
CRLF
JUMP ?CND53
?CCL60: EQUAL? HERE,OUBLIETTE \?CCL62
ZERO? OUBLIETTE-SCORE \?CCL65
PRINTI """Trapped again? Don't frown or fret! I'll help you leave the Oubliette! But saving you is such a pain; please don't get stuck down here again!"""
CRLF
CRLF
ICALL2 GOTO,DUNGEON
JUMP ?CND53
?CCL65: ICALL2 SETUP-ORPHAN,STR?44
PRINTI """Don't scream or shout, I'll get you out! But first my thirst for a riddle must be twiddled!"" The jester coughs lightly and begins. """
GETP HERE,P?RIDDLE
PRINT STACK
CRLF
JUMP ?CND53
?CCL62: EQUAL? HERE,WEST-WING \?CCL67
ZERO? NUT-EATEN \?CCL67
PRINT ERE-YOU-PASS
JUMP ?CND53
?CCL67: EQUAL? HERE,GAMING-ROOM \?CCL71
FSET? ZORKMID-BILL,TOUCHBIT /?CCL71
MOVE SHELL-TABLE,HERE
PRINTI """Blackjack... Fanucci... all too tame; let's play the old shell game!"" From thin air, the jester produces a small table, three shells, and a zorkmid bill of high denomination. He arranges the shells in a row on the table and places the bill under the center shell. With hands that move in a dizzying blur, he shuffles the order of the shells. ""Demonstrate your visual skill -- point to the location of the zorkmid bill!"" He motions toward the shells, left, center, and right."
ICALL1 SEE-BILL?
CRLF
JUMP ?CND53
?CCL71: EQUAL? HERE,FR-PENTHOUSE \?CCL75
PRINTI """Your persistence will bring you wide renown; you've reached the four hundredth floor! The hard part now is getting down -- I suggest that you simply RESTORE!"""
CRLF
ICALL1 J-EXITS
JUMP ?CND53
?CCL75: RANDOM 100
LESS? SLATE-PROB,STACK /?CCL77
IN? SLATE,LOCAL-GLOBALS \?CCL77
MOVE SLATE,PROTAGONIST
PRINTI """While cleaning my attic, I found some old haddock, a hammer and nails, some barrels and pails, an old garden gate, and this silly old slate!"" He hands you the slate."
ICALL2 J-EXITS,TRUE-VALUE
JUMP ?CND53
?CCL77: RANDOM 100
LESS? SCROLL-PROB,STACK /?CCL81
IN? SCROLL,LOCAL-GLOBALS \?CCL81
LOC PROTAGONIST
FSET? STACK,DROPBIT \?CCL86
LOC PROTAGONIST
MOVE SCROLL,STACK
JUMP ?CND84
?CCL86: MOVE SCROLL,HERE
?CND84: PRINTI """I thought of no rhyme; my puzzle's on paper this time."" He drops a scroll by your feet."
ICALL2 J-EXITS,TRUE-VALUE
JUMP ?CND53
?CCL81: RANDOM 100
LESS? 25,STACK /?CCL88
FSET? HERE,BEYONDBIT /?CCL88
PRINTI """I've learned from years of loyalty, spinning rhymes for this noble court, that with the attention span of royalty, my poems must be short!"""
ICALL1 J-EXITS
JUMP ?CND53
?CCL88: PRINTI "The jester watches you with twinkling eyes."
CRLF
?CND53: ADD SLATE-PROB,2 >SLATE-PROB
ADD SCROLL-PROB,2 >SCROLL-PROB
RETURN SCROLL-PROB
.FUNCT J-EXITS,JUST-DID-SLATE-OR-SCROLL,DO-FUNNY-PAPER,LIT?
ICALL1 REMOVE-J
RANDOM 100
LESS? FUNNY-PAPER-PROB,STACK /?CND1
IN? FUNNY-PAPER,LOCAL-GLOBALS \?CND1
ZERO? JUST-DID-SLATE-OR-SCROLL \?CND1
SET 'DO-FUNNY-PAPER,TRUE-VALUE
?CND1: RANDOM 100
LESS? 15,STACK /?CCL8
ZERO? DO-FUNNY-PAPER \?CCL8
PRINTR " The jester winces at his rhyming, then shrugs. ""Oh, well, they can't all be gems."" In a wink, he is gone."
?CCL8: RANDOM 100
LESS? 20,STACK /?CND6
IN? PROTAGONIST,HERE \?CND6
EQUAL? HERE,TORTURE-CHAMBER /?CND6
ZERO? DO-FUNNY-PAPER \?CND6
MOVE BEDBUG,HERE
SET 'P-CONT,-1
PRINTR " The jester yawns and says, ""Think I'll catch some winks. Nighty night! Don't let the bedbugs bite!"" As the jester vanishes, you hear the clicking of giant mandibles."
?CND6: PRINTI " The jester gives a cheerful wave of farewell and vanishes, saying, """
ZERO? DO-FUNNY-PAPER /?CCL18
ICALL QUEUE,I-FUNNY-PAPER,2
SET 'FUNNY-PAPER-PROB,0
PRINTI "See you in the funny papers!"" A breeze begins picking up."
CRLF
JUMP ?CND16
?CCL18: RANDOM 100
LESS? 20,STACK /?CCL20
FSET? HERE,DESERTBIT /?CCL20
EQUAL? HERE,LAKE-FLATHEAD,UNDERWATER,LAKE-BOTTOM /?CCL20
EQUAL? HERE,HOLD,GONDOLA /?CCL20
GETP HERE,P?REGION
EQUAL? STACK,STR?249 /?CCL20
PRINTI "See you next week, same bat time, same bat channel!"" A moment later, you hear a shrieking, ""Fweep! Fweep! Fweep!"" A large deranged bat swoops down, snatches you up, and deposits you in"
PRINT ELLIPSIS
MOVE PROTAGONIST,HERE
CALL FIND-IN,PROTAGONIST,ONBIT >LIT?
ZERO? LIT? \?CND27
CALL FIND-IN,HERE,ONBIT >LIT?
ZERO? LIT? /?CND27
MOVE LIT?,PROTAGONIST
?CND27: CALL1 BEYOND-LAKE?
ZERO? STACK \?CTR32
ZERO? LIT? /?CCL33
RANDOM 100
LESS? 25,STACK /?CCL33
?CTR32: PUSH BATS-LAIR
JUMP ?CND31
?CCL33: ZERO? SECRET-PASSAGE-OPEN /?CCL39
ZERO? LIT? /?CCL39
RANDOM 100
LESS? 40,STACK /?CCL39
PUSH PARAPET
JUMP ?CND31
?CCL39: FSET? DRAWBRIDGE,OPENBIT \?CCL44
RANDOM 100
LESS? 50,STACK /?CCL44
PUSH OUTER-BAILEY
JUMP ?CND31
?CCL44: PUSH ROOF
?CND31: ICALL2 GOTO,STACK
JUMP ?CND16
?CCL20: RANDOM 100
LESS? 33,STACK /?CCL48
EQUAL? HERE,UNDER-THE-WORLD,HANGING-FROM-ROOTS,SHOULDER /?CCL48
EQUAL? HERE,EAR,INNER-EAR /?CCL48
ZERO? HUNGER-COUNT \?CCL48
EQUAL? JUMP-X,99 \?CCL48
EQUAL? JUMP-Y,99 \?CCL48
SET 'ALLIGATOR,TRUE-VALUE
ICALL QUEUE,I-UNALLIGATOR,4
PRINTI "See you later, alligator!"" Your skin feels itchy"
FIRST? PROTAGONIST \?CND56
PRINTI " and you've dropped what you were holding"
?CND56: PRINTC 46
LOC PROTAGONIST
FSET? STACK,DROPBIT \?CCL60
LOC PROTAGONIST
JUMP ?CND58
?CCL60: PUSH HERE
?CND58: ICALL ROB,PROTAGONIST,STACK
SET 'P-CONT,-1
CRLF
JUMP ?CND16
?CCL48: RANDOM 100
LESS? 50,STACK \?CTR61
ZERO? ALLIGATOR \?CTR61
FSET? CLOWN-NOSE,WORNBIT \?CCL62
?CTR61: PRINTI "So long, and thanks for all the fish!"" Odd. You've never given the jester any fish."
CRLF
JUMP ?CND16
?CCL62: MOVE CLOWN-NOSE,PROTAGONIST
FSET CLOWN-NOSE,WORNBIT
ICALL QUEUE,I-SUFFOCATE,-1
SET 'P-CONT,-1
PRINTI "Catch you aroun', clown!"" You suddenly find yourself having a bit of difficulty breathing."
CRLF
?CND16: ADD FUNNY-PAPER-PROB,5 >FUNNY-PAPER-PROB
RETURN FUNNY-PAPER-PROB
.FUNCT BEYOND-LAKE?
FSET? HERE,DESERTBIT /TRUE
EQUAL? HERE,STABLE,GROTTO,SHRINE /TRUE
EQUAL? HERE,G-U-MOUNTAIN,STREAM,G-U-WOODS /TRUE
EQUAL? HERE,G-U-SAVANNAH,EAST-SHORE,SOUTH-SHORE /TRUE
EQUAL? HERE,RING-OF-DUNES,BASE-OF-MOUNTAIN /TRUE
RFALSE
.FUNCT REMOVE-J
ICALL QUEUE,I-JESTER,12
SET 'J-APPEAR-PROB,0
SET 'GUESSES,FALSE-VALUE
SET 'J-ON-RAFT,FALSE-VALUE
IN? EAST-KEY,JESTER \?CND1
MOVE EAST-KEY,SOLAR
?CND1: FSET? ZORKMID-BILL,TOUCHBIT /?CND3
MOVE ZORKMID-BILL,LOCAL-GLOBALS
?CND3: REMOVE SHELL-TABLE
REMOVE JESTER
RTRUE
.FUNCT DONT-CRY
INC 'GUESSES
PRINTI """Wrong, but don't "
EQUAL? GUESSES,3 \?CCL3
SET 'GUESSES,0
PRINTI "get all a-twiddle; I'll repeat the riddle! "
GETP HERE,P?RIDDLE
PRINT STACK
CRLF
RTRUE
?CCL3: PRINTR "cry -- give it another try."""
.FUNCT I-UNALLIGATOR
SET 'ALLIGATOR,FALSE-VALUE
ICALL1 RETURN-FROM-MAP
PRINTR " With a pop, your tail and snout shorten, and you are no longer a candidate for being turned into a pair of expensive shoes."
.FUNCT I-SUFFOCATE
FSET? CLOWN-NOSE,WORNBIT /?CND1
SET 'SUFFOCATE-COUNTER,0
ICALL2 DEQUEUE,I-SUFFOCATE
RFALSE
?CND1: INC 'SUFFOCATE-COUNTER
EQUAL? SUFFOCATE-COUNTER,5 \?CCL5
ICALL1 RETURN-FROM-MAP
PRINTR " You're still having trouble breathing. It's probably due to the clown nose that's clamped in the middle of your face."
?CCL5: EQUAL? SUFFOCATE-COUNTER,8 \?CCL7
ICALL1 RETURN-FROM-MAP
PRINTR " It's really getting tough to keep going without fresh air!"
?CCL7: EQUAL? SUFFOCATE-COUNTER,10 \?CCL9
ICALL1 RETURN-FROM-MAP
PRINTR " You're getting lightheaded..."
?CCL9: EQUAL? SUFFOCATE-COUNTER,11 \FALSE
ICALL1 RETURN-FROM-MAP
CALL2 JIGS-UP,STR?928
RSTACK
.FUNCT I-FUNNY-PAPER
LOC PROTAGONIST
MOVE FUNNY-PAPER,STACK
ICALL QUEUE,I-REMOVE-FUNNY-PAPER,1
ICALL2 THIS-IS-IT,FUNNY-PAPER
ICALL1 RETURN-FROM-MAP
PRINTR " The wind blows a colorful piece of newspaper into view. It's a funny paper!"
.FUNCT I-REMOVE-FUNNY-PAPER,TOLD
IN? FUNNY-PAPER,PROTAGONIST /?CND1
CALL2 VISIBLE?,FUNNY-PAPER
ZERO? STACK /?CND3
SET 'TOLD,TRUE-VALUE
ICALL1 RETURN-FROM-MAP
PRINTI " The wind blows the funny paper out of sight."
CRLF
?CND3: MOVE FUNNY-PAPER,LOCAL-GLOBALS
?CND1: ZERO? TOLD \TRUE
RFALSE
.FUNCT FUNNY-PAPER-F
EQUAL? PRSA,V?READ \?CCL3
PRINTI "It's a comic strip entitled ""Me and the Jester."" In the strip, a peasant adventurer is bumbling around a mighty castle, alternately helped and hindered by a playful jester. In one panel, the Jester suggests that the adventurer look under the "
ICALL2 DPRINT,HOLEY-SLAB
PRINTR " in the Crypt."
?CCL3: EQUAL? PRSA,V?FOLLOW \FALSE
PRINTR "You've lost track of it."
.FUNCT BEDBUG-F
EQUAL? PRSA,V?EXAMINE \?CCL3
PRINTR "It's quite larger than any bedbug you've ever seen before: about the size of a small sheep. It looks as if it has just been roused from a deep sleep, and isn't at all happy about the fact. With a mixture of weariness and anger, it waves powerful pincers in your direction."
?CCL3: EQUAL? PRSA,V?LEAP \?CCL5
CALL1 IMPOSSIBLES
RSTACK
?CCL5: EQUAL? PRSA,V?KICK,V?BITE,V?KILL \FALSE
PRINTR "This bedbug's chitinous shell is like battle armor."
.FUNCT CLOWN-NOSE-F
EQUAL? PRSA,V?WEAR \FALSE
FSET? CLOWN-NOSE,WORNBIT /FALSE
FSET CLOWN-NOSE,WORNBIT
ICALL QUEUE,I-SUFFOCATE,-1
PRINTR "You don the nose, which makes breathing extremely difficult."
.FUNCT SLATE-F
EQUAL? PRSA,V?EXAMINE \?CCL3
PRINTR "The small slate is set into a wooden frame. It looks to be at least fifty if not a hundred years old. A shaky hand has inscribed something onto the slate."
?CCL3: EQUAL? PRSA,V?READ \FALSE
ZERO? STUMP-X \?CND6
RANDOM 3 >STUMP-X
RANDOM 100
LESS? 50,STACK /?CND8
MUL STUMP-X,-1 >STUMP-X
?CND8: RANDOM 3 >STUMP-Y
RANDOM 100
LESS? 50,STACK /?CND10
MUL STUMP-Y,-1 >STUMP-Y
?CND10: PRINTI "You shake enough dust off the slate to read it: "
?CND6: PRINTI """Stand at the oldest and mightiest elm around. Jump "
GRTR? STUMP-Y,0 \?CCL14
PRINTI "north "
JUMP ?CND12
?CCL14: PRINTI "south "
?CND12: EQUAL? STUMP-Y,1,-1 \?CCL17
PRINTI "once"
JUMP ?CND15
?CCL17: EQUAL? STUMP-Y,2,-2 \?CCL19
PRINTI "twice"
JUMP ?CND15
?CCL19: PRINTI "thrice"
?CND15: PRINTI " then jump "
GRTR? STUMP-X,0 \?CCL22
PRINTI "east "
JUMP ?CND20
?CCL22: PRINTI "west "
?CND20: EQUAL? STUMP-X,1,-1 \?CCL25
PRINTI "once"
JUMP ?CND23
?CCL25: EQUAL? STUMP-X,2,-2 \?CCL27
PRINTI "twice"
JUMP ?CND23
?CCL27: PRINTI "thrice"
?CND23: PRINTR "."""
.FUNCT SCROLL-F
EQUAL? PRSA,V?EXAMINE,V?READ \FALSE
PRINTI "The paper reads:"
CRLF
CRLF
PRINTI " "
HLIGHT H-ITALIC
PRINTI "RAM A NAG"
CRLF
CRLF
HLIGHT H-NORMAL
PRINTR "TREEN RIBARLY HENT HOCUT MORRA RICHET"
.ENDSEG
.SEGMENT "CASTLE"
.FUNCT SHELL-F
EQUAL? PRSA,V?POINT \?CCL3
PRINTI "The jester lifts the shell. Empty. "
CALL1 ANOTHER-SHELL-GAME
RSTACK
?CCL3: EQUAL? PRSA,V?MOVE,V?LOOK-UNDER,V?TOUCH /?CTR4
EQUAL? PRSA,V?TAKE \?CCL5
?CTR4: PRINTR "The jester stops you, saying, ""You deserve a beating for trying such cheating!"""
?CCL5: EQUAL? PRSA,V?EXAMINE,V?LOOK-INSIDE \FALSE
FSET? GOGGLES,WORNBIT \FALSE
PRINTR "Thanks to the goggles, you can see right through the shell as though it were transparent! There's nothing under it."
.FUNCT ANOTHER-SHELL-GAME
PRINTI """Don't be sore, let's try it once more!"" He reshuffles the shells."
MOVE ZORKMID-BILL,LOCAL-GLOBALS
ICALL1 SEE-BILL?
CRLF
RTRUE
.FUNCT SEE-BILL?,BILL-LOC
FSET? GOGGLES,WORNBIT \FALSE
RANDOM 100
LESS? 33,STACK /?CCL6
SET 'BILL-LOC,J-POCKET
JUMP ?CND4
?CCL6: RANDOM 100
LESS? 50,STACK /?CCL8
SET 'BILL-LOC,J-SHOE
JUMP ?CND4
?CCL8: SET 'BILL-LOC,J-HAT
?CND4: MOVE ZORKMID-BILL,BILL-LOC
PRINTI " You find that you can see right through the shells -- and the zorkmid bill isn't under any of them! Before you can say so, you notice the bill -- "
EQUAL? BILL-LOC,J-HAT \?CCL11
PRINTI "under"
JUMP ?CND9
?CCL11: PRINTI "in"
?CND9: ICALL2 TPRINT,BILL-LOC
PRINTI "! After a moment, the vision fades, and"
ICALL2 TPRINT,BILL-LOC
PRINTI " once again appears opaque."
RTRUE
.FUNCT JESTERS-QUARTERS-F,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "This is a small, spare room. The only features are a small louvered door on the south wall, a larger arched door on the north wall, and a stair which spirals downward. "
FSET? LARGE-DOOR,OPENBIT \?CCL6
PRINTI "The large door is open but the small door is"
JUMP ?CND4
?CCL6: PRINTI "Both doors are"
?CND4: PRINTI " closed."
RTRUE
.FUNCT SMALL-DOOR-ENTER-F,RARG
ZERO? RARG \FALSE
ICALL1 RETURN-FROM-MAP
ICALL DO-FIRST,STR?140,SMALL-DOOR
ICALL2 THIS-IS-IT,SMALL-DOOR
RFALSE
.FUNCT LARGE-DOOR-F
EQUAL? PRSA,V?OPEN \FALSE
ZERO? TOWER-BEATEN \FALSE
PRINTR "Although there's no visible lock, the door refuses to budge."
.FUNCT G-J-DOOR-F,TBL,LEN
EQUAL? PRSA,V?OPEN \?CCL3
FSET? LARGE-DOOR,OPENBIT \?CCL3
RETURN SMALL-DOOR
?CCL3: EQUAL? PRSA,V?CLOSE \FALSE
FSET? LARGE-DOOR,OPENBIT \FALSE
RETURN LARGE-DOOR
.FUNCT SMALL-DOOR-F,WEIGHT-CNT,FUDGE,?TMP1,?TMP2
EQUAL? PRSA,V?LOOK-BEHIND,V?OPEN \?CCL3
ICALL2 PICINF-PLUS-ONE,B-1-L-PIC-LOC
GET PICINF-TBL,0
PUT B-Y-TBL,5,STACK
GET PICINF-TBL,1
PUT B-X-TBL,0,STACK
ICALL2 PICINF-PLUS-ONE,B-2-C-PIC-LOC
GET PICINF-TBL,0
PUT B-Y-TBL,4,STACK
GET PICINF-TBL,1
PUT B-X-TBL,1,STACK
ICALL2 PICINF-PLUS-ONE,B-3-R-PIC-LOC
GET PICINF-TBL,0
PUT B-Y-TBL,3,STACK
GET PICINF-TBL,1
PUT B-X-TBL,2,STACK
ICALL2 PICINF-PLUS-ONE,B-4-PIC-LOC
GET PICINF-TBL,0
PUT B-Y-TBL,2,STACK
ICALL2 PICINF-PLUS-ONE,B-5-PIC-LOC
GET PICINF-TBL,0
PUT B-Y-TBL,1,STACK
ICALL2 PICINF-PLUS-ONE,B-6-PIC-LOC
GET PICINF-TBL,0
PUT B-Y-TBL,0,STACK
FSET SMALL-DOOR,OPENBIT
SET 'TOWER-CHANGED,FALSE-VALUE
ICALL SPLIT-BY-PICTURE,B-SPLIT,TRUE-VALUE
ICALL2 ADJUST-TEXT-WINDOW,B-BOTTOM
ICALL1 DRAW-TOWER
PRINTI "Opening the door reveals a tiny nook containing a Tower of Bozbar, consisting of 3 pegs and "
CALL2 CCOUNT,LEFT-PEG >?TMP2
CALL2 CCOUNT,RIGHT-PEG
ADD ?TMP2,STACK >?TMP1
CALL2 CCOUNT,CENTER-PEG
ADD ?TMP1,STACK >WEIGHT-CNT
PRINTN WEIGHT-CNT
PRINTI " cylindrical weight"
EQUAL? WEIGHT-CNT,1 /?CND4
PRINTC 115
?CND4: EQUAL? WEIGHT-CNT,6 \?CND6
PRINTI " ranging from a 1-ugh to a 6-ugh weight"
?CND6: PRINT PERIOD-CR
PRINTI " Type the number of the weight you want to move, followed by the peg you want to move it to: L, C, or R. "
ZERO? ACTIVE-MOUSE /?CND8
PRINTI "Or, if you'd rather use your mouse, click on the weight you want to move, then click on the peg you want to move it to. "
?CND8: PRINTI "You can Undo your move by typing U"
ZERO? ACTIVE-MOUSE /?CND10
PRINTI " (or clicking on the UNDO spot)"
?CND10: GET 0,8
BTST STACK,8 /?CCL14
PRINTI " -- even though Undo doesn't normally work on your system!"
JUMP ?CND12
?CCL14: PRINTC 46
?CND12: PRINTI " Type X"
ZERO? ACTIVE-MOUSE /?CND15
PRINTI " (or click on the EXIT spot)"
?CND15: PRINTI " to exit."
ICALL1 TOWER-MODE
CRLF
CRLF
ICALL1 HIT-ANY-KEY
ICALL2 INIT-SL-WITH-SPLIT,TEXT-WINDOW-PIC-LOC
RTRUE
?CCL3: EQUAL? PRSA,V?EXAMINE \?CCL18
PRINTR "The small door is closed."
?CCL18: EQUAL? PRSA,V?CLOSE \FALSE
PRINTR "It is!"
.FUNCT WEIGHT-F,CNT,RECURSING
EQUAL? PRSA,V?MOVE-TO \FALSE
EQUAL? PRSI,RIGHT-PEG,CENTER-PEG,LEFT-PEG \FALSE
IN? PRSO,PRSI \?CCL8
PRINTI "It's already on that peg."
RTRUE
?CCL8: CALL2 NOT-TOP-WEIGHT,PRSO
ZERO? STACK /?CCL10
PRINTI "You can only move the weight that's on top!"
RTRUE
?CCL10: SET 'TOWER-CHANGED,TRUE-VALUE
ICALL MOVE-WEIGHT,PRSO,PRSI
MOVE PRSO,PRSI
PRINTI "You move"
ICALL1 TPRINT-PRSO
PRINTI " to"
ICALL1 TPRINT-PRSI
?PRG11: CALL CRUSH-WEIGHT,PRSO,PRSI,RECURSING
ZERO? STACK /?REP12
SET 'RECURSING,TRUE-VALUE
JUMP ?PRG11
?REP12: ZERO? TOWER-BEATEN /?CND16
SET 'TOWER-BEATEN,FALSE-VALUE
FSET? LARGE-DOOR,OPENBIT \?CND16
FCLEAR LARGE-DOOR,OPENBIT
PRINTI ". The large door to the north swings silently shut"
?CND16: PRINTC 46
RTRUE
.FUNCT TOWER-MODE,CHAR,WGT,PEG,X,JUST-UNDID,?TMP1
?PRG1: ZERO? TOWER-CHANGED /?CND3
ZERO? JUST-UNDID \?CND3
CALL1 TOWER-WIN-CHECK >TOWER-BEATEN
ZERO? TOWER-BEATEN /?CND3
PRINTI " You hear a ""click"" from the direction of the Tower"
EQUAL? TOWER-BEATEN,PYRAMID /?CND8
PRINTI ". It tilts to the "
EQUAL? TOWER-BEATEN,PYRAMID-L \?CCL12
PRINTI "left"
JUMP ?CND8
?CCL12: PRINTI "right"
?CND8: FSET WEIRD,REDESCBIT
FCLEAR SMALL-DOOR,OPENBIT
PRINTI ". The small louvered door swings silently shut."
RTRUE
?CND3: ZERO? DEMO-VERSION? /?CCL15
CALL2 INPUT-DEMO,1 >CHAR
JUMP ?CND13
?CCL15: INPUT 1 >CHAR
?CND13: ICALL1 MOUSE-INPUT?
EQUAL? CHAR,CLICK1,CLICK2 \?CND16
CALL1 B-MOUSE-WEIGHT-PICK >CHAR
?CND16: CLEAR S-TEXT
EQUAL? CHAR,88,120 \?CCL20
PRINTI "You shut the louvered door, concealing the Tower of Bozbar from view."
RTRUE
?CCL20: EQUAL? CHAR,85,117 \?CCL22
ZERO? TOWER-CHANGED \?CCL25
PRINTI "You can't undo until you make a move!"
JUMP ?PRG1
?CCL25: ZERO? JUST-UNDID /?CCL27
PRINTI "You just undid; you can't undo again until you move again!"
JUMP ?PRG1
?CCL27: SET 'JUST-UNDID,TRUE-VALUE
ICALL1 B-RESTORE
ICALL2 DRAW-TOWER,TRUE-VALUE
PRINTI "Undone."
JUMP ?PRG1
?CCL22: EQUAL? CHAR,49,50,51 /?CTR28
EQUAL? CHAR,52,53,54 /?CTR28
EQUAL? CHAR,146,147,148 /?CTR28
EQUAL? CHAR,149,150,151 \?CCL29
?CTR28: EQUAL? CHAR,49,146 \?CCL36
SET 'WGT,1-WEIGHT
JUMP ?CND34
?CCL36: EQUAL? CHAR,50,147 \?CCL38
SET 'WGT,2-WEIGHT
JUMP ?CND34
?CCL38: EQUAL? CHAR,51,148 \?CCL40
SET 'WGT,3-WEIGHT
JUMP ?CND34
?CCL40: EQUAL? CHAR,52,149 \?CCL42
SET 'WGT,4-WEIGHT
JUMP ?CND34
?CCL42: EQUAL? CHAR,53,150 \?CCL44
SET 'WGT,5-WEIGHT
JUMP ?CND34
?CCL44: SET 'WGT,6-WEIGHT
?CND34: LOC WGT
EQUAL? STACK,LEFT-PEG,CENTER-PEG,RIGHT-PEG /?CCL47
PRINTI "There's no "
ICALL2 DPRINT,WGT
PRINTI " anymore -- you crushed it."
JUMP ?PRG1
?CCL47: ZERO? ACTIVE-MOUSE /?CCL50
PRINTI "Use your mouse or t"
JUMP ?CND48
?CCL50: PRINTC 84
?CND48: PRINTI "ype L (left) or C (center) or R (right) to specify the peg you'd like to move the "
ICALL2 DPRINT,WGT
PRINTI " to."
ZERO? DEMO-VERSION? /?CCL53
CALL2 INPUT-DEMO,1 >CHAR
JUMP ?CND51
?CCL53: INPUT 1 >CHAR
?CND51: ICALL1 MOUSE-INPUT?
EQUAL? CHAR,CLICK1,CLICK2 \?CND54
CALL1 B-MOUSE-PEG-PICK >CHAR
?CND54: CLEAR S-TEXT
EQUAL? CHAR,76,108,82 /?CCL58
EQUAL? CHAR,114,67,99 /?CCL58
PRINTI "Next time, "
EQUAL? CHAR,CLICK1 \?CCL63
PRINTI "click on the left, center, or right peg!"
JUMP ?PRG1
?CCL63: PRINTI "type R (right), L (left), or C (center) to specify a destination peg!"
JUMP ?PRG1
?CCL58: EQUAL? CHAR,76,108 \?CCL66
SET 'PEG,LEFT-PEG
JUMP ?CND64
?CCL66: EQUAL? CHAR,82,114 \?CCL68
SET 'PEG,RIGHT-PEG
JUMP ?CND64
?CCL68: SET 'PEG,CENTER-PEG
?CND64: ICALL1 B-SAVE
ZERO? TOWER-CHANGED /?PRD72
ZERO? JUST-UNDID /?CND69
?PRD72: ZERO? ACTIVE-MOUSE /?CND69
ICALL2 PICINF-PLUS-ONE,TOWER-UNDO-BOX-LOC
SCREEN S-WINDOW
GET PICINF-TBL,0 >?TMP1
GET PICINF-TBL,1
DISPLAY UNDO-BOX,?TMP1,STACK
SCREEN S-TEXT
?CND69: SET 'JUST-UNDID,FALSE-VALUE
CALL PERFORM,V?MOVE-TO,WGT,PEG >X
JUMP ?PRG1
?CCL29: EQUAL? CHAR,76,108,82 /?CTR75
EQUAL? CHAR,114,67,99 \?CCL76
?CTR75: PRINTI "You must select a weight before you select a destination!"
JUMP ?PRG1
?CCL76: PRINT TYPE-A-NUMBER
PRINTI "6, U for Undo, or X to eXit the Tower of Bozbar game."
JUMP ?PRG1
.FUNCT B-MOUSE-PEG-PICK,TL-X,TL-Y,BR-X,BR-Y,WEIGHT-WIDTH,WEIGHT-HEIGHT
PICINF B-1-WEIGHT,PICINF-TBL /?BOGUS1
?BOGUS1: GET PICINF-TBL,1 >WEIGHT-WIDTH
GET PICINF-TBL,0 >WEIGHT-HEIGHT
ICALL2 PICINF-PLUS-ONE,B-1-L-PIC-LOC
GET PICINF-TBL,0 >TL-Y
GET PICINF-TBL,1 >TL-X
ADD WEIGHT-WIDTH,TL-X >BR-X
ICALL2 PICINF-PLUS-ONE,B-6-PIC-LOC
GET PICINF-TBL,0
ADD STACK,TL-Y >BR-Y
CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
ZERO? STACK /?CND2
RETURN 76
?CND2: ICALL2 PICINF-PLUS-ONE,B-2-C-PIC-LOC
GET PICINF-TBL,1 >TL-X
ADD WEIGHT-WIDTH,TL-X >BR-X
CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
ZERO? STACK /?CND4
RETURN 67
?CND4: ICALL2 PICINF-PLUS-ONE,B-3-R-PIC-LOC
GET PICINF-TBL,1 >TL-X
ADD WEIGHT-WIDTH,TL-X >BR-X
CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
ZERO? STACK /?CCL8
RETURN 82
?CCL8: SOUND 1
RETURN CLICK1
.FUNCT B-MOUSE-WEIGHT-PICK,TL-X,TL-Y,BR-X,BR-Y,NUM,TBL,CNT-X,CNT-Y,WEIGHT-WIDTH,WEIGHT-HEIGHT
ICALL2 PICINF-PLUS-ONE,TOWER-UNDO-BOX-LOC
GET PICINF-TBL,1 >TL-X
GET PICINF-TBL,0 >TL-Y
PICINF UNDO-BOX,PICINF-TBL /?BOGUS1
?BOGUS1: GET PICINF-TBL,1
ADD TL-X,STACK >BR-X
GET PICINF-TBL,0
ADD TL-Y,STACK >BR-Y
CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
ZERO? STACK /?CND2
RETURN 85
?CND2: ICALL2 PICINF-PLUS-ONE,TOWER-EXIT-BOX-LOC
GET PICINF-TBL,1 >TL-X
GET PICINF-TBL,0 >TL-Y
PICINF EXIT-BOX,PICINF-TBL /?BOGUS4
?BOGUS4: GET PICINF-TBL,1
ADD TL-X,STACK >BR-X
GET PICINF-TBL,0
ADD TL-Y,STACK >BR-Y
CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
ZERO? STACK /?CND5
RETURN 88
?CND5: PICINF B-1-WEIGHT,PICINF-TBL /?BOGUS7
?BOGUS7: GET PICINF-TBL,1 >WEIGHT-WIDTH
GET PICINF-TBL,0 >WEIGHT-HEIGHT
SET 'TBL,LEFT-PEG-TABLE
?PRG10: GET B-X-TBL,CNT-X >TL-X
GET B-Y-TBL,CNT-Y >TL-Y
ADD TL-X,WEIGHT-WIDTH >BR-X
ADD TL-Y,WEIGHT-HEIGHT >BR-Y
CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
ZERO? STACK /?CND12
GET TBL,CNT-Y >NUM
ZERO? NUM /?CND12
GETP NUM,P?SIZE >NUM
?CND12: INC 'CNT-Y
ZERO? NUM \?REP11
EQUAL? CNT-Y,6 \?PRG10
?REP11: ZERO? NUM \?REP9
ZERO? CNT-X \?CCL24
SET 'CNT-X,1
SET 'CNT-Y,0
SET 'TBL,CENTER-PEG-TABLE
JUMP ?PRG10
?CCL24: EQUAL? CNT-X,1 \?REP9
SET 'CNT-X,2
SET 'CNT-Y,0
SET 'TBL,RIGHT-PEG-TABLE
JUMP ?PRG10
?REP9: ZERO? NUM /?CCL29
ADD NUM,48
RSTACK
?CCL29: SOUND 1
RETURN CLICK1
.FUNCT TOWER-WIN-CHECK
IN? 1-WEIGHT,LEFT-PEG \?CCL3
IN? 2-WEIGHT,LEFT-PEG \?CCL3
IN? 3-WEIGHT,LEFT-PEG \?CCL3
IN? 4-WEIGHT,LEFT-PEG \?CCL3
IN? 5-WEIGHT,LEFT-PEG \?CCL3
IN? 6-WEIGHT,LEFT-PEG \?CCL3
RETURN PYRAMID-L