-
Notifications
You must be signed in to change notification settings - Fork 16
/
qverbs.zap
696 lines (603 loc) · 13 KB
/
qverbs.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
.SEGMENT "0"
.FUNCT WHAT-F:ANY:0:0,OBJ,TMP,NOT?,LOC?
GET PARSE-RESULT,16
BAND PARSE-NOT,STACK >NOT?
GET PARSE-RESULT,9 >LOC?
EQUAL? PRSA,V?BE? /FALSE
GET PARSE-RESULT,10 >OBJ
EQUAL? OBJ,W?WHO,W?WHAT,W?WHERE /FALSE
GET PARSE-RESULT,10 >OBJ
EQUAL? OBJ,W?WHY,W?WHEN,W?HOW /FALSE
CALL1 EVERYWHERE-VERB?
ZERO? STACK \?CCL9
PRINTR "That's precisely the sort of question you'll have to answer for yourself."
?CCL9: EQUAL? PRSI,INTPP \FALSE
CALL1 P-PP-OBJ >OBJ
ZERO? OBJ /FALSE
ZERO? NOT? \FALSE
CALL1 P-PP-PREP >TMP
ZERO? TMP \?PEN17
GET LOC?,1 >TMP
?PEN17: EQUAL? TMP,W?BEHIND \?CCL22
ICALL PERFORM,V?LOOK-BEHIND,OBJ
RTRUE
?CCL22: EQUAL? TMP,W?DOWN \?CCL24
ICALL PERFORM,V?LOOK-DOWN,OBJ
RTRUE
?CCL24: EQUAL? TMP,W?IN,W?ON,W?THROUGH \?CCL26
ICALL PERFORM,V?LOOK-INSIDE,OBJ
RTRUE
?CCL26: EQUAL? TMP,W?UNDER \FALSE
ICALL PERFORM,V?LOOK-UNDER,OBJ
RTRUE
.FUNCT TELL-Q-WORD:ANY:0:0,WD
EQUAL? PRSA,V?BE? \?CCL3
PRINTI "if"
RTRUE
?CCL3: GET PARSE-RESULT,10 >WD
EQUAL? WD,W?WHO,W?WHAT,W?WHERE /?CTR4
GET PARSE-RESULT,10 >WD
EQUAL? WD,W?WHY,W?WHEN,W?HOW \?CCL5
?CTR4: PRINTB WD
RTRUE
?CCL5: PRINTI "whether"
RTRUE
.FUNCT P-NEGATIVE?:ANY:0:0
GET PARSE-RESULT,16
BAND PARSE-NOT,STACK
RSTACK
.FUNCT TRY-QCONTEXT?:ANY:0:0,W
ZERO? QCONTEXT /FALSE
IN? QCONTEXT,HERE \FALSE
EQUAL? QCONTEXT,WINNER /FALSE
CALL1 PAST-TENSE?
ZERO? STACK \?CCL3
EQUAL? QCONTEXT,PRSO /FALSE
EQUAL? PRSA,V?ASK-ABOUT /FALSE
EQUAL? PRSA,V?TELL-ABOUT \?CCL3
EQUAL? PRSO,ME /FALSE
?CCL3: SET 'W,WINNER
SET 'WINNER,QCONTEXT
ICALL PERFORM,PRSA,PRSO,PRSI
SET 'WINNER,W
RTRUE
.FUNCT PRE-BE:ANY:0:0
CALL1 TRY-QCONTEXT?
ZERO? STACK \TRUE
RFALSE
.FUNCT V-BE:ANY:0:0,TMP,NOT?,ADJ?,LOC?,OBJ,PREP
GET PARSE-RESULT,16
BAND PARSE-NOT,STACK >NOT?
GET PARSE-RESULT,11 >ADJ?
GET PARSE-RESULT,9 >LOC?
EQUAL? PRSA,V?BE?,V?WHO,V?WHAT /?CTR2
EQUAL? PRSA,V?WHERE,V?WHY,V?WHEN /?CTR2
EQUAL? PRSA,V?HOW /?CTR2
GET PARSE-RESULT,10 >TMP
EQUAL? TMP,W?WHO,W?WHAT,W?WHERE /?CTR2
GET PARSE-RESULT,10 >TMP
EQUAL? TMP,W?WHY,W?WHEN,W?HOW \?CCL3
?CTR2: CALL1 TRY-QCONTEXT?
ZERO? STACK \TRUE
EQUAL? PRSI,INTADJ \?CCL13
EQUAL? PRSO,ME,PLAYER \?CCL16
EQUAL? PRSA,V?BE? \?CCL19
PRINTI "You"
JUMP ?CND17
?CCL19: PRINT WHO-KNOWS-STRING
ICALL1 TELL-Q-WORD
PRINTI " you"
?CND17: CALL2 IS-PRSO-ADJ?,ADJ?
ZERO? STACK /?CCL22
PRINTI " are "
JUMP ?CND14
?CCL22: PRINTI " aren't "
JUMP ?CND14
?CCL16: EQUAL? PRSA,V?BE? \?CCL25
ICALL2 CTHE-PRINT,PRSO
JUMP ?CND23
?CCL25: PRINT WHO-KNOWS-STRING
ICALL1 TELL-Q-WORD
PRINTC 32
ICALL2 THE-PRINT,PRSO
?CND23: ICALL2 PRINT-IS/ARE,PRSO
CALL2 IS-PRSO-ADJ?,ADJ?
ZERO? STACK \?CND26
PRINTI "n't"
?CND26: PRINTC 32
?CND14: PRINTB ADJ?
PRINTR "."
?CCL13: EQUAL? PRSI,INTPP \?CCL29
CALL1 P-PP-PREP >PREP
ZERO? PREP /?CCL32
CALL1 P-PP-OBJ >OBJ
ZERO? OBJ /?CCL32
EQUAL? PRSA,V?BE? \?CCL37
CALL RIGHT-PREP?,PREP,PRSO,OBJ
ZERO? STACK \?PRF40
PUSH 1
JUMP ?PEN38
?PRF40: PUSH 0
?PEN38: ICALL PRSO-IS,STACK,TRUE-VALUE
PRINTC 32
PRINTB PREP
PRINTC 32
ICALL2 THE-PRINT,OBJ
PRINTR "."
?CCL37: PRINT WHO-KNOWS-STRING
ICALL1 TELL-Q-WORD
ICALL2 PRSO-IS,NOT?
PRINTC 32
PRINTB PREP
PRINTC 32
ICALL2 THE-PRINT,OBJ
PRINTR "."
?CCL32: PRINT WHO-KNOWS-STRING
ICALL1 TELL-Q-WORD
ICALL2 PRSO-IS,NOT?
PRINTC 32
GET LOC?,1
PRINTB STACK
PRINTC 32
GET LOC?,2
ICALL2 NP-PRINT,STACK
PRINTR "."
?CCL29: GET PARSE-RESULT,13
ZERO? STACK /?CCL42
CALL1 WHO-KNOWS
RSTACK
?CCL42: ZERO? PRSI \?CCL44
GET PARSE-RESULT,10
EQUAL? STACK,W?WHERE \?CCL44
EQUAL? PRSO,FALSE-VALUE,ROOMS /?CCL49
LOC PRSO >LOC?
JUMP ?CND47
?CCL49: SET 'LOC?,FALSE-VALUE
?CND47: ZERO? LOC? \?CCL52
PRINTR "That's an excellent question."
?CCL52: IN? PRSO,HERE \?CCL54
ICALL PRSO-IS,FALSE-VALUE,TRUE-VALUE
PRINTR " here."
?CCL54: EQUAL? LOC?,GENERIC-OBJECTS \?CCL56
PRINTI "You don't know where "
ICALL2 THE-PRINT,PRSO
ICALL2 PRINT-IS/ARE,PRSO
PRINTR "."
?CCL56: EQUAL? LOC?,GLOBAL-OBJECTS \?CCL58
PRINTI "No doubt "
ICALL2 THE-PRINT,PRSO
ICALL2 PRINT-IS/ARE,PRSO
PRINTR " around here somewhere."
?CCL58: EQUAL? LOC?,LOCAL-GLOBALS \?CCL60
CALL GLOBAL-IN?,PRSO,HERE
ZERO? STACK /?CCL60
ICALL2 CTHE-PRINT,PRSO
ICALL2 PRINT-IS/ARE,PRSO
PRINTR " nearby."
?CCL60: FSET? LOC?,PERSONBIT \?CCL64
ICALL2 CTHE-PRINT,LOC?
PRINTI " has "
ICALL2 THE-PRINT,PRSO
PRINTR "."
?CCL64: CALL2 META-LOC,PRSO
EQUAL? STACK,HERE \?CCL66
ICALL2 CTHE-PRINT,PRSO
ICALL2 PRINT-IS/ARE,PRSO
PRINTI " in "
ICALL2 THE-PRINT,LOC?
PRINTR "."
?CCL66: IN? LOC?,ROOMS \?CCL68
ICALL2 CTHE-PRINT,PRSO
ICALL2 PRINT-IS/ARE,PRSO
PRINTI " probably "
FSET? PRSO,TOUCHBIT \?CCL71
PRINTI "still in the place called """
ICALL2 DPRINT,LOC?
PRINTR "."""
?CCL71: FSET? PRSO,PERSONBIT /?CND72
PRINTI "lying "
?CND72: PRINTR "around somewhere."
?CCL68: PRINT WHO-KNOWS-STRING
PRINTI "where "
ICALL2 THE-PRINT,PRSO
ICALL2 PRINT-IS/ARE,PRSO
PRINTR "."
?CCL44: PRINT WHO-KNOWS-STRING
ICALL1 TELL-Q-WORD
EQUAL? PRSO,FALSE-VALUE,ROOMS /?CND74
ICALL2 PRSO-IS,NOT?
ZERO? PRSI /?CND74
PRINTC 32
ICALL1 PRINTA-PRSI
?CND74: PRINTR "."
?CCL3: EQUAL? PRSI,INTADJ \?CCL80
CALL2 IS-PRSO-ADJ?,ADJ?
ZERO? STACK /?CCL83
ZERO? NOT? /?CCL86
PRINTI "Wrong,"
JUMP ?CND84
?CCL86: PRINTI "Right,"
?CND84: ICALL2 PRSO-IS,FALSE-VALUE
JUMP ?CND81
?CCL83: ZERO? NOT? /?CCL89
PRINTI "Right,"
JUMP ?CND87
?CCL89: PRINTI "Wrong,"
?CND87: ICALL2 PRSO-IS,TRUE-VALUE
?CND81: PRINTC 32
PRINTB ADJ?
PRINTR "."
?CCL80: EQUAL? PRSI,INTPP \?CCL91
PRINTI "So, you say"
ICALL2 PRSO-IS,NOT?
PRINTC 32
CALL1 P-PP-PREP >TMP
ZERO? TMP /?CCL94
PRINTB TMP
JUMP ?CND92
?CCL94: GET LOC?,1
PRINTB STACK
?CND92: PRINTC 32
CALL1 P-PP-OBJ >TMP
ZERO? TMP /?CCL97
ICALL2 THE-PRINT,TMP
JUMP ?CND95
?CCL97: GET LOC?,2
ICALL2 NP-PRINT,STACK
?CND95: PRINTR "."
?CCL91: EQUAL? P-PRSA-WORD,W?BE \?CCL99
EQUAL? PRSO,WINNER \?CCL102
ICALL2 CTHE-PRINT,PRSO
PRINTI " is already "
PRINTI "that"
PRINTR "."
?CCL102: PRINTR "That would take a bit of magic."
?CCL99: PRINTI "So you think"
ICALL2 PRSO-IS,NOT?
ZERO? PRSI /?CND103
PRINTC 32
ICALL1 PRINTA-PRSI
?CND103: PRINTR "."
.FUNCT RIGHT-PREP?:ANY:3:3,PREP,OBJ,CONT
IN? OBJ,CONT \FALSE
EQUAL? PREP,W?IN,W?INSIDE \?CCL5
CALL2 SEE-INSIDE?,CONT
ZERO? STACK /FALSE
RTRUE
?CCL5: EQUAL? PREP,W?ON \FALSE
FSET? CONT,SURFACEBIT /TRUE
RFALSE
.FUNCT V-BE?:ANY:0:0
CALL1 V-BE
RSTACK
.FUNCT V-WHO:ANY:0:0
EQUAL? PRSO,ROOMS \?CCL3
CALL1 MORE-SPECIFIC
RSTACK
?CCL3: ZERO? PRSI \?CCL5
PRINTI "You don't know anything special about "
ICALL1 THE-PRINT-PRSO
PRINTR "."
?CCL5: CALL1 V-BE
RSTACK
.FUNCT V-WHAT:ANY:0:0
CALL1 V-WHO
RSTACK
.FUNCT PRE-WHERE:ANY:0:0
ZERO? PRSS \FALSE
ZERO? PRSQ \FALSE
ICALL PERFORM,V?FIND,PRSO,PRSI
RTRUE
.FUNCT V-WHERE:ANY:0:0
EQUAL? PRSO,ROOMS \?CCL3
CALL1 MORE-SPECIFIC
RSTACK
?CCL3: CALL1 V-BE
RSTACK
.FUNCT V-WHEN:ANY:0:0
EQUAL? PRSO,ROOMS \?CCL3
CALL1 MORE-SPECIFIC
RSTACK
?CCL3: CALL1 V-BE
RSTACK
.FUNCT V-WHY:ANY:0:0
EQUAL? PRSO,ROOMS \?CCL3
CALL1 MORE-SPECIFIC
RSTACK
?CCL3: CALL1 V-BE
RSTACK
.FUNCT V-HOW:ANY:0:0
EQUAL? PRSO,ROOMS \?CCL3
CALL1 MORE-SPECIFIC
RSTACK
?CCL3: CALL1 V-BE
RSTACK
.FUNCT QUIET?:ANY:1:1,OBJ
RTRUE
.FUNCT OUTSIDE?:ANY:1:1,OBJ
FSET? HERE,OUTSIDE /TRUE
RFALSE
.FUNCT OPEN?:ANY:1:1,OBJ
FSET? OBJ,OPENABLE /?PRD3
FSET? OBJ,DOORBIT \FALSE
?PRD3: FSET? OBJ,OPENBIT /TRUE
RFALSE
.FUNCT Q-CLOSED?:ANY:1:1,OBJ
FSET? OBJ,OPENABLE /?PRD3
FSET? OBJ,DOORBIT \FALSE
?PRD3: FSET? OBJ,OPENBIT /FALSE
RTRUE
.FUNCT LOCKED?:ANY:1:1,OBJ
FSET? OBJ,DOORBIT \FALSE
FSET? OBJ,LOCKED /TRUE
RFALSE
.FUNCT UNLOCKED?:ANY:1:1,OBJ
FSET? OBJ,DOORBIT \FALSE
FSET? OBJ,LOCKED /FALSE
RTRUE
.FUNCT DEAD?:ANY:1:1,OBJ
FSET? OBJ,PERSONBIT \TRUE
FSET? OBJ,DEAD /TRUE
RFALSE
.FUNCT ALIVE?:ANY:1:1,OBJ
FSET? OBJ,PERSONBIT \FALSE
FSET? OBJ,DEAD /FALSE
RTRUE
.FUNCT PRSO-IS:ANY:1:2,NOT?,CAP?
EQUAL? PRSO,ME,PLAYER \?CCL3
ZERO? CAP? /?CCL6
PRINTI "You"
JUMP ?CND4
?CCL6: PRINTI " you"
?CND4: PRINTI " are"
ZERO? NOT? /FALSE
PRINTI "n't"
RTRUE
?CCL3: ZERO? CAP? /?CCL12
ICALL2 CTHE-PRINT,PRSO
JUMP ?CND10
?CCL12: PRINTC 32
ICALL2 THE-PRINT,PRSO
?CND10: ICALL2 PRINT-IS/ARE,PRSO
ZERO? NOT? /FALSE
PRINTI "n't"
RTRUE
.FUNCT PRINT-IS/ARE:ANY:1:1,OBJ
FSET? OBJ,PLURAL /?CTR2
EQUAL? OBJ,BLACKTHORNE,ME,YOU \?CCL3
?CTR2: PRINTI " are"
RTRUE
?CCL3: PRINTI " is"
RTRUE
.FUNCT IS-PRSO-ADJ?:ANY:1:1,ADJ,TMP
GETPT PRSO,P?ADJECTIVE >TMP
ZERO? TMP /?CCL3
PTSIZE TMP
DIV STACK,2
INTBL? ADJ,TMP,STACK /TRUE
?CCL3: GET ADJ-TABLE,0
INTBL? ADJ,ADJ-TABLE,STACK >TMP \FALSE
GET TMP,1
CALL STACK,PRSO
ZERO? STACK \TRUE
RFALSE
.FUNCT PP?:ANY:2:2,P,N,TMP
GET PARSE-RESULT,9 >TMP
ZERO? TMP /FALSE
ZERO? P /FALSE
CALL1 P-PP-PREP
EQUAL? P,STACK \FALSE
ZERO? N /FALSE
CALL1 P-PP-OBJ
EQUAL? N,STACK /TRUE
RFALSE
.FUNCT V-STATEMENT:ANY:0:0
CALL1 V-DO?
RSTACK
.FUNCT WHO-KNOWS:ANY:0:1,WD,OBJ,SUBJ,V,M,N,?TMP1
ASSIGNED? 'WD /?CND1
GET PARSE-RESULT,14 >WD
?CND1: GET PARSE-RESULT,10
EQUAL? STACK,W?WHO,W?WHAT \?CCL5
GET P-PRSA-WORD,3
GET STACK,2 >OBJ
ZERO? OBJ /?CCL5
CALL GET-SYNTAX,OBJ,1,0,TRUE-VALUE
ZERO? STACK /?CCL5
CALL DETERMINE-OBJ,FALSE-VALUE,1,TRUE-VALUE >OBJ
ZERO? OBJ /?CCL5
GET OBJ,3 >OBJ
ZERO? OBJ /?CCL5
PRINTI "Perhaps"
JUMP ?CND3
?CCL5: SET 'OBJ,FALSE-VALUE
PRINT WHO-KNOWS-STRING
ICALL1 TELL-Q-WORD
?CND3: GET PARSE-RESULT,13 >SUBJ
ZERO? SUBJ /?CCL13
GET SUBJ,3 >SUBJ
JUMP ?CND11
?CCL13: EQUAL? PRSO,FALSE-VALUE,ROOMS /?CCL15
SET 'SUBJ,PRSO
?CND11: PRINTC 32
EQUAL? SUBJ,ME,PLAYER \?CCL18
PRINTI "you"
JUMP ?CND16
?CCL15: PRINTR "."
?CCL18: ICALL2 THE-PRINT,SUBJ
?CND16: ZERO? WD /?CND19
EQUAL? WD,W?DO,W?DOES,W?DID \?CCL22
GET PARSE-RESULT,13
ZERO? STACK \?CND19
?CCL22: PRINTC 32
PRINTB WD
?CND19: GET PARSE-RESULT,13
ZERO? STACK /?CND25
PRINTC 32
ZERO? WD /?CCL29
EQUAL? WD,W?DID \?CCL32
GETB VOCAB,0
ADD 1,STACK
ADD VOCAB,STACK >V
GETB V,0
BOR 128,STACK >M
EQUAL? P-PRSA-WORD,W?GET \?CCL37
PRINTI "got"
JUMP ?CND30
?CCL37: ADD V,9 >?TMP1
ADD V,1
GET STACK,0
INTBL? P-PRSA-WORD,?TMP1,STACK,M >N \?CCL39
GET N,1
BTST STACK,PAST-TENSE \?CCL39
PRINTB N
JUMP ?CND30
?CCL39: PRINTB P-PRSA-WORD
PRINTI "ed"
JUMP ?CND30
?CCL32: PRINTB P-PRSA-WORD
EQUAL? WD,W?DO,W?DOES \?CND30
EQUAL? SUBJ,ME,PLAYER /?CND30
FSET? SUBJ,PLURAL /?CND30
PRINTC 115
?CND30: ZERO? OBJ /?CCL49
PRINTC 32
EQUAL? OBJ,SUBJ \?CCL52
FSET? OBJ,PERSONBIT /?CCL55
PRINTI "it"
JUMP ?CND53
?CCL55: FSET? OBJ,FEMALE \?CCL57
PRINTI "her"
JUMP ?CND53
?CCL57: PRINTI "him"
?CND53: PRINTI "self"
JUMP ?CND25
?CCL52: ICALL2 THE-PRINT,OBJ
JUMP ?CND25
?CCL49: ICALL1 ECHO-NOUNS
JUMP ?CND25
?CCL29: PRINTB P-PRSA-WORD
?CND25: PRINTR "."
.FUNCT ECHO-NOUNS:ANY:0:0,WD
EQUAL? PRSO,0,WHAT,NOT-HERE-OBJECT /?CND1
GET PARSE-RESULT,7 >WD
ZERO? WD /?CND3
PRINTC 32
PRINTB WD
?CND3: PRINTC 32
ICALL2 THE-PRINT,PRSO
?CND1: EQUAL? PRSI,0,WHAT,NOT-HERE-OBJECT /FALSE
GET PARSE-RESULT,8 >WD
ZERO? WD /?CND8
PRINTC 32
PRINTB WD
?CND8: PRINTC 32
CALL2 THE-PRINT,PRSI
RSTACK
.FUNCT V-CAN?:ANY:0:0
CALL2 WHO-KNOWS,W?CAN
RSTACK
.FUNCT V-MAY?:ANY:0:0
CALL2 WHO-KNOWS,W?MAY
RSTACK
.FUNCT V-DO?:ANY:0:0
CALL1 TRY-QCONTEXT?
ZERO? STACK \TRUE
GET PARSE-RESULT,16
BTST STACK,PARSE-QUESTION /?CCL5
ZERO? PRSS \?CCL8
ICALL1 MORE-SPECIFIC
RTRUE
?CCL8: PRINTI "So you think"
EQUAL? PRSS,ME,PLAYER \?CCL11
PRINTI " you "
GET PARSE-RESULT,16
BTST STACK,1 \?CND9
PRINTI "don't "
JUMP ?CND9
?CCL11: PRINTC 32
ICALL2 THE-PRINT,PRSS
PRINTC 32
GET PARSE-RESULT,16
BTST STACK,1 \?CND9
PRINTI "doesn't "
?CND9: PRINTB P-PRSA-WORD
ICALL1 ECHO-NOUNS
PRINTR "."
?CCL5: CALL1 WHO-KNOWS
RSTACK
.FUNCT V-COULD?:ANY:0:0
CALL2 WHO-KNOWS,W?COULD
RSTACK
.FUNCT V-WOULD?:ANY:0:0
CALL2 WHO-KNOWS,W?WOULD
RSTACK
.FUNCT V-SHOULD?:ANY:0:0
CALL2 WHO-KNOWS,W?SHOULD
RSTACK
.FUNCT V-MIGHT?:ANY:0:0
CALL2 WHO-KNOWS,W?MIGHT
RSTACK
.FUNCT V-WILL?:ANY:0:0
CALL2 WHO-KNOWS,W?WILL
RSTACK
.FUNCT V-MUST?:ANY:0:0
CALL2 WHO-KNOWS,W?MUST
RSTACK
.FUNCT QUESTION-VERB?:ANY:0:0,TMP
GET PARSE-RESULT,10 >TMP
EQUAL? TMP,W?WHO,W?WHAT,W?WHERE /TRUE
GET PARSE-RESULT,10 >TMP
EQUAL? TMP,W?WHY,W?WHEN,W?HOW /TRUE
EQUAL? PRSA,V?BE?,V?CAN?,V?COULD? /TRUE
EQUAL? PRSA,V?DO?,V?MAY?,V?MIGHT? /TRUE
EQUAL? PRSA,V?MUST?,V?SHOULD?,V?WILL? /TRUE
EQUAL? PRSA,V?WOULD? /TRUE
RFALSE
.FUNCT PRE-DROP?:ANY:0:0
LOC PRSS
EQUAL? PRSO,STACK \FALSE
ICALL PERFORM,V?DISEMBARK,PRSO,PRSI
RTRUE
.FUNCT V-DROP?:ANY:0:0
EQUAL? PRSO,ROOMS \FALSE
PRINT STR?61
PRINTR "hanging from anything."
.FUNCT V-DISEMBARK?:ANY:0:0,AV
LOC PRSS >AV
EQUAL? PRSO,FALSE-VALUE,ROOMS \?CCL3
ZERO? AV /?CCL6
IN? AV,ROOMS /?CCL6
ICALL PERFORM,PRSA,AV,PRSI
RTRUE
?CCL6: PRINT STR?61
PRINTR "in anything."
?CCL3: ZERO? AV /?CCL10
IN? AV,ROOMS /?CCL10
EQUAL? AV,PRSO /FALSE
CALL HELD?,AV,PRSO
ZERO? STACK \FALSE
PRINT STR?55
FSET? AV,SURFACEBIT \?CCL20
PRINTI " on "
JUMP ?CND18
?CCL20: PRINTI " in "
?CND18: ICALL2 THE-PRINT,AV
PRINTR "!"
?CCL10: LOC PRSO
ZERO? STACK /?CCL22
ICALL PERFORM,V?TAKE,PRSO,PRSI
RTRUE
?CCL22: PRINT STR?117
CRLF
RTRUE
.FUNCT PRE-TAKE?:ANY:0:0
ZERO? PRSI \FALSE
CALL1 PRE-TAKE
RSTACK
.FUNCT V-TAKE?:ANY:0:0
GET PARSE-RESULT,10
ZERO? STACK \FALSE
PRINTR "Seems reasonable."
.ENDSEG
.ENDI