-
Notifications
You must be signed in to change notification settings - Fork 38
/
rooms.mud
1990 lines (1835 loc) · 60.9 KB
/
rooms.mud
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
"(c) Copyright 1978, Massachusetts Institute of Technology. All rights reserved."
"GUTS OF FROB: BASIC VERBS, COMMAND READER, PARSER, VOCABULARY HACKERS."
<SETG ALT-FLAG T>
<GDECL (MUDDLE) FIX (TENEX?) <OR ATOM FALSE> (VERS DEV SNM SCRATCH-STR) STRING>
<DEFINE SAVE-IT ("OPTIONAL" (FN <COND (<L? ,MUDDLE 100> "CFS;MADADV SAVE")
(T "<MDL>MADADV.SAVE")>)
(START? T)
"AUX" (MUDDLE ,MUDDLE) STV (ST <REMARKABLY-DISGUSTING-CODE>))
#DECL ((START?) <OR ATOM FALSE> (FN) STRING (MUDDLE) FIX (STV) <OR STRING FIX>)
<ODESC1 <SFIND-OBJ "PAPER"> <UNSPEAKABLE-CODE>>
<SETG DEAD-PLAYER <AACTION ,PLAYER>>
<PUT ,PLAYER ,AACTION <>>
<SETG VERS .ST>
<SETG SCRIPT-CHANNEL <>>
<SETG DBG <>>
<SETG RAW-SCORE 0>
<SET IH <ON "IPC" ,ILO 1>>
<HANDLER ,DIVERT-INT ,DIVERT-HAND>
<COND (<G? .MUDDLE 100>
<SETG SCRATCH-STR <ISTRING 32>>
<SETG DEV "DSK">
<SETG SNM "MDL">)
(<SNAME "">
<SETG DEV "DSK">
<SETG SNM "CFS">)>
<INT-LEVEL 100000>
<SETG DEATHS 0>
<SETG MOVES 0>
<SETG WINNER ,PLAYER>
<RESET ,INCHAN>
<OFF "CHAR" ,INCHAN>
<AND <GASSIGNED? MUD-HAND> <OFF ,MUD-HAND>>
<SETG SAVEREP ,REP>
<SETG REP ,RDCOM>
<COND (<AND <=? <SAVE .FN> "SAVED">
<NOT .START?>>
<HANDLER <EVENT "CHAR" 8 ,INCHAN> ,ZORK-HAND>
<SETG REP ,SAVEREP>
<INT-LEVEL 0>
T)
(T
; "STARTER on 10x sets up tty correctly, setg's DEV to \"MDL\"
if that device exists; if not, (sort of) returns directory save file
came from. On its it returns # zorkers currently in existence."
<RANDOM <CHTYPE <DSKDATE> FIX>>
<SETG XUNM <XUNAME>>
<COND (<AND <L? .MUDDLE 100>
<OR <=? ,XUNM "USERS1">
<=? ,XUNM "USERS2">>>
<TELL ,FLUSHSTR1>
<QUIT>)>
<COND (<AND <TYPE? <SET STV <STARTER>> FIX>
<G=? .STV 3>>
<OR <MEMBER ,XUNM ,WINNERS>
<=? ,XUNM "SEC">
<=? ,XUNM "ELBOW">
<AND <TELL ,FLUSHSTR1>
<QUIT>>>)
(<TYPE? .STV STRING>
<SETG SNM <SUBSTRUC ,SCRATCH-STR
0
<- <LENGTH ,SCRATCH-STR>
<LENGTH <MEMQ <ASCII 0> .STV>>>>>)>
<COND (<G? ,MUDDLE 100> <SETG TENEX? <GETSYS>>)
(<APPLY ,IPC-OFF>
<APPLY ,IPC-ON <UNAME> "ZORK">)>
<SET BH <ON "BLOCKED" ,BLO 100>>
<INT-LEVEL 0>
<START "WHOUS" .ST>)>>
"Stuff for diverting gc's"
<SETG DIVERT-CNT 0>
<SETG DIVERT-MAX 99>
<SETG DIVERT-INC 4000>
<SETG DIVERT-AMT 0>
<SETG DIVERT-LMT 100000>
<GDECL (DIVERT-CNT DIVERT-MAX DIVERT-INC DIVERT-AMT DIVERT-LMT) FIX>
<DEFINE DIVERT-FCN (AMT DUMMY)
#DECL ((AMT) FIX (DUMMY) ATOM)
<SETG DIVERT-CNT <+ ,DIVERT-CNT 1>>
<SETG DIVERT-AMT <+ ,DIVERT-AMT ,DIVERT-INC .AMT>>
<COND (<OR <G? ,DIVERT-CNT ,DIVERT-MAX>
<G? ,DIVERT-AMT ,DIVERT-LMT>> ;"Too much diversion ?"
<SETG DIVERT-AMT <SETG DIVERT-CNT 0>>
<GC-FCN>
<GC>)
(ELSE ;"Divert this request for storage"
<COND (<1? ,DIVERT-CNT> ;"First diversion ?"
<HANDLER ,GC-INT ,GC-HAND>)>
<BLOAT <+ .AMT ,DIVERT-INC>>
;"Get storage desired plus extra increment")>>
<SETG DIVERT-HAND
<HANDLER <SETG DIVERT-INT <EVENT "DIVERT-AGC" 1000>> ,DIVERT-FCN>>
<OFF ,DIVERT-HAND>
<DEFINE GC-FCN ("TUPLE" T)
#DECL ((T) TUPLE)
<OFF ,GC-HAND>
<SETG DIVERT-AMT <SETG DIVERT-CNT 0>>>
<SETG GC-HAND <HANDLER <SETG GC-INT <EVENT "GC" 11>> ,GC-FCN>>
<OFF ,GC-HAND>
<DEFINE XUNAME ()
#DECL ((VALUE) STRING)
<MAPF ,STRING
<FUNCTION (X)
#DECL ((X) CHARACTER)
<COND (<OR <0? <ASCII .X>>
<==? <ASCII .X> 32>>
<MAPSTOP>)
(T .X)>>
<GXUNAME>>>
<DEFINE ITS-GET-NAME (UNAME "AUX" (NM <LSR-ENTRY .UNAME>) CMA JR LFST LLST
TLEN TSTR STR)
#DECL ((STR TSTR UNAME) STRING (NM CMA JR) <OR STRING FALSE>
(TLEN LLST LFST) FIX)
<COND (.NM
<SETG AFFILIATION <STRING <LSR-EXTRACT .NM ,$GRP>>>
<SET NM <STRING <LSR-EXTRACT .NM ,$NAME>>>
<REPEAT (NN MM)
#DECL ((NN MM) <OR FALSE STRING>)
<COND (<SET NN <MEMQ !\" .NM>>
<COND (<SET MM <MEMQ !\" <REST .NN>>>
<SET NM <STRING <SUBSTRUC .NM 0
<- <LENGTH .NM> <LENGTH .NN>>>
<REST .MM>>>)
(<SET NM <SUBSTRUC .NM 0
<- <LENGTH .NM> <LENGTH .NN>>>>)>)
(<RETURN>)>>
<COND (<SET CMA <MEMQ !\, .NM>>
<SET LLST <- <LENGTH .NM> <LENGTH .CMA>>>
<SET CMA <REST .CMA>>
<SET LFST <LENGTH .CMA>>
<COND (<SET JR <MEMQ !\, .CMA>>
<SET LFST <- .LFST <LENGTH .JR>>>)>
<REPEAT ()
<COND (<EMPTY? .CMA> <RETURN>)
(<MEMQ <1 .CMA> %<STRING <ASCII 32> <ASCII 9>>>
<SET CMA <REST .CMA>>
<SET LFST <- .LFST 1>>)
(ELSE <RETURN>)>>
<SET TLEN <+ .LFST 1 .LLST <LENGTH .JR>>>
<SET STR <ISTRING .TLEN !\ >>
<SET TSTR .STR>
<SUBSTRUC .CMA 0 .LFST .TSTR>
<SET TSTR <REST .TSTR <+ .LFST 1>>>
<SUBSTRUC .NM 0 .LLST .TSTR>
<AND .JR <SUBSTRUC .JR 0 <LENGTH .JR> <REST .TSTR .LLST>>>
<SETG USER-NAME .STR>)
(ELSE <SETG USER-NAME .NM>)>)
(<SETG AFFILIATION <>>)>>
<DEFINE UNSPEAKABLE-CODE ("AUX" STR NSTR (LEN-I 0) (O <SFIND-OBJ "PAPER">))
#DECL ((O) OBJECT (NSTR STR) STRING (LEN-I) FIX)
<SET STR <MEMQ !\/ <OREAD .O>>>
<COND (<==? <1 <BACK .STR 2>> !\1>
<SET STR <BACK .STR 2>>
<SET LEN-I 1>)
(<SET STR <BACK .STR 1>>)>
<SET NSTR <REST <MEMQ !\/ <REST <MEMQ !\/ .STR>>> 3>>
<STRING "There is an issue of US NEWS & DUNGEON REPORT dated "
<SUBSTRUC .STR 0 <- <LENGTH .STR> <LENGTH .NSTR>>>
" here.">>
<DEFINE REMARKABLY-DISGUSTING-CODE ("AUX" (N <DSKDATE>))
#DECL ((N) WORD)
<STRING
"This Zork created "
<NTH ,MONTHS <CHTYPE <GETBITS .N <BITS 4 23>> FIX>>
!\
<UNPARSE <CHTYPE <GETBITS .N <BITS 5 18>> FIX>>
!\,
" 19" <UNPARSE <CHTYPE <GETBITS .N <BITS 7 27>> FIX>>
!\.>>
<SETG PLAYED-TIME 0>
<GDECL (PLAYED-TIME) FIX>
<DEFINE GET-TIME ("AUX" (NOW <DSKDATE>) (THEN ,INTIME))
#DECL ((NOW) WORD (THEN) <PRIMTYPE WORD>)
<+ <COND (<N==? <CHTYPE <GETBITS .NOW <BITS 18 18>> FIX>
<CHTYPE <GETBITS .THEN <BITS 18 18>> FIX>>
</ <- <+ <CHTYPE <GETBITS .NOW <BITS 18 0>> FIX>
<* 24 7200>>
<CHTYPE <GETBITS .THEN <BITS 18 0>> FIX>>
2>)
(</ <- <CHTYPE <GETBITS .NOW <BITS 18 0>> FIX>
<CHTYPE <GETBITS .THEN <BITS 18 0>> FIX>>
2>)>
,PLAYED-TIME>>
<DEFINE PLAY-TIME ("OPTIONAL" (LOSER? T)
"AUX" (OUTCHAN .OUTCHAN) TIME MINS)
#DECL ((MINS TIME) FIX (LOSER?) <OR ATOM FALSE> (OUTCHAN) CHANNEL)
<SET TIME <GET-TIME>>
<SETG TELL-FLAG T>
<COND (.LOSER? <PRINC "You have been playing ZORK for ">)
(T
<PRINC "Played for ">)>
<AND <G? <SET MINS </ .TIME 3600>> 0>
<PRIN1 .MINS>
<PRINC " hour">
<OR <1? .MINS> <PRINC "s">>
<PRINC ", ">>
<COND (<G? <SET MINS <MOD </ .TIME 60> 60>> 0>
<PRIN1 .MINS>
<PRINC " minute">
<COND (<NOT <1? .MINS>> <PRINC "s">)>
<PRINC ", and ">)>
<PRIN1 <SET MINS <MOD .TIME 60>>>
<PRINC " second">
<OR <1? .MINS> <PRINC "s">>
<COND (.LOSER? <PRINC ".
">)
(<PRINC ".">)>
.TIME>
<DEFINE HANDLE (FRM "TUPLE" ZORK "AUX" ZF CH)
#DECL ((ZF) ANY (FRM) <OR FALSE FRAME>
(ZORK) <SPECIAL TUPLE> (CH) <OR CHANNEL FALSE>)
<PUT ,OUTCHAN 13 80>
<COND (<AND <OR <NOT <GASSIGNED? XUNM>>
<MEMBER ,XUNM ,WINNERS>
,DBG>
T>
<TTY-UNINIT>
<AND <GASSIGNED? SAVEREP> <SETG REP ,SAVEREP>>
<AND <ASSIGNED? BH> <OFF .BH>>
<AND <GASSIGNED? ZORK-HAND> <OFF ,ZORK-HAND>>
<AND <GASSIGNED? MUD-HAND> <HANDLER <GET ,INCHAN INTERRUPT> ,MUD-HAND>>
<INT-LEVEL 0>
<SETG DBG T>
<OR .FRM <LISTEN>>)
(,ERRFLG
<QUIT>)
(T
<COND (<AND <NOT <EMPTY? .ZORK>>
<==? <1 .ZORK> CONTROL-G?!-ERRORS>>
<INT-LEVEL 0>
<FINISH>
<AND .FRM <ERRET T .FRM>>)
(<AND <==? <LENGTH .ZORK> 3>
<==? <1 .ZORK> FILE-SYSTEM-ERROR!-ERRORS>
<NOT <SET ZF <3 .ZORK>>>
<==? <LENGTH .ZF> 3>
<=? <1 .ZF>
"ILLEGAL CHR AFTER CNTRL P ON TTY DISPLAY">>
; "HACK FOR ILLEGAL CHR AFTER CTRL-P"
<INT-LEVEL 0>
<ERRET T .FRM>)
(<SETG ERRFLG T>
<UNWIND
<PROG ()
<INT-LEVEL 0>
<TELL
"I'm sorry, you seem to have encountered an error in the program.">
<COND (<SET CH <RECOPEN "BUG">>
<TELL "Please describe what happened:">
<BUGGER .CH>)
(<TELL
"Send mail to ZORK@MIT-DMS describing what it was you tried to do.">
<TELL ,VERS>
<MAPF <>
<FUNCTION (X)
#DECL ((X) ANY)
<PRINT .X>>
.ZORK>)>
<FINISH #FALSE (". Error.")>>
<FINISH #FALSE (". Error.")>>)>)>>
<PSETG WINNERS '["HESS" "BKD" "TAA" "MARC" "PDL" "MDL"]>
<SETG ERRFLG <>>
<GDECL (WINNERS) <VECTOR [REST STRING]> (ERRFLG) <OR ATOM FALSE>>
<OR <LOOKUP "COMPILE" <ROOT>>
<AND <GET PACKAGE OBLIST> <LOOKUP "GLUE" <GET PACKAGE OBLIST>>>
<LOOKUP "GROUP-GLUE" <GET INITIAL OBLIST>>
<AND <SETG ERRH
<HANDLER <OR <GET ERROR!-INTERRUPTS INTERRUPT> <EVENT "ERROR" 8>>
,HANDLE>>
<OFF ,ERRH>>>
<GDECL (MOVES) FIX (SCRIPT-CHANNEL) <OR CHANNEL FALSE>>
<DEFINE START (RM "OPTIONAL" (ST "") "AUX" FN (MUDDLE ,MUDDLE) (XUNM <XUNAME>))
#DECL ((ST RM) STRING (MUDDLE) FIX (XUNM) STRING (FN) <OR FALSE STRING>)
<SETG XUNM .XUNM>
<SETG INTIME <DSKDATE>>
<COND (<L? .MUDDLE 100>
<AND <G? <LENGTH .XUNM> 2> <=? <SUBSTRUC .XUNM 0 3> "___"> <QUIT>>
<SET FN <ITS-GET-NAME .XUNM>>)
(<SET FN <GET-NAME>>
<COND (<NOT ,TENEX?>
<AND <0? <13 ,OUTCHAN>>
<PUT ,OUTCHAN 13 80>>)>)>
<COND (.FN
<SETG USER-NAME .FN>)
(<SETG USER-NAME .XUNM>)>
<PUT ,WINNER ,AROOM <SETG HERE <FIND-ROOM .RM>>>
<TELL .ST>
<COND (<GASSIGNED? MSG-STRING>
<TELL ,MSG-STRING>)>
<CONTIN T>>
<DEFINE CONTIN ("OPTIONAL" (FOO <>))
<EXCRUCIATINGLY-UNTASTEFUL-CODE>
<COND (.FOO
<ON "CHAR" ,CTRL-S 8 0 ,INCHAN>)
(<SETG REP ,RDCOM>)>
<TTY-INIT .FOO>
<SETG WINNER ,PLAYER>
<PUT ,PRSVEC 2 <>>
<ROOM-INFO 3>
,NULL>
<DEFINE DC ("OPTIONAL" (RM ,HERE) "TUPLE" OBJS)
<COND (<TYPE? .RM STRING>
<SET RM <FIND-ROOM .RM>>)>
<COND (<OR <==? .RM ,HERE> <GOTO .RM>>
<CONS-OBJ !.OBJS>
<RESET ,INCHAN>
<CONTIN <>>
<AND <GASSIGNED? MUD-HAND> <OFF ,MUD-HAND>>
<AND <GASSIGNED? ZORK-HAND> <HANDLER <GET ,INCHAN INTERRUPT> ,ZORK-HAND>>
<ERRET>)>>
<SETG MY-SCRIPT <>>
<GDECL (MY-SCRIPT) <OR ATOM FALSE>>
<DEFINE MAKE-SCRIPT ("AUX" CH)
#DECL ((CH) <OR CHANNEL FALSE>)
<COND (,SCRIPT-CHANNEL
<>)
(<SET CH <OPEN "PRINT" <STRING "MARC;%Z" ,XUNM " >">>>
<PUT <TOP ,INCHAN> 1 (.CH)>
<PUT <TOP ,OUTCHAN> 1 (.CH)>
<SETG SCRIPT-CHANNEL .CH>
<SETG MY-SCRIPT T>)>>
<DEFINE FLUSH-ME ()
<UNWIND
<PROG ()
<TELL ,FLUSHSTR2 ,LONG-TELL>
<FINISH <>>>
<FINISH <>>>>
<DEFINE DO-SCRIPT ("AUX" (CH <>) (UNM ,XUNM) (MUDDLE ,MUDDLE))
#DECL ((CH) <OR CHANNEL FALSE> (UNM) STRING (MUDDLE) FIX)
<COND (,MY-SCRIPT
<DO-UNSCRIPT <>>)>
<COND (,SCRIPT-CHANNEL
<TELL "You are already scripting.">)
(<AND
<OR <G? .MUDDLE 100>
<AND <SET CH <OPEN "READ" ".FILE." "(DIR)" "DSK" .UNM>>
<=? <10 .CH> .UNM>
<CLOSE .CH>>>
<SET CH <OPEN "PRINT" "ZORK" "SCRIPT" "DSK" .UNM>>>
<PUT <TOP ,INCHAN> 1 (.CH)>
<PUT <TOP ,OUTCHAN> 1 (.CH)>
<SETG SCRIPT-CHANNEL .CH>
<COND (<L? ,MUDDLE 100>
<TELL "Scripting to " ,POST-CRLF ,XUNM ";ZORK SCRIPT">)
(T
<TELL "Scripting to <" ,POST-CRLF ,XUNM ">ZORK.SCRIPT">)>)
(T
<COND (.CH <CLOSE .CH>)>
<TELL "I can't open the script channel.">)>>
<DEFINE DO-UNSCRIPT ("OPTIONAL" (VERBOSE T))
#DECL ((VERBOSE) <OR ATOM FALSE>)
<COND (,SCRIPT-CHANNEL
<PUT <TOP ,INCHAN> 1 ()>
<PUT <TOP ,OUTCHAN> 1 ()>
<CLOSE ,SCRIPT-CHANNEL>
<SETG SCRIPT-CHANNEL <>>
<AND .VERBOSE <TELL "Scripting off.">>)
(<AND .VERBOSE <TELL "Scripting wasn't on.">>)>>
<GDECL (THEN) FIX>
<DEFINE DO-SAVE ("OPTIONAL" (UNM ,XUNM) "AUX" FNM (MUDDLE ,MUDDLE) (CH <>))
#DECL ((FNM) STRING (CH) <OR CHANNEL FALSE> (MUDDLE) FIX (UNM) STRING)
<COND (<RTRNN <SFIND-ROOM "TSTRS"> ,RSEENBIT>
<TELL "Saves not permitted from end game.">)
(T
<COND (,SCRIPT-CHANNEL <DO-UNSCRIPT>)>
<TELL "Saving.">
<COND (<MEMBER .UNM ,WINNERS>)
(ELSE
<INT-LEVEL 100000>
<OFF ,ZORK-HAND>
<OFF "CHAR" ,INCHAN>)>
<SETG THEN <CHTYPE <DSKDATE> FIX>>
<SETG PLAYED-TIME <GET-TIME>>
<COND (<AND <SET CH <OPEN "PRINTB"
<COND (<L? .MUDDLE 100>
<STRING <GET-DEV>
!\: .UNM
";ZORK SAVE">)
(T
<STRING "DSK:<" .UNM ">ZORK." ,SAVNM>)>>>
<OR <G? .MUDDLE 100>
<=? <10 .CH> .UNM>>>
<SETG SRUNM .UNM>
<SAVE-GAME .CH>
<FINISH <CHTYPE '(". Saved.") FALSE>>)
(T
<COND (.CH
<CLOSE .CH>
<RENAME <STRING <9 .CH> !\: <10 .CH> !\;
<7 .CH> !\ <8 .CH>>>)>
<TELL "Save failed.">
<COND (<NOT .CH> <TELL <1 .CH> ,POST-CRLF " " <2 .CH>>)
(T
<TELL " " ,POST-CRLF>)>)>
<COND (<NOT <MEMBER .UNM ,WINNERS>>
<HANDLER <EVENT "CHAR" 8 ,INCHAN> ,ZORK-HAND>)>
<INT-LEVEL 0>)>>
<SETG SAVNM "SAVE">
<GDECL (SAVNM) STRING>
<DEFINE DO-RESTORE DR ("OPTIONAL" (XUNM ,XUNM) "AUX" CH STR (MUDDLE ,MUDDLE) NOW)
#DECL ((CH) <OR CHANNEL FALSE> (STR) STRING (NOW MUDDLE) FIX
(DR) ACTIVATION (XUNM) STRING)
<COND (<RTRNN <SFIND-ROOM "TSTRS"> ,RSEENBIT>
<TELL "Restores not permitted into end game.">
<RETURN T .DR>)
(<L? .MUDDLE 100>
<SET STR <STRING <GET-DEV> !\: .XUNM ";ZORK SAVE">>)
(T
<SET STR <STRING "DSK:<" .XUNM ">ZORK." ,SAVNM>>)>
<PROG ((FOO T) (SNM <SNAME>))
#DECL ((FOO) <OR ATOM FALSE> (SNM) <SPECIAL STRING>)
<COND (<SET CH <OPEN "READB" .STR>>
<SETG SRUNM .XUNM>
<COND (<RESTORE-GAME .CH>
<SETG INTIME <CHTYPE <DSKDATE> FIX>>
<SCORE-BLESS>
<SETG RESTORE-HAPPENED T>
<TELL "Restored.">)
(<TELL "Restore failed.">)>
<ROOM-DESC>)
(<AND .FOO <G? .MUDDLE 100>>
<SET STR <STRING "DSK:<" <SNAME> ">ZORK.SAVE">>
<SET FOO <>>
<AGAIN>)
(<TELL <2 .CH> ,POST-CRLF " " <1 .CH>>)>>>
<DEFINE GET-DEV ("AUX" T (TAB ,DEVICE-TABLE))
#DECL ((TAB) <VECTOR [REST STRING]> (T) <OR FALSE VECTOR>)
<COND (<SET T <MEMBER ,AFFILIATION .TAB>>
<2 .T>)
("DSK")>>
"GET-ATOM TAKES A VALUE AND SEARCHES INITIAL FOR FIRST ATOM
SETG'ED TO THAT."
<DEFINE GET-ATOM ACT (VAL "AUX" (O <GET INITIAL OBLIST>))
#DECL ((O) OBLIST (ACT) ACTIVATION (VAL) ANY)
<MAPF <>
<FUNCTION (X) #DECL ((X) <LIST [REST ATOM]>)
<MAPF <>
<FUNCTION (X) #DECL ((X) ATOM)
<COND (<AND <GASSIGNED? .X>
<==? ,.X .VAL>>
<RETURN .X .ACT>)>>
.X>>
.O>>
;
"ROOM-INFO --
PRINT SOMETHING ABOUT THIS PLACE
1. CHECK FOR LIGHT --> ELSE WARN LOSER
2. GIVE A DESCRIPTION OF THE ROOM
3. TELL WHAT'S ON THE FLOOR IN THE WAY OF OBJECTS
4. SIGNAL ENTRY INTO THE ROOM
"
<SETG BRIEF!-FLAG <>>
<SETG SUPER-BRIEF!-FLAG <>>
<SETG NO-OBJ-PRINT!-FLAG <>>
<GDECL (SUPER-BRIEF!-FLAG BRIEF!-FLAG NO-OBJ-PRINT!-FLAG) <OR ATOM FALSE>>
<DEFINE VERBOSE ()
<SETG BRIEF!-FLAG <>>
<SETG SUPER-BRIEF!-FLAG <>>
<TELL "Maximum verbosity.">>
<DEFINE BRIEF ()
<SETG BRIEF!-FLAG T>
<SETG SUPER-BRIEF!-FLAG <>>
<TELL "Brief descriptions.">>
<DEFINE SUPER-BRIEF ()
<SETG SUPER-BRIEF!-FLAG T>
<TELL "No long descriptions.">>
<DEFINE NO-OBJ-HACK ()
<COND (<SETG NO-OBJ-PRINT!-FLAG <NOT ,NO-OBJ-PRINT!-FLAG>>
<TELL "Don't print objects.">)
(<TELL "Print objects.">)>>
<DEFINE ROOM-NAME () <TELL <RDESC2 ,HERE>>>
<DEFINE ROOM-DESC () <ROOM-INFO 3>>
<DEFINE ROOM-OBJ ()
<ROOM-INFO 1>
<COND (<NOT ,TELL-FLAG>
<TELL "I see no objects here.">)>>
<DEFINE ROOM-ROOM () <ROOM-INFO 2>>
<DEFINE ROOM-INFO ("OPTIONAL" (FULL <>)
"AUX" (AV <AVEHICLE ,WINNER>) (RM ,HERE) (PRSO <2 ,PRSVEC>)
(WINOBJ <SFIND-OBJ "#####">) (OUTCHAN ,OUTCHAN) RA
(FULLQ <>) (FIRST? T))
#DECL ((RM) ROOM (WINOBJ) OBJECT (AV) <OR FALSE OBJECT> (OUTCHAN) CHANNEL
(PRSO) <OR DIRECTION FALSE OBJECT> (FULL) <OR FIX FALSE>
(FULLQ FIRST?) <OR ATOM FALSE>)
<COND (<TYPE? .PRSO DIRECTION>
<SETG FROMDIR .PRSO>
<SET PRSO <>>
<PUT ,PRSVEC 2 <>>)>
<COND (<NOT <RTRNN .RM ,RSEENBIT>> <SET FULLQ T>)>
<PROG ()
<COND (<OR <NOT .FULL> <NOT <0? <CHTYPE <ANDB .FULL 2> FIX>>>>
<COND (<N==? ,HERE <AROOM ,PLAYER>>
<PUT ,PRSVEC 1 <FIND-VERB "GO-IN">>
<TELL "Done.">
<RETURN>)
(.PRSO
<COND (<OBJECT-ACTION>)
(<OREAD .PRSO> <TELL <OREAD .PRSO> ,LONG-TELL1>)
(<TELL "I see nothing special about the "
,POST-CRLF
<ODESC2 .PRSO>
".">)>
<RETURN>)
(<NOT <LIT? .RM>>
<TELL
"It is pitch black. You are likely to be eaten by a grue.">
<RETURN <>>)>
<TELL <RDESC2 .RM>>
<COND (<OR <AND <NOT .FULL> ,SUPER-BRIEF!-FLAG>
<AND <RTRNN .RM ,RSEENBIT>
<OR ,BRIEF!-FLAG <PROB 80>>
<NOT .FULL>>>)
(<AND <EMPTY? <RDESC1 .RM>> <SET RA <RACTION .RM>>>
<PERFORM .RA <FIND-VERB "LOOK">>
<PUT ,PRSVEC 1 <FIND-VERB "FOO">>
<PUT ,PRSVEC 2 <>>)
(<TELL <RDESC1 .RM> ,LONG-TELL1>)>
<RTRO .RM ,RSEENBIT>
<AND .AV <TELL "You are in the " ,POST-CRLF <ODESC2 .AV> ".">>)>
<COND
(<NOT <LIT? .RM>> <TELL "I can't see anything.">)
(<OR <AND <NOT .FULL> <NOT ,NO-OBJ-PRINT!-FLAG>>
<NOT <0? <CHTYPE <ANDB .FULL 1> FIX>>>>
<MAPF <>
<FUNCTION (X)
#DECL ((X) OBJECT)
<COND (<AND <TRNN .X ,OVISON>
<OR <AND .FULL <1? .FULL>> <DESCRIBABLE? .X>>>
<COND (<==? .X .AV>)
(T
<COND (<LONG-DESC-OBJ .X .FULL .FULLQ .FIRST?>
<SET FIRST? <>>
<AND .AV <TELL " [in the room]" 0>>
<TELL "" 1>)>)>
<COND (<TRNN .X ,ACTORBIT> <INVENT <OACTOR .X>>)
(<SEE-INSIDE? .X>
<PRINT-CONT
.X
.AV
.WINOBJ
,INDENTSTR
<COND (.FULL)
(,SUPER-BRIEF!-FLAG <>)
(,BRIEF!-FLAG <>)
(T)>>)>)>>
<ROBJS .RM>>)>
<COND (<AND <SET RA <RACTION .RM>> <NOT .FULL>>
<PERFORM .RA <FIND-VERB "GO-IN">>
<PUT ,PRSVEC 1 <FIND-VERB "FOO">>)>
T>>
"Give a description of an object.
Do short descriptions for the 'object' command.
Otherwise, try odesco (if never touched), odesc1, or odesc2, based
on the state of briefness."
<DEFINE LONG-DESC-OBJ (OBJ "OPTIONAL" (FULL 1) (FULLQ <>) (FIRST? <>) "AUX" STR)
#DECL ((FULLQ FIRST?) <OR ATOM FALSE> (OBJ) OBJECT
(STR) <OR FALSE STRING> (FULL) <OR FIX FALSE>)
<COND (<AND <NOT .FULL>
<OR ,SUPER-BRIEF!-FLAG <AND <NOT .FULLQ> ,BRIEF!-FLAG>>>
<COND (.FIRST? <TELL "You can see:">)>
<TELL "a " 0 <ODESC2 .OBJ>>)
(<AND .FULL <1? .FULL>>
<COND (<AND <NOT <EMPTY? <SET STR <ODESCO .OBJ>>>>
<NOT <TRNN .OBJ ,TOUCHBIT>>>
<TELL .STR ,LONG-TELL>)
(<NOT <EMPTY? <SET STR <ODESC1 .OBJ>>>>
<TELL .STR ,LONG-TELL>)
(<TELL "There is a " ,LONG-TELL <ODESC2 .OBJ> " here.">)>)
(T
<COND (<OR <TRNN .OBJ ,TOUCHBIT> <NOT <ODESCO .OBJ>>>
<SET STR <ODESC1 .OBJ>>)
(<SET STR <ODESCO .OBJ>>)>
<COND (<EMPTY? .STR> <>) (<TELL .STR ,LONG-TELL>)>)>>
<PSETG INDENTSTR <REST <ISTRING 8> 8>>
<DEFINE PRINT-CONT PRINT-C (OBJ AV WINOBJ INDENT "OPTIONAL" (CASE? T)
"AUX" (CONT <OCONTENTS .OBJ>) (ALSO <>) (TOBJ <>))
#DECL ((AV) <OR FALSE OBJECT> (OBJ WINOBJ) OBJECT (INDENT) STRING
(CONT) <LIST [REST OBJECT]> (ALSO TOBJ) <OR ATOM FALSE>
(PRINT-C) ACTIVATION (CASE?) <OR ATOM FIX FALSE>)
<COND (<NOT <EMPTY? .CONT>>
<COND (<OR ,SUPER-BRIEF!-FLAG <==? .OBJ <SFIND-OBJ "TCASE">>>
<SET TOBJ T>)
(ELSE
<MAPF <>
<FUNCTION (Y "AUX" STR)
#DECL ((Y) OBJECT (STR) <OR FALSE STRING>)
<COND (<AND .AV <==? .Y .WINOBJ>>)
(<AND <TRNN .Y ,OVISON>
<NOT <TRNN .Y ,TOUCHBIT>>
<SET STR <ODESCO .Y>>>
<SET ALSO T>
<TELL .STR>
<COND (<SEE-INSIDE? .Y>
<PRINT-CONT .Y .AV .WINOBJ <BACK .INDENT>>)>)
(<SET TOBJ T>)>>
<OCONTENTS .OBJ>>)>
<COND (<==? .OBJ <SFIND-OBJ "TCASE">>
<COND (<NOT .CASE?> <RETURN T .PRINT-C>)>
<AND .TOBJ <TELL "Your collection of treasures consists of:">>)
(<AND .TOBJ
<NOT <AND <==? <LENGTH .CONT> 1>
<==? <1 .CONT> <SFIND-OBJ "#####">>>>>
<TELL .INDENT 0>
<TELL "The "
,POST-CRLF
<ODESC2 .OBJ>
<COND (.ALSO " also contains:")
(" contains:")>>)
(<RETURN T .PRINT-C>)>
<COND (.TOBJ
<MAPF <>
<FUNCTION (Y)
#DECL ((Y) OBJECT)
<COND (<AND .AV <==? .Y .WINOBJ>>)
(<AND <TRNN .Y ,OVISON>
<DESCRIBABLE? .Y>
<NOT <EMPTY? <ODESC2 .Y>>>>
<TELL .INDENT ,POST-CRLF " A " <ODESC2 .Y>>)>
<COND (<SEE-INSIDE? .Y>
<PRINT-CONT .Y .AV .WINOBJ <BACK .INDENT>>)>>
<OCONTENTS .OBJ>>)>)>>
"TRUE IF PARSER WON: OTHERWISE INHIBITS OBJECT ACTIONS, CLOCKS (BUT NOT THIEF)."
<GDECL (PARSE-WON)
<OR ATOM FALSE>
(PARSE-CONT)
<OR FALSE <VECTOR [REST STRING STRING FIX]>>>
<SETG PARSE-CONT <>>
<DEFINE RDCOM ("OPTIONAL" (IVEC <>)
"AUX" VC RVEC (INPLEN 1) (INBUF ,INBUF)
(WINNER ,WINNER) AV (OUTCHAN ,OUTCHAN) RANDOM-ACTION PC RV)
#DECL ((RVEC PC) <OR FALSE VECTOR> (INPLEN) FIX (INBUF) STRING
(WINNER) ADV (AV) <OR FALSE OBJECT> (OUTCHAN) CHANNEL
(IVEC) <OR FALSE VECTOR> (VC) <OR FALSE VECTOR> (RV) <OR FALSE VECTOR>)
<COND (<NOT .IVEC>
<COND (<0? <13 .OUTCHAN>>
<PUT .OUTCHAN 13 80>)>
<TTY-INIT <>>
<OR ,TELL-FLAG <ROOM-INFO <>>>)>
<REPEAT (VVAL CV LIT? HERE)
#DECL ((CV) <OR FALSE VERB> (LIT?) <OR ATOM FALSE> (HERE) ROOM)
<SET VVAL T>
<SET PC <>>
<SET HERE ,HERE>
<SET INBUF ,INBUF>
<SET LIT? <LIT? .HERE>>
<COND (<SET PC ,PARSE-CONT>)
(<NOT .IVEC>
<SETG TELL-FLAG <>>
<SET INPLEN <READST .INBUF ">" <>>>
<COND (<AND <G? .INPLEN 0> <==? <1 .INBUF> !\;>>
<AGAIN>)>
<SET VC <LEX .INBUF <REST .INBUF .INPLEN>>>)>
<COND (<G? .INPLEN 0>
<SETG MOVES <+ ,MOVES 1>>
<COND (<SETG PARSE-WON
<AND <SET RV <OR .IVEC .PC .VC>>
<EPARSE .RV <>>
<TYPE? <SET CV <1 <SET RVEC ,PRSVEC>>> VERB>>>
<SETG NO-TELL 0>
<COND (<NOT <SET RANDOM-ACTION <AACTION .WINNER>>>)
(<APPLY-RANDOM .RANDOM-ACTION>
<RETURN>)>
<AND <SET AV <AVEHICLE .WINNER>>
<SET RANDOM-ACTION <OACTION .AV>>
<SET VVAL <NOT <APPLY-RANDOM .RANDOM-ACTION READ-IN>>>>
<SETG NO-TELL 0>
<COND (<AND .VVAL <SET RANDOM-ACTION <VFCN .CV>>
<APPLY-RANDOM .RANDOM-ACTION>>
<SETG NO-TELL 0>
<COND (<AND <NOT .LIT?>
<==? .HERE <SET HERE ,HERE>>
<LIT? .HERE>>
<PERFORM ,ROOM-INFO <FIND-VERB "LOOK">>)>
<COND (<AND <SET RANDOM-ACTION <RACTION ,HERE>>
<APPLY-RANDOM .RANDOM-ACTION>>)>)>)
(.IVEC
<COND (,TELL-FLAG
<TELL "Please input entire command again.">)
(<TELL "Nothing happens.">)>
<RETURN>)>
<OR ,TELL-FLAG <TELL "Nothing happens.">>)
(T
<SETG PARSE-WON <>>)>
<COND (,BUGFLAG <SETG BUGFLAG <>>)
(<MAPF <>
<FUNCTION (X)
#DECL ((X) HACK)
<COND (<SET RANDOM-ACTION <HACTION .X>>
<SETG NO-TELL 0>
<APPLY-RANDOM .RANDOM-ACTION .X>)>>
,DEMONS>)>
<SETG NO-TELL 0>
<AND ,PARSE-WON
<SET AV <AVEHICLE .WINNER>>
<SET RANDOM-ACTION <OACTION .AV>>
<APPLY-RANDOM .RANDOM-ACTION READ-OUT>>
<AND .IVEC <RETURN>>
<COND (<NOT <LIT? ,HERE>>
<SETG PARSE-CONT <>>)>>>
<DEFINE SCORE-OBJ (OBJ "AUX" TEMP)
#DECL ((OBJ) OBJECT (TEMP) FIX)
<COND (<G? <SET TEMP <OFVAL .OBJ>> 0>
<SCORE-UPD .TEMP>
<OFVAL .OBJ 0>)>>
<DEFINE SCORE-ROOM (RM "AUX" TEMP)
#DECL ((RM) ROOM (TEMP) FIX)
<COND (<G? <SET TEMP <RVAL .RM>> 0>
<SCORE-UPD .TEMP>
<RVAL .RM 0>)>>
<DEFINE SCORE-UPD (NUM "AUX" (WINNER ,WINNER))
#DECL ((NUM) FIX (WINNER) ADV)
<COND (,END-GAME!-FLAG
<SETG EG-SCORE <+ ,EG-SCORE .NUM>>)
(<SETG RAW-SCORE <+ ,RAW-SCORE .NUM>>
<PUT .WINNER ,ASCORE <+ <ASCORE .WINNER> .NUM>>
<SCORE-BLESS>)>>
<DEFINE SCORE-BLESS ("AUX" (NUM <ASCORE ,WINNER>) (MS ,SCORE-MAX))
#DECL ((NUM MS) FIX)
<COND (<OR <G=? .NUM .MS>
<AND <1? ,DEATHS> <G=? .NUM <- .MS 10>>>>
<CLOCK-ENABLE <CLOCK-INT ,EGHER 15>>)>>
<DEFINE END-GAME-HERALD ()
<SETG END-GAME!-FLAG T>
<TELL ,END-HERALD-1 ,LONG-TELL1>>
<DEFINE SCORE ("OPTIONAL" (ASK? T) "AUX" (EG ,END-GAME!-FLAG)
SCOR SMAX (OUTCHAN .OUTCHAN) PCT)
#DECL ((ASK?) <OR ATOM FALSE> (SCOR SMAX) FIX (OUTCHAN) CHANNEL (PCT) FLOAT
(EG) <OR ATOM FALSE>)
<SETG TELL-FLAG T>
<CRLF>
<PRINC "Your score ">
<COND (.EG
<PRINC "in the end game ">)>
<COND (.ASK? <PRINC "would be ">)
(<PRINC "is ">)>
<COND (.EG
<PRIN1 <SET SCOR ,EG-SCORE>>)
(<PRIN1 <SET SCOR <ASCORE ,WINNER>>>)>
<PRINC " [total of ">
<PRIN1 <SET SMAX <COND (.EG ,EG-SCORE-MAX) (,SCORE-MAX)>>>
<PRINC " points], in ">
<PRIN1 ,MOVES>
<COND (<1? ,MOVES> <PRINC " move.">)
(<PRINC " moves.">)>
<CRLF>
<PRINC "This score gives you the rank of ">
<SET PCT </ <FLOAT .SCOR> <FLOAT .SMAX>>>
<PRINC <COND (.EG
<COND (<1? .PCT> "Dungeon Master")
(<G? .PCT .75> "Super Cheater")
(<G? .PCT .50> "Master Cheater")
(<G? .PCT .25> "Advanced Cheater")
("Cheater")>)
(<COND (<1? .PCT> "Cheater")
(<G? .PCT 0.95000000> "Wizard")
(<G? .PCT 0.89999999> "Master")
(<G? .PCT 0.79999999> "Winner")
(<G? .PCT 0.60000000> "Hacker")
(<G? .PCT 0.39999999> "Adventurer")
(<G? .PCT 0.19999999> "Junior Adventurer")
(<G? .PCT 0.09999999> "Novice Adventurer")
(<G? .PCT 0.04999999> "Amateur Adventurer")
(<G=? .PCT 0.0> "Beginner")
("Incompetent")>)>>
<PRINC ".">
<CRLF>
.SCOR>
<DEFINE FINISH ("OPTIONAL" (ASK? T) "AUX" SCOR)
#DECL ((ASK?) <OR ATOM <PRIMTYPE LIST>> (SCOR) FIX)
<COND (<==? <PRIMTYPE .ASK?> LIST>
<SET ASK? <CHTYPE .ASK? FALSE>>)>
<SETG NO-TELL 0>
<UNWIND
<PROG ()
<SET SCOR <SCORE .ASK?>>
<COND (<OR <AND .ASK?
<TELL
"Do you wish to leave the game? (Y is affirmative): ">
<YES/NO <>>>
<NOT .ASK?>>
<RECORD .SCOR ,MOVES ,DEATHS .ASK? ,HERE>
<QUIT>)
(<TELL "OK.">)>>
<QUIT>>>
<DEFINE VERSION () <TELL ,VERS>>
"PRINT OUT DESCRIPTION OF LOSSAGE: WHEN PLAYED, SCORE, # MOVES, ETC.
IF CALLED WITH CHANNEL, MUST BE FROM ERROR HANDLER--ERROR OCCURRED, GAME
WILL GO AWAY WHEN FINISHES."
<SETG RECORD-STRING <ISTRING 5>>
<SETG BUGFLAG <>>
<GDECL (RECORD-STRING) STRING (BUGFLAG) <OR ATOM FALSE>>
<PSETG RECORDER-STRING <STRING <ASCII 26> <ASCII 3> <ASCII 0>>>
<DEFINE FEECH ()
<BUGGER T>>
<DEFINE BUGGER ("OPTIONAL" (FEECH? <>) "AUX" (DEATH? <TYPE? .FEECH? CHANNEL>)
CT STR (CH <>))
#DECL ((STR) STRING (CH) <OR FALSE <CHANNEL FIX>> (FEECH?) <OR CHANNEL ATOM FALSE>
(CT) FIX (DEATH?) <OR ATOM FALSE>)
<COND (<GASSIGNED? BUGSTR>
<SET STR ,BUGSTR>)
(<SETG BUGSTR <SET STR <ISTRING 3000>>>)>
<RESET ,INCHAN>
<TTY-INIT <>>
<SETG BUGFLAG T>
<UNWIND
<PROG BUGGER ((MUDDLE ,MUDDLE))
#DECL ((MUDDLE) FIX (BUGGER) ACTIVATION (ZORK) TUPLE)
<COND (.DEATH?
<SET CH .FEECH?>
<SET FEECH? <>>)
(T <TELL "Hold on...">)>
<COND (<AND <G? .MUDDLE 100> <NOT .CH> <NOT <SET CH <RECOPEN "BUG">>>>
<TELL "Bug report not possible?">)
(T
<COND (<G? .MUDDLE 100> <CLOSE .CH>)>
<PROG ()
<TELL <COND (.FEECH? "Feature") ("Bug")>
,POST-CRLF
" (terminate with altmode): ">
<SET CT <READST .STR "" T>>
<COND (<==? .CT <LENGTH .STR>>
<TELL "Bug too long?">)
(<0? .CT>
<COND (.DEATH?
<TELL "You can do better than that!">
<AGAIN>)
(<RETURN T .BUGGER>)>)>>
<COND (<L? .MUDDLE 100>
<SET CH <OPEN "PRINT" "COMSYS;_ZTMP_ >">>
<PRINT "SENDER" .CH>
<PRINT ,XUNM .CH>
<PRINT "FROM" .CH>
<PRINT ,XUNM .CH>
<PRINC "\"TO\"
(\"ZORK\")
\"ACTION-TO\"
(\"ZORK\")
\"SCHEDULE\"
(\"SENDING\" #FALSE ())
\"SUBJECT\" \"ZORK " .CH>
<COND (.FEECH? <PRINC "feature\"" .CH>)
(<PRINC "bug\"" .CH>)>
<PRINC "
\"TEXT\" \"" .CH>)
(<NOT <SET CH <RECOPEN "BUG">>>
<TELL "Bug channel can't be opened??">
<RETURN T .BUGGER>)
(<CRLF .CH>
<PRINC "
******** " .CH>
<COND (.FEECH? <PRINC "FEATURE REQUEST" .CH>)
(<PRINC "BUG REPORT" .CH>)>
<PRINC " **********" .CH>
<CRLF .CH>)>
<PRINC ,VERS .CH>
<RECOUT .CH <ASCORE ,WINNER> ,MOVES ,DEATHS #FALSE (". Griping.")
,HERE>
<PRINC "
Text:
" .CH>
<COND (<L? .MUDDLE 100>
<PUT .CH 13 <CHTYPE <MIN> FIX>>
<PRINC !\\\ .CH>
<SET STR <SUBSTRUC .STR 0
.CT
<BACK <REST .STR
<LENGTH .STR>>
.CT>>>
<REPEAT ((SS .STR))
#DECL ((SS) <OR FALSE STRING>)
<COND (<SET SS <MEMQ !\" .SS>>
<PUT .SS 1 !\`>)
(<RETURN>)>>
<PRINC .STR .CH>)
(<PRINTSTRING .STR .CH .CT>)>
<COND (.DEATH?
<CRLF .CH>
<PRINC "Winner:" .CH>
<PRINT ,WINNER .CH>
<CRLF .CH>
<PRINC "Trophy case:" .CH>
<PRINT <SFIND-OBJ "TCASE"> .CH>
<CRLF .CH>
<PRINC "Robber:" .CH>
<PRINT ,ROBBER-DEMON .CH>
<CRLF .CH>
<PRINC "Clocker:" .CH>
<PRINT ,CLOCKER .CH>
<COND (<AND .DEATH?
<ASSIGNED? ZORK>>
<CRLF .CH>
<PRINC "Error:" .CH>
<MAPF <>
<FUNCTION (X)
#DECL ((X) ANY)
<PRINT .X .CH>>
.ZORK>
<CRLF .CH>
<PRINC "LEXV:" .CH>
<CRLF .CH>
<PRINC ,LEXV .CH>
<CRLF .CH>
<PRINC "PRSVEC:" .CH>
<PRINT ,PRSVEC .CH>
<CRLF .CH>
<PRINC "ORPHANS:" .CH>
<CRLF .CH>
<PRINC ,ORPHANS .CH>)>
<COND (<AND <GASSIGNED? RESTORE-HAPPENED>
,RESTORE-HAPPENED>
<CRLF .CH>
<PRINC "Restore happened." .CH>)>)>