-
Notifications
You must be signed in to change notification settings - Fork 16
/
globals.zap
1010 lines (879 loc) · 24.7 KB
/
globals.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 TELL-DIRECTION:ANY:1:1,DIR
EQUAL? DIR,P?SOUTH \?CCL3
PRINTI "south"
RTRUE
?CCL3: EQUAL? DIR,P?NORTH \?CCL5
PRINTI "north"
RTRUE
?CCL5: EQUAL? DIR,P?WEST \?CCL7
PRINTI "west"
RTRUE
?CCL7: EQUAL? DIR,P?EAST \?CCL9
PRINTI "east"
RTRUE
?CCL9: EQUAL? DIR,P?SW \?CCL11
PRINTI "southwest"
RTRUE
?CCL11: EQUAL? DIR,P?NW \?CCL13
PRINTI "northwest"
RTRUE
?CCL13: EQUAL? DIR,P?SE \?CCL15
PRINTI "southeast"
RTRUE
?CCL15: EQUAL? DIR,P?NE \?CCL17
PRINTI "northeast"
RTRUE
?CCL17: EQUAL? DIR,P?PORT \?CCL19
PRINTI "port"
RTRUE
?CCL19: EQUAL? DIR,P?STARBOARD \?CCL21
PRINTI "starboard"
RTRUE
?CCL21: EQUAL? DIR,P?FORE \FALSE
PRINTI "straight"
RTRUE
.FUNCT GENERIC-NORTH-F:ANY:2:2,R,F
RETURN INTDIR
.FUNCT INTNUM-F:ANY:0:0
EQUAL? PRSO,INTNUM \FALSE
EQUAL? PRSA,V?PUSH \FALSE
PRINT STR?209
PRINTR "to push here."
.FUNCT HIM-F:ANY:0:3,RARG,O,H
ASSIGNED? 'O /?CND1
SET 'O,HIM
?CND1: ASSIGNED? 'H /?CND3
SET 'H,P-HIM-OBJECT
?CND3: ZERO? RARG \FALSE
ZERO? H /?CCL9
EQUAL? PRSA,V?TELL /?PRD14
EQUAL? PRSA,V?TELL-ABOUT,V?ASK-ABOUT \?CCL12
EQUAL? PRSO,O \?CCL12
?PRD14: CALL2 ACCESSIBLE?,H
ZERO? STACK \?CCL12
ICALL2 CTHE-PRINT,H
PRINTI " isn't here."
CRLF
EQUAL? PRSA,V?TELL \FALSE
ICALL1 END-QUOTE
RETURN M-FATAL
?CCL12: EQUAL? WINNER,O \?CND22
SET 'WINNER,H
?CND22: EQUAL? PRSS,O \?CND24
SET 'PRSS,H
?CND24: ICALL REDIRECT,O,H
RTRUE
?CCL9: ICALL1 MORE-SPECIFIC
EQUAL? PRSA,V?TELL \TRUE
ICALL1 END-QUOTE
RETURN M-FATAL
.FUNCT HER-F:ANY:0:1,RARG
CALL HIM-F,RARG,HER,P-HER-OBJECT
RSTACK
.FUNCT LIGHT-F:ANY:0:0
EQUAL? PRSA,V?THROUGH \?CCL3
CALL2 DO-WALK,P?OUT
RSTACK
?CCL3: EQUAL? PRSA,V?LAMP-ON \?CCL5
ZERO? LIT /?CCL8
PRINT IT-IS-ALREADY
PRINTI "light"
PRINT PERIOD
RTRUE
?CCL8: PRINTR "You need a light source!"
?CCL5: EQUAL? PRSA,V?LAMP-OFF \FALSE
PRINT WASTE-OF-TIME
RTRUE
.FUNCT LG-HOLE-F:ANY:0:0
EQUAL? PRSA,V?DIG \?CCL3
EQUAL? PRSO,LG-HOLE \?CCL3
ICALL PERFORM,V?DIG,PRSI
RTRUE
?CCL3: EQUAL? PRSA,V?REACH-IN \FALSE
PRINT YOU-FIND-NOTHING
PRINTR " of interest."
.FUNCT CEILING-F:ANY:0:0
EQUAL? PRSA,V?LOOK-UNDER \FALSE
ICALL2 NEW-VERB,V?LOOK
RTRUE
.FUNCT COJONES-F:ANY:0:0
EQUAL? PRSA,V?EXAMINE \?CCL3
CALL2 HELD?,CLOTHES
ZERO? STACK /?PRD8
FSET? CLOTHES,WEARBIT /?CTR5
?PRD8: CALL2 HELD?,KIMONO
ZERO? STACK /?CCL6
FSET? KIMONO,WEARBIT \?CCL6
?CTR5: PRINTR "What an embarrassing idea!"
?CCL6: EQUAL? HERE,BATH-HOUSE \?CCL14
PRINTR "There are more than enough people doing that already.The thought enough makes you blush."
?CCL14: PRINTR "They're still there."
?CCL3: EQUAL? PRSA,V?WALK-TO \?CCL16
ICALL PERFORM,V?ACT,CRAZY
RTRUE
?CCL16: EQUAL? PRSA,V?WHAT \FALSE
PRINTR "As your mother might have said, ""They are what a bull has that a steer hasn't."""
.FUNCT MOUTH-F:ANY:0:0
EQUAL? PRSA,V?OPEN,V?CLOSE \FALSE
PRINTR "They say a closed mouth gathers no foot."
.FUNCT EYES-F:ANY:0:0
EQUAL? PRSA,V?EXAMINE \?CCL3
PRINTR "You have no mirror."
?CCL3: EQUAL? PRSA,V?OPEN \?CCL5
PRINTR "They are."
?CCL5: EQUAL? PRSA,V?CLOSE \FALSE
PRINTR "That won't help."
.FUNCT LIST-PEOPLE:ANY:3:5,TEST,SI,PL,RM,DESC,F,LAST,1ST?
ASSIGNED? 'RM /?CND1
SET 'RM,HERE
?CND1: FIRST? RM >F /?BOGUS3
?BOGUS3: SET 'LAST,FALSE-VALUE
SET '1ST?,TRUE-VALUE
?PRG4: ZERO? F \?CCL8
ZERO? LAST /?CCL11
ZERO? 1ST? /?CCL14
PRINTI "The only "
PRINT SI
PRINTC 32
EQUAL? RM,HERE \?CCL17
PRINTI "here"
JUMP ?CND15
?CCL17: PRINT DESC
?CND15: PRINTI " is "
JUMP ?CND12
?CCL14: PRINTI " and "
?CND12: ICALL2 DPRINT,LAST
PRINTC 46
RTRUE
?CCL11: PRINT STR?210
PRINT PL
PRINTC 32
EQUAL? RM,HERE \?CCL20
PRINTI "here"
JUMP ?CND18
?CCL20: PRINT DESC
?CND18: PRINTC 46
RTRUE
?CCL8: CALL TEST,F
ZERO? STACK /?CND6
ZERO? LAST /?CND22
ZERO? 1ST? /?CND24
SET '1ST?,FALSE-VALUE
PRINTI "The "
PRINT PL
PRINTC 32
EQUAL? RM,HERE \?CCL28
PRINTI "here"
JUMP ?CND26
?CCL28: PRINT DESC
?CND26: PRINTI " are"
?CND24: PRINTC 32
ICALL2 DPRINT,LAST
PRINTC 44
?CND22: SET 'LAST,F
?CND6: NEXT? F >F /?PRG4
JUMP ?PRG4
.FUNCT LG-MEN-F:ANY:0:1,RARG
EQUAL? RARG,M-WINNER \?CCL3
PRINT STR?211
CRLF
RTRUE
?CCL3: EQUAL? RARG,FALSE-VALUE \FALSE
EQUAL? PRSA,V?EXAMINE \?CCL8
ICALL LIST-PEOPLE,MAN?,STR?212,STR?213
CRLF
RTRUE
?CCL8: EQUAL? PRSA,V?TELL /?CTR9
EQUAL? PRSA,V?TELL-ABOUT \?CCL10
EQUAL? PRSO,LG-MEN \?CCL10
?CTR9: PRINT STR?214
CRLF
ICALL1 END-QUOTE
RETURN M-FATAL
?CCL10: CALL1 HOSTILE-VERB?
ZERO? STACK /FALSE
CALL1 MORE-SPECIFIC
RSTACK
.FUNCT MAN?:ANY:1:1,OBJ
EQUAL? OBJ,LG-MEN /FALSE
FSET? OBJ,PERSON \FALSE
FSET? OBJ,FEMALE /FALSE
RTRUE
.FUNCT LG-WOMEN-F:ANY:0:1,RARG
EQUAL? RARG,M-WINNER \?CCL3
PRINT STR?211
CRLF
RTRUE
?CCL3: EQUAL? RARG,FALSE-VALUE \FALSE
EQUAL? PRSA,V?EXAMINE \?CCL8
ICALL LIST-PEOPLE,WOMAN?,STR?215,STR?216
CRLF
RTRUE
?CCL8: EQUAL? PRSA,V?TELL /?CTR9
EQUAL? PRSA,V?TELL-ABOUT \?CCL10
EQUAL? PRSO,LG-WOMEN \?CCL10
?CTR9: PRINT STR?214
CRLF
ICALL1 END-QUOTE
RETURN M-FATAL
?CCL10: CALL1 HOSTILE-VERB?
ZERO? STACK /FALSE
CALL1 MORE-SPECIFIC
RSTACK
.FUNCT WOMAN?:ANY:1:1,OBJ
EQUAL? OBJ,LG-WOMEN /FALSE
FSET? OBJ,PERSON \FALSE
FSET? OBJ,FEMALE /TRUE
RFALSE
.FUNCT YOU-F:ANY:0:1,RARG
EQUAL? RARG,M-SUBJ /FALSE
EQUAL? RARG,M-WINNER \?CCL5
PRINT STR?211
CRLF
RTRUE
?CCL5: EQUAL? PRSA,V?WHO \?CCL7
CALL1 TRY-QCONTEXT?
ZERO? STACK \TRUE
CALL1 MORE-SPECIFIC
RSTACK
?CCL7: EQUAL? WINNER,PLAYER \FALSE
CALL REDIRECT,YOU,ME
RSTACK
.FUNCT MENTAL-COLLAPSE:ANY:0:0
PRINTR "Talking to yourself is a sign of impending mental collapse."
.FUNCT ME-F:ANY:0:1,RARG,OLIT
EQUAL? RARG,M-SUBJ /FALSE
EQUAL? PRSA,V?HOW \?CCL5
ICALL2 PERFORM,V?DIAGNOSE
RTRUE
?CCL5: EQUAL? PRSA,V?WEAR \?CCL7
CALL2 ACCESSIBLE?,CLOTHES
ZERO? STACK /?CCL10
ICALL PERFORM,V?WEAR,CLOTHES
RTRUE
?CCL10: PRINTR "You can't see any clothes here."
?CCL7: EQUAL? PRSA,V?CROSS \?CCL12
EQUAL? PRSO,ME \?CCL12
ICALL PERFORM,V?MAKE,SIGN-OF-CROSS
RTRUE
?CCL12: EQUAL? PRSA,V?BE?,V?BE,V?WHERE /?CTR15
EQUAL? PRSA,V?HOW \?CCL16
?CTR15: EQUAL? PRSA,V?WHERE \?CCL21
CALL1 TRY-QCONTEXT?
ZERO? STACK \TRUE
?CCL21: ICALL REDIRECT,ME,PLAYER
RTRUE
?CCL16: EQUAL? PRSA,V?WHO,V?WHAT \?CCL25
PRINTI "You are John Blackthorne, Pilot-Major of the "
ICALL2 PRINTUNDER,STR?7
PRINTR ", a Dutch merchanter out of Rotterdam.You are an Englishman chosen as Pilot because you speak Dutch, courtesy of your Dutch mother.You also speak Spanish, Portuguese, and Latin."
?CCL25: EQUAL? PRSA,V?FIND \?CCL27
PRINTI "You are "
EQUAL? SCENE,S-ERASMUS \?CCL30
PRINTI "aboard the "
ICALL2 PRINTUNDER,STR?7
PRINTR "."
?CCL30: EQUAL? SCENE,S-ANJIRO,S-YABU,S-PIT /?CTR31
EQUAL? SCENE,S-RODRIGUES \?CCL32
?CTR31: PRINTR "in the Japanese fishing village of Anjiro."
?CCL32: EQUAL? SCENE,S-VOYAGE \?CCL36
PRINTR "on your way to Osaka, at the command of Lord Toranaga."
?CCL36: EQUAL? SCENE,S-TORANAGA \?CCL38
PRINTR "in Lord Toranaga's court in Osaka Castle."
?CCL38: EQUAL? SCENE,S-PRISON \?CCL40
PRINTR "in the prison of Osaka Castle."
?CCL40: EQUAL? SCENE,S-ESCAPE \?CCL42
PRINTR "in the great city and castle of Osaka."
?CCL42: EQUAL? SCENE,S-OCHIBA,S-DEPARTURE,S-SEPPUKU /?CTR43
EQUAL? SCENE,S-NINJA \?CCL44
?CTR43: PRINTR "in Osaka Castle."
?CCL44: PRINTR "in Japan."
?CCL27: EQUAL? PRSA,V?EXAMINE \?CCL48
EQUAL? PRSO,ME \?CCL48
FSET? KIMONO,WEARBIT /?CTR52
FSET? SOCKS,WEARBIT /?CTR52
FSET? SANDALS,WEARBIT /?CTR52
FSET? SLIPPERS,WEARBIT \?CCL53
?CTR52: SET 'D-BIT,WEARBIT
ICALL2 DESCRIBE-SENT,WINNER
SET 'D-BIT,FALSE-VALUE
RTRUE
?CCL53: CALL2 HELD?,CLOTHES
ZERO? STACK /?CCL59
FSET? CLOTHES,WEARBIT \?CCL59
PRINTI "You are dressed in "
EQUAL? SCENE,S-ERASMUS \?CCL64
PRINTI "worn, dirty clothes"
CALL2 HELD?,BOOTS
ZERO? STACK /?CND65
FSET? BOOTS,WEARBIT \?CND65
PRINTI " and salt-stained boots"
?CND65: PRINTR "."
?CCL64: PRINTI "your old clothes, which have been cleaned and mended"
CALL2 HELD?,BOOTS
ZERO? STACK /?CND69
FSET? BOOTS,WEARBIT \?CND69
PRINTI ", and your newly polished boots"
?CND69: PRINTR "."
?CCL59: CALL2 HELD?,BOOTS
ZERO? STACK /?CCL74
FSET? BOOTS,WEARBIT \?CCL74
PRINTR "You are wearing your boots."
?CCL74: PRINTR "You are naked."
?CCL48: EQUAL? PRSA,V?SMELL \?CCL78
EQUAL? SCENE,S-ERASMUS \?CCL81
PRINTR "Your smell like anyone who's been at sea for six months would smell."
?CCL81: PRINTR "You smell all right, considering."
?CCL78: EQUAL? PRSA,V?SHOW \?CCL83
EQUAL? PRSI,ME \?CCL83
EQUAL? P-PRSA-WORD,W?READ \?CCL83
ICALL PERFORM,V?READ,PRSO
RTRUE
?CCL83: EQUAL? PRSA,V?EAT \?CCL88
PRINTR "This is the sort of behavior that most Japanese would find extremely uncivilized."
?CCL88: EQUAL? PRSA,V?HELP \?CCL90
PRINTR "It is said that the Lord helps those who help themselves."
?CCL90: EQUAL? PRSA,V?TELL \?CCL92
ICALL1 MENTAL-COLLAPSE
CALL1 END-QUOTE
RSTACK
?CCL92: EQUAL? PRSA,V?LISTEN \?CCL94
PRINTR "Yes?"
?CCL94: EQUAL? PRSA,V?WAKE \?CCL96
PRINT YOU-ARE
PRINT PERIOD
RTRUE
?CCL96: EQUAL? RARG,M-WINNER \?CCL98
EQUAL? PRSA,V?GIVE \?CCL98
EQUAL? PRSO,ME \?CCL103
PRINT WASTE-OF-TIME
RTRUE
?CCL103: EQUAL? PRSI,ME \FALSE
IN? PRSO,PLAYER \?CCL108
CALL1 PRE-TAKE
RSTACK
?CCL108: ICALL PERFORM,V?TAKE,PRSO
RTRUE
?CCL98: EQUAL? PRSA,V?MOVE \?CCL110
CALL1 V-WALK-AROUND
RSTACK
?CCL110: EQUAL? PRSA,V?SEARCH \?CCL112
ICALL1 V-INVENTORY
RTRUE
?CCL112: EQUAL? PRSA,V?TAKE,V?ATTACK,V?HIT /?PRD118
EQUAL? PRSA,V?SWING,V?BOW \?PRD116
?PRD118: EQUAL? PRSO,ME /?CTR113
?PRD116: EQUAL? PRSA,V?ENTER,V?THROUGH,V?TAKE-OFF /?CTR113
EQUAL? PRSA,V?HOLD /?CTR113
EQUAL? PRSA,V?THROW \?CCL114
EQUAL? PRSI,ME \?CCL114
?CTR113: PRINT STR?217
CRLF
RTRUE
?CCL114: EQUAL? PRSA,V?KILL,V?MUNG,V?BURY /?CTR125
EQUAL? PRSA,V?SHOOT \?CCL126
?CTR125: PRINTR "Death is not to be entered into so lightly as that.Death is a matter of great seriousness."
?CCL126: EQUAL? PRSA,V?FOLLOW \?CCL130
PRINTR "You're getting ahead of yourself."
?CCL130: EQUAL? PRSA,V?THROW,V?THROW-OFF,V?DROP \FALSE
EQUAL? PRSO,ME \FALSE
ZERO? PRSI /?CCL137
ICALL PERFORM,V?BOARD,PRSI
RTRUE
?CCL137: PRINT STR?217
CRLF
RTRUE
.FUNCT GLOBAL-HERE-F:ANY:0:0
EQUAL? PRSA,V?LOOK,V?EXAMINE,V?LOOK-INSIDE \?CCL3
ICALL1 V-LOOK
RTRUE
?CCL3: EQUAL? PRSA,V?PUT \?CCL5
EQUAL? PRSI,GLOBAL-HERE \?CCL5
ICALL PERFORM,V?DROP,PRSO
RTRUE
?CCL5: EQUAL? PRSA,V?WHERE,V?FIND \?CCL9
ICALL PERFORM,V?FIND,ME
RTRUE
?CCL9: EQUAL? PRSA,V?THROUGH,V?WALK-TO \?CCL11
CALL1 PAST-TENSE?
ZERO? STACK \?CCL11
CALL1 V-WALK-AROUND
RSTACK
?CCL11: EQUAL? PRSA,V?OPEN,V?CLOSE \?CCL15
PRINTR "You should try a door instead."
?CCL15: EQUAL? PRSA,V?DROP,V?LEAVE,V?EXIT \?CCL17
CALL2 DO-WALK,P?OUT
RSTACK
?CCL17: EQUAL? PRSA,V?WALK-AROUND \?CCL19
PRINTR "Walking around the room reveals nothing new.To move elsewhere, just type the desired direction."
?CCL19: EQUAL? PRSA,V?LAMP-ON \?CCL21
ICALL2 NEW-PRSO,LIGHT
RTRUE
?CCL21: EQUAL? PRSA,V?SEARCH \?CCL23
PRINTR "You don't find anything."
?CCL23: EQUAL? PRSA,V?WAVE \FALSE
CALL1 TELL-YUKS
RSTACK
.FUNCT GENERIC-WALL-F:ANY:2:2,R,F
RETURN WALL
.FUNCT WALL-F:ANY:0:0
EQUAL? PRSA,V?EXAMINE \?CCL3
PRINT IT-LOOKS-LIKE
PRINTR "a wall."
?CCL3: EQUAL? PRSA,V?LOWER,V?MUNG \FALSE
PRINT YOU-CANT
PRINTR "pull down a wall that easily."
.FUNCT GROUND-F:ANY:0:0
EQUAL? PRSA,V?EXAMINE \?CCL3
PRINTR "You see nothing of interest."
?CCL3: EQUAL? PRSA,V?PUT \?CCL6
EQUAL? PRSI,GROUND \?CCL6
ICALL PERFORM,V?BURY,PRSO
RTRUE
?CCL6: EQUAL? PRSA,V?CLIMB-UP,V?CLIMB-ON,V?CLIMB-FOO /?CTR9
EQUAL? PRSA,V?BOARD,V?HIT \?CCL10
?CTR9: PRINT WASTE-OF-TIME
RTRUE
?CCL10: EQUAL? PRSA,V?LOOK-UNDER \FALSE
PRINTR "You can't look under the ground, it's solid!"
.FUNCT CORRIDOR-F:ANY:0:0
EQUAL? PRSA,V?THROUGH,V?WALK-TO \FALSE
CALL1 V-WALK-AROUND
RSTACK
.FUNCT GLOBAL-SLEEP-F:ANY:0:0
EQUAL? PRSA,V?WALK-TO,V?TAKE \?CCL3
ICALL2 NEW-VERB,V?SLEEP
RTRUE
?CCL3: EQUAL? PRSA,V?FIND \FALSE
PRINTR "Sleep anywhere."
.FUNCT SIGN-OF-CROSS-F:ANY:0:0
EQUAL? PRSA,V?MAKE /FALSE
PRINTR "There is no cross here."
.FUNCT PORTUGUESE-F:ANY:0:0
EQUAL? PRSA,V?SPEAK,V?LEARN,V?SAY \?PRD5
EQUAL? PRSO,PORTUGUESE /FALSE
?PRD5: EQUAL? PRSA,V?TEACH \?PRD8
EQUAL? PRSI,PORTUGUESE /FALSE
?PRD8: EQUAL? PRSA,V?ASK-ABOUT \?CCL3
EQUAL? PRSI,PORTUGUESE /FALSE
?CCL3: EQUAL? PRSA,V?BE,V?BE? /FALSE
CALL FIND-NATIONALITY,PORTUGUESE,PORTUGUESEBIT
RSTACK
.FUNCT PORTUGUESE?:ANY:0:0
EQUAL? PRSI,PORTUGUESE /TRUE
GET PARSE-RESULT,11
EQUAL? STACK,W?PORTUGUESE /TRUE
CALL PP?,W?FROM,PORTUGAL
RSTACK
.FUNCT SPANISH?:ANY:0:0
EQUAL? PRSI,SPANISH /TRUE
GET PARSE-RESULT,11
EQUAL? STACK,W?SPANISH /TRUE
CALL PP?,W?FROM,SPAIN
RSTACK
.FUNCT SPANISH-F:ANY:0:0
EQUAL? PRSA,V?SPEAK,V?LEARN,V?SAY \?PRD5
EQUAL? PRSO,SPANISH /FALSE
?PRD5: EQUAL? PRSA,V?TEACH \?PRD8
EQUAL? PRSI,SPANISH /FALSE
?PRD8: EQUAL? PRSA,V?ASK-ABOUT \?CCL3
EQUAL? PRSI,SPANISH /FALSE
?CCL3: EQUAL? PRSA,V?BE,V?BE? /FALSE
CALL FIND-NATIONALITY,SPANISH,SPANISHBIT
RSTACK
.FUNCT ENGLISH?:ANY:0:0
EQUAL? PRSI,ENGLISH /TRUE
GET PARSE-RESULT,11
EQUAL? STACK,W?ENGLISH,W?BRITISH,W?ENGLISHMAN /TRUE
GET PARSE-RESULT,11
EQUAL? STACK,W?BRITON /TRUE
CALL PP?,W?FROM,ENGLAND
RSTACK
.FUNCT ENGLISH-F:ANY:0:0
EQUAL? PRSA,V?SPEAK,V?LEARN,V?SAY \?PRD5
EQUAL? PRSO,ENGLISH /FALSE
?PRD5: EQUAL? PRSA,V?TEACH \?PRD8
EQUAL? PRSI,ENGLISH /FALSE
?PRD8: EQUAL? PRSA,V?ASK-ABOUT \?CCL3
EQUAL? PRSI,ENGLISH /FALSE
?CCL3: EQUAL? PRSA,V?BE,V?BE?,V?REPLY /FALSE
CALL FIND-NATIONALITY,ENGLISH,ENGLISHBIT
RSTACK
.FUNCT DUTCH?:ANY:0:0
EQUAL? PRSI,DUTCH /TRUE
GET PARSE-RESULT,11
EQUAL? STACK,W?DUTCH /TRUE
CALL PP?,W?FROM,HOLLAND
RSTACK
.FUNCT DUTCH-F:ANY:0:0
EQUAL? PRSA,V?SPEAK,V?LEARN,V?SAY \?PRD5
EQUAL? PRSO,DUTCH /FALSE
?PRD5: EQUAL? PRSA,V?TEACH \?PRD8
EQUAL? PRSI,DUTCH /FALSE
?PRD8: EQUAL? PRSA,V?ASK-ABOUT \?CCL3
EQUAL? PRSI,DUTCH /FALSE
?CCL3: EQUAL? PRSA,V?BE,V?BE? /FALSE
CALL FIND-NATIONALITY,DUTCH,DUTCHBIT
RSTACK
.FUNCT JAPAN-F:ANY:0:0
EQUAL? PRSA,V?EXAMINE \FALSE
EQUAL? SCENE,S-ERASMUS \?CCL6
PRINTR "You aren't even sure you are near Japan."
?CCL6: PRINTR "What you see is a place unlike any you've seen before.It's like another world."
.FUNCT JAPANESE?:ANY:0:0
EQUAL? PRSI,JAPANESE /TRUE
GET PARSE-RESULT,11
EQUAL? STACK,W?JAPANESE /TRUE
CALL PP?,W?FROM,JAPAN
RSTACK
.FUNCT JAPANESE-F:ANY:0:0
EQUAL? PRSA,V?SPEAK,V?LEARN,V?SAY \?PRD5
EQUAL? PRSO,JAPANESE /FALSE
?PRD5: EQUAL? PRSA,V?TEACH \?PRD8
EQUAL? PRSI,JAPANESE /FALSE
?PRD8: EQUAL? PRSA,V?ASK-ABOUT \?CCL3
EQUAL? PRSI,JAPANESE /FALSE
?CCL3: EQUAL? PRSA,V?BE,V?BE? /FALSE
CALL FIND-NATIONALITY,JAPANESE,JAPANESEBIT
RSTACK
.FUNCT FIND-NATIONALITY:ANY:2:2,OBJ,BIT,F,BEST,PBEST
FIRST? HERE >F /?PRG2
?PRG2: ZERO? F /?REP3
FSET? F,BIT \?CND4
FSET? F,PLURAL \?CCL10
ZERO? PBEST \?CCL13
SET 'PBEST,F
JUMP ?CND4
?CCL13: SET 'PBEST,-1
JUMP ?CND4
?CCL10: ZERO? BEST \?CCL16
SET 'BEST,F
JUMP ?CND4
?CCL16: SET 'BEST,-1
?CND4: NEXT? F >F /?PRG2
JUMP ?PRG2
?REP3: GRTR? PBEST,0 \?CCL20
ICALL REDIRECT,OBJ,PBEST
RTRUE
?CCL20: GRTR? BEST,0 \?CCL22
ICALL REDIRECT,OBJ,BEST
RTRUE
?CCL22: LESS? PBEST,0 /?CTR23
LESS? BEST,0 \?CCL24
?CTR23: PRINT YOU-HAVE-TO
PRINT STR?125
PRINTI "which "
ICALL2 DPRINT,OBJ
PRINTR " you mean."
?CCL24: PRINTR "It's hard to tell whom you mean; please be more specific."
.FUNCT GLOBAL-FOOD-F:ANY:0:0,F
CALL FIND-IN,HERE,FOODBIT >F
ZERO? F \?PEN4
CALL FIND-IN,WINNER,FOODBIT >F
?PEN4: ZERO? F /?CCL3
ICALL REDIRECT,GLOBAL-FOOD,F
RTRUE
?CCL3: EQUAL? PRSA,V?EXAMINE,V?EAT \FALSE
PRINTR "There's no food here."
.FUNCT GLOBAL-WATER-F:ANY:0:0
EQUAL? PRSA,V?EXAMINE,V?DRINK \FALSE
EQUAL? HERE,BATH-HOUSE \?CCL6
ICALL PERFORM,PRSA,BATHTUB
RTRUE
?CCL6: EQUAL? HERE,YOKOSE-BATH-HOUSE \?CCL8
ICALL PERFORM,PRSA,YOKOSE-BATHTUB
RTRUE
?CCL8: PRINTR "There's no water here."
.FUNCT GLOBAL-HATAMOTO-F:ANY:0:0
EQUAL? PRSA,V?WHO,V?WHAT \FALSE
PRINTI "A "
ICALL2 PRINTUNDER,STR?83
PRINTR " is literally a 'banner-man,' which formerly meant one who carried his lord's banner in battle.Now it means a vassal who is a personal retainer, a highly trusted member of the lord's staff."
.FUNCT WIND-F:ANY:0:0
EQUAL? PRSA,V?EXAMINE,V?FIND,V?RUB \?CCL3
EQUAL? SCENE,S-ERASMUS \?CCL6
FSET? HERE,OUTSIDE \?CCL6
PRINTI "The storm is out of the east, humping up the waves and tide.The "
ICALL2 PRINTUNDER,STR?7
PRINTI " is "
EQUAL? SHIP-DIRECTION,P?WEST \?CCL11
PRINTR "running before the wind."
?CCL11: EQUAL? SHIP-DIRECTION,P?SW,P?NW \?CCL13
PRINTR "fighting to make way south and west."
?CCL13: EQUAL? SHIP-DIRECTION,P?SOUTH,P?NORTH \FALSE
PRINTR "broadside to the gale."
?CCL6: EQUAL? SCENE,S-VOYAGE \?CCL17
EQUAL? HERE,GALLEY,MAIN-DECK,IN-THE-SEA \?CCL20
PRINTR "The gale is blowing with merciless fury."
?CCL20: PRINTR "Here in the lee of the cliffs, the wind is calmer."
?CCL17: FSET? HERE,OUTSIDE \?CCL22
PRINTR "The wind is calm here."
?CCL22: PRINTR "You're inside.There's no wind here."
?CCL3: EQUAL? PRSA,V?LISTEN \?CCL24
EQUAL? SCENE,S-ERASMUS,S-VOYAGE \FALSE
PRINTR "The wind whistles and groans."
?CCL24: EQUAL? PRSA,V?THROUGH,V?TURN-TOWARD \FALSE
EQUAL? SCENE,S-ERASMUS,S-VOYAGE \?CCL32
FSET? HERE,OUTSIDE \?CCL32
PRINTR "Facing into the storm helps to keep you awake."
?CCL32: PRINTR "There's no wind here."
.FUNCT HELP-F:ANY:0:0
EQUAL? PRSA,V?ASK-FOR \?CCL3
PRINTR "No one seems able, or perhaps, willing to help."
?CCL3: EQUAL? PRSA,V?TAKE \FALSE
PRINTR "There doesn't seem to be anyone around in a position to help you."
.FUNCT PRINT-SPACES:ANY:1:1,CNT
?PRG1: DLESS? 'CNT,0 /TRUE
PRINTC 32
JUMP ?PRG1
.FUNCT TRINITY-HOUSE-F:ANY:0:0
EQUAL? PRSA,V?WHAT \FALSE
PRINTR "Trinity House in London is where you learned piloting from your old teacher, Alban Caradoc."
.FUNCT LIZARD-F:ANY:0:0
EQUAL? PRSA,V?WHAT,V?WHERE \FALSE
PRINTR "The Lizard is the southernmost point of Cornwall, a major landmark for pilots."
.FUNCT ROPE-F:ANY:0:0
EQUAL? PRSA,V?FIND \FALSE
EQUAL? SCENE,S-VOYAGE \FALSE
PRINTR "You don't see any near at hand."
.FUNCT GENERIC-ROPE-F:ANY:2:2,R,F
GETP YABU-KIMONO,P?COUNT
ZERO? STACK /?CCL3
RETURN YABU-KIMONO
?CCL3: RETURN ROPE
.FUNCT GENERIC-SAMURAI-F:ANY:2:2,R,F,CT,OBJ,V,BEST
GET R,1 >CT
ADD R,8 >V
GET R,0
GRTR? CT,STACK /FALSE
ZERO? OPPONENT /?CCL5
INTBL? OPPONENT,V,CT \?CCL5
RETURN OPPONENT
?CCL5: IN? LOSING-SAMURAI,HERE \?CCL9
RETURN LOSING-SAMURAI
?CCL9: IN? OMI-SAMURAI,LADDER \?CCL11
RETURN OMI-SAMURAI
?CCL11: EQUAL? SCENE,S-NINJA \?PRG13
RETURN GUARDS
?PRG13: DLESS? 'CT,0 \?CCL17
RETURN BEST
?CCL17: GET V,0 >OBJ
CALL2 ACCESSIBLE?,OBJ
ZERO? STACK /?CCL19
ZERO? BEST \FALSE
FSET? OBJ,PLURAL \?PRG13
SET 'BEST,OBJ
JUMP ?PRG13
?CCL19: ADD V,2 >V
JUMP ?PRG13
.FUNCT COURSE-F:ANY:0:0
EQUAL? SCENE,S-ERASMUS,S-VOYAGE /?CCL3
PRINTR "What course?"
?CCL3: EQUAL? PRSA,V?EXAMINE,V?READ \?CCL5
EQUAL? SCENE,S-ERASMUS \?CCL8
ICALL REDIRECT,COURSE,COMPASS
RTRUE
?CCL8: PRINTI "It's hard to tell directions in this storm, but the galley's course is toward "
EQUAL? SHIP-COURSE,P?STARBOARD \?CCL11
PRINTR "the bay."
?CCL11: PRINTR "the open sea."
?CCL5: EQUAL? PRSA,V?HOLD \FALSE
EQUAL? HERE,BRIDGE-OF-ERASMUS \?CCL16
ICALL PERFORM,V?STRAIGHTEN,WHEEL
RTRUE
?CCL16: EQUAL? HERE,GALLEY \?CCL18
ICALL PERFORM,V?STRAIGHTEN,GALLEY-WHEEL
RTRUE
?CCL18: PRINTI "You'd have to be on the "
EQUAL? SCENE,S-ERASMUS \?CCL21
PRINTI "bridge"
JUMP ?CND19
?CCL21: PRINTI "quarterdeck"
?CND19: PRINTR " to do that."
.FUNCT ETA-F:ANY:0:0
EQUAL? PRSA,V?WHAT,V?WHO \FALSE
PRINTI "The "
ICALL2 PRINTUNDER,STR?218
PRINTR " are the lowest class of society, those who are butchers and tanners, executioners and undertakers."
.FUNCT ORDERS-F:ANY:0:0
EQUAL? PRSA,V?FOLLOW,V?DO?,V?COMMIT \FALSE
EQUAL? SCENE,S-PIT \?CCL6
ZERO? ANSWER-HAI? /FALSE
FSET? CROOCQ,SCOREBIT \FALSE
ICALL2 PERFORM,V?LIE-DOWN
RTRUE
?CCL6: EQUAL? SCENE,S-TORANAGA \?CCL13
FSET? BLACKTHORNE,SITTING /?CCL16
ICALL2 PERFORM,V?KNEEL
RTRUE
?CCL16: FSET? DAIS,RMUNGBIT \FALSE
FSET? DAIS,SCOREBIT \FALSE
ICALL PERFORM,V?WALK-TO,ALVITO
RTRUE
?CCL13: PRINTR "You'll have to be more specific."
.FUNCT GENERIC-SHIP-F:ANY:2:2,R,F
RETURN LG-ERASMUS
.FUNCT GENERIC-CREWMEN-F:ANY:2:2,R,F
RETURN LG-CREWMEN
.FUNCT GENERIC-CAPTAIN-F:ANY:2:2,R,F
EQUAL? SCENE,S-ERASMUS,S-ANJIRO,S-YABU /?CTR2
EQUAL? SCENE,S-PIT \?CCL3
?CTR2: RETURN SPILLBERGEN
?CCL3: EQUAL? SCENE,S-NINJA \?CCL7
RETURN GRAY-CAPTAIN
?CCL7: EQUAL? SCENE,S-DEPARTURE \FALSE
FSET? YAMAZAKI,DEAD \FALSE
RETURN KOJIMA
.FUNCT GENERIC-SEA-F:ANY:2:2,R,F
RETURN LG-SEA
.FUNCT GENERIC-GALLEY-F:ANY:2:2,R,F
EQUAL? SCENE,S-YABU,S-ANJIRO,S-ERASMUS \?CCL3
RETURN LG-ERASMUS
?CCL3: EQUAL? SCENE,S-RODRIGUES \?CCL5
RETURN SLAVER
?CCL5: RETURN LG-GALLEY
.FUNCT GENERIC-DECK-F:ANY:2:2,R,F
RETURN DECK
.FUNCT GENERIC-CRAZY-F:ANY:2:2,R,F
EQUAL? SCENE,S-PRISON \?CCL3
RETURN MADMAN
?CCL3: RETURN CRAZY
.FUNCT GENERIC-LITTER-F:ANY:2:2,R,F
EQUAL? HERE,WOODS /?CTR2
IN? WINNER,MARIKOS-LITTER \?CCL3
?CTR2: RETURN MARIKOS-LITTER
?CCL3: IN? YABU-PALANQUIN,HERE \FALSE
RETURN YABU-PALANQUIN
.FUNCT LG-VILLAGE-F:ANY:0:0
EQUAL? SCENE,S-ANJIRO \?CCL3
EQUAL? PRSA,V?THROUGH \?CCL6
EQUAL? HERE,GARDEN,MURA-HOUSE \?CCL9
CALL2 DO-WALK,P?EAST
RSTACK
?CCL9: EQUAL? HERE,ANJIRO-WATERFRONT \?CCL11
CALL2 DO-WALK,P?NORTH
RSTACK
?CCL11: PRINTR "The village is right here."
?CCL6: EQUAL? PRSA,V?EXIT \FALSE
EQUAL? HERE,GARDEN,MURA-HOUSE \?CCL16
PRINTR "You can't tell from here how to leave the village."
?CCL16: EQUAL? HERE,ANJIRO,ANJIRO-WATERFRONT \FALSE
CALL2 DO-WALK,P?NORTH
RSTACK
?CCL3: EQUAL? SCENE,S-VOYAGE \FALSE
PRINTR "The village is too far away, considering your condition."
.FUNCT LG-BAY-F:ANY:0:0
EQUAL? PRSA,V?EXAMINE \?CCL3
EQUAL? SCENE,S-VOYAGE \?CCL6
PRINTR "The bay looks like an island of relative calm."
?CCL6: PRINTR "The harbor is a small bay protected by reefs almost out of sight to the east."
?CCL3: EQUAL? PRSA,V?PUT,V?THROW \FALSE
EQUAL? PRSI,LG-BAY \FALSE
ICALL PERFORM,PRSA,PRSO,LG-SEA
RTRUE
.FUNCT LG-LAND-F:ANY:0:0,TRIES
EQUAL? SCENE,S-ANJIRO,S-RODRIGUES \?CCL3
EQUAL? PRSA,V?WALK-TO \?CCL3
CALL2 DO-WALK,P?WEST
RSTACK
?CCL3: EQUAL? SCENE,S-VOYAGE \?CCL7
EQUAL? PRSA,V?POINT \?CCL7
ZERO? GALLEY-IN-BAY? /?CCL7
FSET? SKIFF,RMUNGBIT \?CCL13
GETP SKIFF,P?COUNT >TRIES
ADD TRIES,1
PUTP SKIFF,P?COUNT,STACK
ZERO? TRIES \?CCL16
PRINTI "Hiro-matsu is here, with Yabu beside him.They eventually realize you are proposing to go ashore, and Hiro-matsu responds harshly."
CALL1 HIRO-MATSU-REFUSES
RSTACK
?CCL16: EQUAL? TRIES,1 \FALSE
CALL1 YABU-BOARDS-SKIFF
RSTACK
?CCL13: PRINT STR?219
CRLF
RTRUE
?CCL7: EQUAL? PRSA,V?WALK-TO \?CCL20
IN? WINNER,SKIFF \?CCL23
CALL2 DO-WALK,P?EAST
RSTACK
?CCL23: IN? WINNER,SMALL-BOAT \?CCL25
CALL2 DO-WALK,P?WEST
RSTACK
?CCL25: EQUAL? SCENE,S-ERASMUS,S-VOYAGE \FALSE
PRINTR "Easier said than done."
?CCL20: EQUAL? PRSA,V?RUB,V?CLIMB-ON \FALSE
EQUAL? SCENE,S-ERASMUS /?CTR31
EQUAL? SCENE,S-VOYAGE \?CCL32
EQUAL? HERE,IN-THE-SEA,GALLEY,MAIN-DECK \?CCL32
?CTR31: PRINTR "It's too far away."
?CCL32: PRINTR "It feels like you would expect land to feel."
.FUNCT LG-SEA-F:ANY:0:1,RARG
EQUAL? RARG,FALSE-VALUE \FALSE
EQUAL? PRSA,V?EXAMINE,V?LOOK-INSIDE \?CCL6
EQUAL? SCENE,S-ERASMUS \?CCL9
PRINTR "The sea is a maze of mountainous waves and razor-spined reef-tops."
?CCL9: EQUAL? SCENE,S-VOYAGE \?CCL11
PRINTI "The gale-driven surf is thrown high in the air, hurled by the wind against the rocky shore."
EQUAL? HERE,GALLEY,MAIN-DECK,IN-THE-SEA /?CND12
IN? YABU,HERE /?CND12
PRINTR "You can see that the tide is coming in."
?CND12: CRLF
RTRUE
?CCL11: PRINTR "It's full of water."
?CCL6: EQUAL? PRSA,V?POINT \?CCL17
IN? YABU,HERE \FALSE
PRINTR "Yabu looks at the sea, and you can tell he hates and perhaps fears it."
?CCL17: EQUAL? PRSA,V?BOARD,V?THROUGH,V?SWIM /?CTR21
EQUAL? PRSA,V?LEAP,V?DIVE /?CTR21
EQUAL? PRSA,V?THROW \?CCL22
EQUAL? PRSO,ME \?CCL22
?CTR21: EQUAL? HERE,ON-DECK,BRIDGE-OF-ERASMUS \?CCL30
EQUAL? SCENE,S-ANJIRO,S-RODRIGUES \?CCL33
PRINTR "Wouldn't it be safer to just climb back into the boat?"
?CCL33: ICALL PERFORM,V?LEAP,LG-ERASMUS
RTRUE
?CCL30: EQUAL? HERE,ANJIRO-WATERFRONT \?CCL35
ICALL2 DO-WALK,P?EAST
RTRUE
?CCL35: EQUAL? HERE,GALLEY,MAIN-DECK \?CCL37
CALL2 GOTO,IN-THE-SEA
RSTACK
?CCL37: EQUAL? HERE,MAIN-DECK-2 \?CCL39
CALL2 JIGS-UP?,J-PILING
ZERO? STACK /TRUE
CALL2 JIGS-UP,STR?220
RSTACK
?CCL39: EQUAL? HERE,IN-THE-SEA \?CCL44
IN? WINNER,SKIFF \?CCL47
PRINTR "As you try to leap into the sea, the samurai grab you.They hold you tightly as Yabu scowls."
?CCL47: PRINT STR?181
CRLF
RTRUE
?CCL44: IN? WINNER,SMALL-BOAT \?CCL49
PRINTR "Why do that when you're in a nice boat?"
?CCL49: PRINTR "You wouldn't like it.It's wet."
?CCL22: EQUAL? PRSA,V?PUT,V?THROW \?CCL51
EQUAL? PRSI,LG-SEA \?CCL51
CALL2 HELD?,PRSO
ZERO? STACK /FALSE
REMOVE PRSO
ICALL1 CTHE-PRINT-PRSO
PRINTI " drop"
CALL2 PLURAL?,PRSO
ZERO? STACK \?CND57
PRINTC 115
?CND57: PRINTI " into the water and "
EQUAL? PRSO,OARS,BOAT-OAR,LIFE-RING \?CCL61
PRINTI "float"
JUMP ?CND59
?CCL61: PRINTI "sink"