-
Notifications
You must be signed in to change notification settings - Fork 3
/
rooms.165
1779 lines (1629 loc) · 54.8 KB
/
rooms.165
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
"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>"MADMAN;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>)
<PUT <FIND-OBJ "PAPER"> ,ODESC1 <UNSPEAKABLE-CODE>>
<SETG VERS .ST>
<SETG SCRIPT-CHANNEL <>>
<SETG DBG <>>
<SETG RAW-SCORE 0>
<SETG PTEMP <CHTYPE [<CHTYPE WITH!-WORDS PREP> <FIND-OBJ "!!!!!">] PHRASE>>
<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 "MADMAN">)>
<INT-LEVEL 100000>
<SETG DEATHS 0>
<SETG MOVES 0>
<SETG WINNER ,PLAYER>
<COND (<AND <=? <SAVE .FN> "SAVED">
<NOT .START?>>
<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>>
<INT-LEVEL 0>
<COND (<AND <TYPE? <SET STV <STARTER>> FIX>
<G? .STV 3>>
<OR <MEMBER <SETG XUNM <XUNAME>> ,WINNERS>
<=? ,XUNM "SEC">
<=? ,XUNM "ELBOW">
<AND <OFF "CHAR" ,INCHAN>
<TELL
"There appears before you a threatening figure clad all over
in heavy black armor. His legs seem like the massive trunk
of the oak tree. His broad shoulders and helmeted head loom
high over your own puny frame and you realize that his powerful
arms could easily crush the very life from your body. There
hangs from his belt a veritable arsenal of deadly weapons:
sword, mace, ball and chain, dagger, lance, and trident.
He speaks with a commanding voice:
\"YOU SHALL NOT PASS \"
As he grabs you by the neck all grows dim about you.">
<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>>
<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 REASON)
<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)
<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 <FIELD .UNAME ,$NAME>) CMA JR LFST LLST
TLEN TSTR STR)
#DECL ((STR TSTR UNAME) STRING (NM CMA JR) <OR STRING FALSE>
(TLEN LLST LFST) FIX)
<COND (.NM
<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>)>)>>
<DEFINE UNSPEAKABLE-CODE ("AUX" STR NSTR (LEN-I 0) (O <FIND-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) <PRIMTYPE WORD>)
<STRING
"This version created "
<NTH ,MONTHS <CHTYPE <GETBITS .N <BITS 4 23>> FIX>>
!\
<UNPARSE <CHTYPE <GETBITS .N <BITS 5 18>> FIX>>
!\.>>
<DEFINE VERSION ()
<TELL ,VERS>>
<SETG PLAYED-TIME 0>
<GDECL (PLAYED-TIME) FIX>
<DEFINE GET-TIME ("AUX" (NOW <DSKDATE>) (THEN ,INTIME))
#DECL ((NOW 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 DUNGEON 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) FRAME (ZORK) <SPECIAL TUPLE> (CH) <OR CHANNEL FALSE>)
<PUT ,OUTCHAN 13 80>
<COND (<AND <OR <NOT <GASSIGNED? XUNM>>
<MEMBER ,XUNM ,WINNERS>>
T>
<PUT <1 <BACK ,INCHAN>> 6 #LOSE 27>
<AND <GASSIGNED? SAVEREP> <SETG REP ,SAVEREP>>
<AND <ASSIGNED? BH> <OFF .BH>>
<INT-LEVEL 0>
<SETG DBG T>
<SETG ALT-FLAG T>)
(,ERRFLG
<QUIT>)
(T
<COND (<AND <NOT <EMPTY? .ZORK>>
<==? <1 .ZORK> CONTROL-G?!-ERRORS>>
<INT-LEVEL 0>
<FINISH>
<PUT <1 <BACK ,INCHAN>> 6 <COND (<G? ,MUDDLE 100>
<COND (,TENEX? #LOSE *37*)
(T #LOSE *000000000012*)>)
(T #LOSE *000000000015*)>>
<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"
<PUT <1 <BACK ,INCHAN>> 6 #LOSE *000000000015*>
<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 DUNGEON@MIT-DMS describing what it was you tried to do.">
<TELL ,VERS>
<MAPF <> <FUNCTION (X) <PRINT .X>> .ZORK>)>
<FINISH #FALSE (". Error.")>>
<FINISH #FALSE (". Error.")>>)>)>>
<PSETG WINNERS '["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>>>
<SETG ERRH
<HANDLER <OR <GET ERROR!-INTERRUPTS INTERRUPT> <EVENT "ERROR" 8>>
,HANDLE>>>
<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 (.FN
<SETG USER-NAME .FN>)
(<SETG USER-NAME .XUNM>)>
<PUT ,WINNER ,AROOM <SETG HERE <FIND-ROOM .RM>>>
<TELL "Welcome to Dungeon.
" 1 .ST>
<CONTIN>>
<DEFINE CONTIN ()
<SETG ALT-FLAG <>>
<PUT <1 <BACK ,INCHAN>> 6 <COND (<G? ,MUDDLE 100>
<COND (,TENEX? #LOSE *37*)
(T #LOSE *000000000012*)>)
(T #LOSE *000000000015*)>>
<SETG SAVEREP ,REP>
<SETG REP ,RDCOM>
<RESET ,INCHAN>
<SETG WINNER ,PLAYER>
<PUT ,PRSVEC 2 <>>
,NULL>
<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
"Suddenly, a sinister, wraithlike figure appears before you, seeming
to float in the air. He glows with an eldritch light. In a barely
audible voice he says, \"Begone, defiler! Your presence upsets the
very balance of the System itself!\" With a sinister chuckle, he
raises his oaken staff, taps you on the head, and fades into the
gloom. In his place appears a tastefully lettered sign reading:
DUNGEON CLOSED
At that instant, you disappear, and all your belongings clatter to
the ground.
">
<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 <NOT <MEMBER "GUEST" .UNM>>
<SET CH <OPEN "READ" ".FILE." "(DIR)" "DSK" .UNM>>
<CLOSE .CH>
<SET CH <OPEN "READ" "_MSGS_" .UNM "DSK" .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 " 1 ,XUNM ";ZORK SCRIPT">)
(T
<TELL "Scripting to <" 1 ,XUNM ">ZORK.SCRIPT">)>)
(T
<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 ("AUX" (MUDDLE ,MUDDLE) CH (UNM ,XUNM))
#DECL ((CH) <OR CHANNEL FALSE> (MUDDLE) FIX (UNM) STRING)
<COND (<OR <G? .MUDDLE 100>
<AND <NOT <MEMBER "GUEST" .UNM>>
<SET CH <OPEN "READ" ".FILE." "(DIR)" "DSK" .UNM>>
<CLOSE .CH>>>
<COND (<OR <G? .MUDDLE 100>
<AND <SET CH <OPEN "READ" "_MSGS_" .UNM "DSK" .UNM>>
<CLOSE .CH>>>
<AND ,SCRIPT-CHANNEL <DO-UNSCRIPT>>
<TELL "Saving.">
<INT-LEVEL 100000>
<OFF "CHAR" ,INCHAN>
<SETG THEN <CHTYPE <DSKDATE> FIX>>
<SETG PLAYED-TIME <GET-TIME>>
<COND (<SET CH <OPEN "PRINTB"
<COND (<L? .MUDDLE 100>
<STRING "DSK:" .UNM ";ZORK SAVE">)
(T
<STRING "DSK:<" .UNM ">ZORK.SAVE">)>>>
<SAVE-GAME .CH>
<FINISH <CHTYPE '(". Saved.") FALSE>>)
(<TELL "Save failed.">
<TELL <1 .CH> 1 " " <2 .CH>>)>)
(<TELL "Can't open channel for save.">)>)
(T <TELL "Can't open channel for save.">)>>
<DEFINE DO-RESTORE ("AUX" CH STR (MUDDLE ,MUDDLE) NOWD NOW THEND)
#DECL ((CH) <OR CHANNEL FALSE> (STR) STRING (NOWD NOW THEND MUDDLE) FIX)
<COND (<L? .MUDDLE 100>
<SET STR <STRING "DSK:" ,XUNM ";ZORK SAVE">>)
(T
<SET STR <STRING "DSK:<" ,XUNM ">ZORK.SAVE">>)>
<PROG ((FOO T) (SNM <SNAME>))
#DECL ((FOO) <OR ATOM FALSE> (SNM) <SPECIAL STRING>)
<COND (<SET CH <OPEN "READB" .STR>>
<COND (<RESTORE-GAME .CH>
<COND (<MEMBER ,XUNM ,WINNERS>
<SET NOW <CHTYPE <DSKDATE> FIX>>)
(<==? <SET NOWD
<CHTYPE <GETBITS <SET NOW
<CHTYPE <DSKDATE> FIX>>
<BITS 18 18>>
FIX>>
<SET THEND
<CHTYPE <GETBITS ,THEN <BITS 18 18>> FIX>>>
<COND (<G=? <- .NOW ,THEN> 2400>)
(<TELL "It's too soon.">
<COND (<G? ,MUDDLE 100>
<OFF "CHAR" ,INCHAN>
<INT-LEVEL 10000>
<QUIT>)>
<QUIT>)>)
(<1? <- .NOWD .THEND>>
<COND (<G=? <- <+ <CHTYPE <GETBITS .NOW <BITS 18 0>> FIX>
<* 24 7200>>
<CHTYPE <GETBITS .NOW <BITS 18 0>> FIX>>
2400>)
(<TELL "It's too soon.">
<QUIT>)>)>
<SETG INTIME .NOW>
<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> 1 " " <1 .CH>>)>>>
<DEFINE PROB (NUM) #DECL ((NUM) FIX) <L=? <MOD <RANDOM> 100> .NUM>>
"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)
<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 <>>
<GDECL (SUPER-BRIEF!-FLAG BRIEF!-FLAG) <OR ATOM FALSE>>
<DEFINE BRIEF ()
<SETG BRIEF!-FLAG T>
<TELL "Brief descriptions.">>
<DEFINE SUPER-BRIEF ()
<SETG SUPER-BRIEF!-FLAG T>
<TELL "No long descriptions.">>
<DEFINE UN-BRIEF ()
<SETG BRIEF!-FLAG <>>
<SETG SUPER-BRIEF!-FLAG <>>
<TELL "Long descriptions.">>
<DEFINE UN-SUPER-BRIEF ()
<SETG SUPER-BRIEF!-FLAG <>>
<TELL "Some long descriptions.">>
<DEFINE ROOM-DESC () <ROOM-INFO T>>
<DEFINE ROOM-INFO ("OPTIONAL" (FULL <>)
"AUX" (AV <AVEHICLE ,WINNER>) (RM ,HERE) (PRSO <2 ,PRSVEC>)
(WINOBJ <FIND-OBJ "#####">) (OUTCHAN ,OUTCHAN) RA)
#DECL ((RM) ROOM (WINOBJ) OBJECT (AV) <OR FALSE OBJECT> (OUTCHAN) CHANNEL
(PRSO) <OR DIRECTION FALSE OBJECT> (FULL) <OR ATOM FALSE>)
<SETG TELL-FLAG T>
<COND (<TYPE? .PRSO DIRECTION>
<SET PRSO <>>
<PUT ,PRSVEC 2 <>>)>
<PROG ()
<COND (<N==? ,HERE <AROOM ,PLAYER>>
<PUT ,PRSVEC 1 ,WALK-IN!-WORDS>
<TELL "Done.">
<RETURN>)
(.PRSO
<COND (<OBJECT-ACTION>)
(<OREAD .PRSO>
<TELL <OREAD .PRSO>>)
(<TELL "I see nothing special about the "
1
<ODESC2 .PRSO>
".">)>
<RETURN>)
(<NOT <LIT? .RM>>
<TELL
"It is pitch black. You are likely to be eaten by a grue.">
<RETURN <>>)
(<OR <AND <NOT .FULL> ,SUPER-BRIEF!-FLAG>
<AND <RSEEN? .RM>
<OR ,BRIEF!-FLAG <PROB 80>>
<NOT .FULL>>>
<TELL <RDESC2 .RM>>)
(<AND <EMPTY? <RDESC1 .RM>> <SET RA <RACTION .RM>>>
<PUT ,PRSVEC 1 ,LOOK!-WORDS>
<APPLY-RANDOM .RA>
<PUT ,PRSVEC 1 ,FOO!-WORDS>)
(<TELL <RDESC1 .RM>>)>
<RTRO .RM ,RSEENBIT>
<AND .AV <TELL "You are in the " 1 <ODESC2 .AV> ".">>
<MAPF <>
<FUNCTION (X)
#DECL ((X) OBJECT)
<COND
(<AND <OVIS? .X> <DESCRIBABLE? .X>>
<COND (<==? .X .AV>)
(T
<COND (<LONG-DESC-OBJ .X>
<AND .AV <TELL " [in the room]" 0>>
<CRLF>)>)>
<COND (<TRNN .X ,ACTORBIT>
<INVENT <ORAND .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>>
<PUT ,PRSVEC 1 ,WALK-IN!-WORDS>
<APPLY-RANDOM .RA>
<PUT ,PRSVEC 1 ,FOO!-WORDS>)>
T>>
<PSETG INDENTSTR <REST <ISTRING 8> 8>>
<DEFINE PRINT-CONT PRINT-C (OBJ AV WINOBJ INDENT "OPTIONAL" (CASE? T)
"AUX" (CONT <OCONTENTS .OBJ>))
#DECL ((AV) <OR FALSE OBJECT> (OBJ WINOBJ) OBJECT (INDENT) STRING
(CONT) <LIST [REST OBJECT]> (CASE?) <OR ATOM FALSE>)
<COND (<NOT <EMPTY? .CONT>>
<COND (<==? .OBJ <FIND-OBJ "TCASE">>
<COND (<NOT .CASE?> <RETURN T .PRINT-C>)>
<TELL "Your collection of treasures consists of:">)
(<NOT <AND <==? <LENGTH .CONT> 1>
<==? <1 .CONT> <FIND-OBJ "#####">>>>
<TELL .INDENT 0>
<TELL "The " 1 <ODESC2 .OBJ> " contains:">)
(<RETURN T .PRINT-C>)>
<MAPF <>
<FUNCTION (Y)
#DECL ((Y) OBJECT)
<COND (<AND .AV <==? .Y .WINOBJ>>)
(<AND <OVIS? .Y> <DESCRIBABLE? .Y> <NOT <EMPTY? <ODESC2 .Y>>>>
<TELL .INDENT 1 " A " <ODESC2 .Y>>)>
<COND (<SEE-INSIDE? .Y>
<PRINT-CONT .Y .AV .WINOBJ <BACK .INDENT>>)>>
<OCONTENTS .OBJ>>)>>
"GIVE LONG DESCRIPTION OF OBJECT"
<DEFINE LONG-DESC-OBJ (OBJ "AUX" STR)
#DECL ((OBJ) OBJECT)
<COND (<OR <OTOUCH? .OBJ> <NOT <ODESCO .OBJ>>>
<SET STR <ODESC1 .OBJ>>)
(<SET STR <ODESCO .OBJ>>)>
<COND (<EMPTY? .STR> <>)
(<TELL .STR 0>)>>
"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]>>>
<SETG PARSE-CONT <>>
<PSETG READER-STRING <STRING <ASCII 27> <ASCII 13> <ASCII 10>>>
<DEFINE RDCOM ("OPTIONAL" (IVEC <>)
"AUX" (STR ,READER-STRING) VC RVEC RM (INPLEN 1) (INBUF ,INBUF)
(WINNER ,WINNER) AV (OUTCHAN ,OUTCHAN) RANDOM-ACTION PC)
#DECL ((RVEC PC) <OR FALSE VECTOR> (RM) ROOM (INPLEN) FIX (INBUF) STRING
(WINNER) ADV (AV) <OR FALSE OBJECT> (OUTCHAN) CHANNEL
(IVEC) <OR FALSE VECTOR> (VC) VECTOR)
<OR .IVEC <PROG ()
<PUT .OUTCHAN 13 1000>
<ROOM-INFO T>>>
<REPEAT (VVAL CV)
#DECL ((CV) <OR FALSE VERB>)
<SET VVAL T>
<SET PC <>>
<COND (<SET PC ,PARSE-CONT>)
(<NOT .IVEC>
<SET RM ,HERE>
<PRINC ">">
<SETG TELL-FLAG <>>
<SET INPLEN <READSTRING .INBUF ,INCHAN .STR>>
<READCHR ,INCHAN>
<OR ,ALT-FLAG <READCHR ,INCHAN>>
<SET VC <LEX .INBUF <REST .INBUF .INPLEN> T>>)>
<COND (<G? .INPLEN 0>
<SETG MOVES <+ ,MOVES 1>>
<COND (<SETG PARSE-WON
<AND <EPARSE <OR .IVEC .PC .VC> <>>
<TYPE? <SET CV <1 <SET RVEC ,PRSVEC>>> VERB>>>
<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>>>>
<COND (<AND .VVAL <SET RANDOM-ACTION <VFCN .CV>>
<APPLY-RANDOM .RANDOM-ACTION>>
<COND (<AND <SET RANDOM-ACTION <RACTION <SET RM ,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 <>> <TELL "Beg pardon?">)>
<MAPF <>
<FUNCTION (X)
#DECL ((X) HACK)
<COND (<SET RANDOM-ACTION <HACTION .X>>
<APPLY-RANDOM .RANDOM-ACTION .X>)>>
,DEMONS>
<AND ,PARSE-WON
<SET AV <AVEHICLE .WINNER>>
<SET RANDOM-ACTION <OACTION .AV>>
<APPLY-RANDOM .RANDOM-ACTION READ-OUT>>
<AND .IVEC <RETURN>>>>
<DEFINE SCORE-OBJ (OBJ "AUX" TEMP) #DECL ((OBJ) OBJECT)
<COND (<G? <SET TEMP <OFVAL .OBJ>> 0>
<SCORE-UPD .TEMP>
<PUT .OBJ ,OFVAL 0>)>>
<DEFINE SCORE-ROOM (RM "AUX" TEMP) #DECL ((RM) ROOM)
<COND (<G? <SET TEMP <RVAL .RM>> 0>
<SCORE-UPD .TEMP>
<PUT .RM ,RVAL 0>)>>
<DEFINE SCORE-UPD (NUM "AUX" (WINNER ,WINNER) (MS ,SCORE-MAX))
#DECL ((NUM) FIX)
<PUT .WINNER ,ASCORE <+ <ASCORE .WINNER> .NUM>>
<COND (<OR <G=? <SET NUM <SETG RAW-SCORE <+ ,RAW-SCORE .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
"Suddenly a sinister wraithlike figure, cloaked and hooded, appears
seeming to float in the air before you. In a low, almost inaudible
voice he says, \"I welcome you to the ranks of the chosen of Zork. You
have persisted through many trials and tests, and have overcome them
all. One such as yourself is fit to join the even the Implementers!\"
He then raises his oaken staff, and chuckling, drifts away like a
wisp of smoke, his laughter fading in the distance.">
<OR <AND <GASSIGNED? END-GAME-EXISTS?> ,END-GAME-EXISTS?>
<TELL "
Unfortunately, as the wraith fades, in his place appears a tastefully
lettered sign reading:
\"Soon to be Constructed on this Site
A Complete Modern Dungeon Endgame
Designed and Built by the
Frobozz Magic Dungeon Company\"
">>>
<DEFINE SCORE ("OPTIONAL" (ASK? T) "AUX" SCOR (OUTCHAN .OUTCHAN) PCT)
#DECL ((ASK?) <OR ATOM FALSE> (SCOR) FIX (OUTCHAN) CHANNEL (PCT) FLOAT)
<SETG TELL-FLAG T>
<CRLF>
<COND (.ASK? <PRINC
"Your score would be ">)
(<PRINC "Your score is ">)>
<PRIN1 <SET SCOR
<ASCORE ,WINNER>>>
<PRINC " [total of ">
<PRIN1 ,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 ,SCORE-MAX>>>
<PRINC <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")
("Beginner")>>
<PRINC ".">
<CRLF>
.SCOR>
<DEFINE FINISH ("OPTIONAL" (ASK? T) "AUX" SCOR)
#DECL ((ASK?) <OR ATOM FALSE> (SCOR) FIX)
<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>)>>
<QUIT>>>
"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>>
<GDECL (RECORD-STRING) STRING>
<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 <>) (INCHAN ,INCHAN))
#DECL ((STR) STRING (CH) <OR FALSE <CHANNEL FIX>> (FEECH?) <OR CHANNEL ATOM FALSE>
(INCHAN) CHANNEL (CT) FIX (DEATH?) <OR ATOM FALSE>)
<COND (<GASSIGNED? BUGSTR>
<SET STR ,BUGSTR>)
(<SET STR <ISTRING 3000>>)>
<RESET .INCHAN>
<UNWIND
<PROG BUGGER ()
<COND (.DEATH?
<SET CH .FEECH?>
<SET FEECH? <>>)
(T <TELL "Hold on...">)>
<COND (<AND <NOT .CH> <NOT <SET CH <RECOPEN "BUG">>>>
<TELL "Bug report not possible?">)
(<CLOSE .CH>
<PUT <1 <BACK .INCHAN>> 6 #LOSE 27>
<TELL <COND (.FEECH? "Feature") ("Bug")>
1
" (terminate with altmode): ">
<SET CT <READSTRING .STR .INCHAN %<STRING <ASCII 27>>>>
<READCHR .INCHAN>
<PUT <1 <BACK .INCHAN>> 6 <COND (<G? ,MUDDLE 100>
<COND (,TENEX? #LOSE *37*)
(T #LOSE *000000000012*)>)
(T #LOSE *000000000015*)>>
<COND (<==? .CT <LENGTH .STR>>
<TELL "Bug too long?">)>
<COND (<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>
<COND (<NOT .FEECH?>
<CRLF .CH>
<PRINC "Winner:" .CH>
<PRINT ,WINNER .CH>
<CRLF .CH>
<PRINC "Trophy case:" .CH>
<PRINT <FIND-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) <PRINT .X .CH>> .ZORK>)>)>
<PRINC "
Text:
" .CH>
<PRINTSTRING .STR .CH .CT>
<CRLF .CH>
<CLOSE .CH>
<COND (.FEECH? <TELL "Feature recorded. Feel free.">)
(<TELL "Bug recorded. Thank you.">)>)>>
<PROG ()
<AND .CH <NOT <0? <1 .CH>>> <CLOSE .CH>>
<PUT <1 <BACK .INCHAN>> 6 <COND (<G? ,MUDDLE 100>
<COND (,TENEX? #LOSE *37*)
(T #LOSE *000000000012*)>)
(T #LOSE *000000000015*)>>>>>
<DEFINE RECOPEN (NAM "AUX" CH (CT 0) FL (STR ,RECORD-STRING)
(DEV <VALUE DEV>) (SNM <VALUE SNM>) (MUDDLE ,MUDDLE))
#DECL ((CH) <OR FALSE <CHANNEL FIX>> (MUDDLE FL CT) FIX (NAM STR DEV SNM) STRING)
<PROG ()
<COND (<SET CH <OPEN "READB" "ZORK" .NAM .DEV .SNM>>
<COND (<G=? <SET FL <FILE-LENGTH .CH>> 1>
<ACCESS .CH <- .FL 1>>
<SET CT <READSTRING .STR .CH ,RECORDER-STRING>>)>
<CLOSE .CH>
<COND (<SET CH <OPEN "PRINTO" "ZORK" .NAM .DEV .SNM>>)
(<AND <G? .MUDDLE 100> <==? <3 .CH> *600123*>>
; "Can't win--no write access"
<RETURN .CH>)
(T <SLEEP 1> <AGAIN>)>
<ACCESS .CH <MAX 0 <- .FL 1>>>
<PRINTSTRING .STR .CH .CT>
.CH)
(<OR <AND <L? .MUDDLE 100> <N==? <3 .CH> *4000000*>>
<AND <G? .MUDDLE 100> <==? <3 .CH> *600130*>>>
;"on 10x, must get FILE BUSY to try again"
<SLEEP 1>
<AGAIN>)
(<SET CH <OPEN "PRINT" "ZORK" .NAM .DEV .SNM>>)
(<AND <G? .MUDDLE 100> <==? <3 .CH> *600117*>>
; "No write access"
.CH)
(.CH)>>>
<DEFINE RECORD (SCORE MOVES DEATHS QUIT? LOC "AUX" (CH <>))
#DECL ((SCORE MOVES DEATHS) FIX (QUIT?) <OR ATOM FALSE> (LOC) ROOM
(CH) <OR <CHANNEL FIX> FALSE>)
<UNWIND
<PROG RECORD ()
<AND <NOT <SET CH <RECOPEN "LOG">>> <RETURN T .RECORD>>
<RECOUT .CH .SCORE .MOVES .DEATHS .QUIT? .LOC>
<CRLF .CH>
<CLOSE .CH>>
<AND <TYPE? .CH CHANNEL> <NOT <0? <1 .CH>>> <CLOSE .CH>>>>
<DEFINE RECOUT (CH SCORE MOVES DEATHS QUIT? LOC "AUX" (OUTCHAN .CH))
#DECL ((CH) CHANNEL (SCORE MOVES DEATHS) FIX (QUIT?) <OR ATOM FALSE>
(LOC) ROOM (OUTCHAN) <SPECIAL CHANNEL>)
<CRLF .CH>
<PRINC " " .CH>
<PRINC ,USER-NAME .CH>
<COND (<N=? ,USER-NAME ,XUNM>
<PRINC " (" .CH>
<PRINC ,XUNM .CH>
<PRINC !\) .CH>)>
<PRINC " " .CH>
<PDSKDATE <DSKDATE> .CH>
<CRLF .CH>
<PLAY-TIME <>>
<CRLF .CH>
<PRIN1 .SCORE .CH>
<PRINC " points, " .CH>
<PRIN1 .MOVES .CH>
<PRINC " move" .CH>
<COND (<1? .MOVES> <PRINC ", " .CH>)
(T <PRINC "s, " .CH>)>
<PRIN1 .DEATHS .CH>
<PRINC " death" .CH>
<COND (<1? .DEATHS> <PRINC ". " .CH>)
(T <PRINC "s. " .CH>)>
<PRINC " In " .CH>
<PRINC <RDESC2 .LOC> .CH>
<COND (.QUIT? <PRINC ". Quit." .CH>)
(<EMPTY? .QUIT?> <PRINC ". Died." .CH>)
(<PRINC <1 .QUIT?> .CH>)>
<CRLF .CH>
<MAPF <>
<FUNCTION (X Y)
#DECL ((X) ATOM (Y) STRING)
<COND (,.X <PRINC "/" .CH> <PRINC .Y .CH>)>>
,FLAG-NAMES
,SHORT-NAMES>
<MAPF <>
<FUNCTION (X Y)
#DECL ((X) ATOM (Y) STRING)
<COND (<0? ,.X> <PRINC "/" .CH> <PRINC .Y .CH>)>>
,VAL-NAMES
,SHORT-VAL-NAMES>>
FLAG-NAMES
<GDECL (FLAG-NAMES VAL-NAMES)
<UVECTOR [REST ATOM]>
(SHORT-NAMES SHORT-VAL-NAMES)
<VECTOR [REST STRING]>>
<BLOCK (<OR <GET FLAG OBLIST> <MOBLIST FLAG>> <GET INITIAL OBLIST> <ROOT>)>
<PSETG FLAG-NAMES
<UVECTOR TROLL-FLAG
LOW-TIDE
DOME-FLAG
GLACIER-FLAG
ECHO-FLAG
RIDDLE-FLAG
LLD-FLAG
CYCLOPS-FLAG
MAGIC-FLAG
RAINBOW
GNOME-DOOR
CAROUSEL-FLIP
CAGE-SOLVE>>
<ENDBLOCK>
<PSETG SHORT-NAMES
<VECTOR "TR" "LO" "DO" "GL" "EC"
"RI" "LL" "CY" "MA" "RA" "GN" "CA" "CG">>
<PSETG VAL-NAMES <UVECTOR LIGHT-SHAFT>>
<PSETG SHORT-VAL-NAMES <VECTOR "LI">>
<DEFINE PDSKDATE (WD CH
"AUX" (TIM <CHTYPE <GETBITS .WD <BITS 18 0>> FIX>) (A/P " AM")
HR)
#DECL ((WD) <PRIMTYPE WORD> (TIM HR) FIX (A/P) STRING (CH) CHANNEL)
<PRINC " " .CH>
<COND (<0? <CHTYPE .WD FIX>> <PRINC "unknown " .CH>)
(T
<PRINC <NTH ,MONTHS <CHTYPE <GETBITS .WD <BITS 4 23>> FIX>> .CH>
<PRINC " " .CH>
<PRIN1 <CHTYPE <GETBITS .WD <BITS 5 18>> FIX> .CH>
<PRINC " at " .CH>
<SET HR </ .TIM 7200>>
<COND (<G=? .HR 12> <SET HR <- .HR 12>> <SET A/P " PM">)>
<COND (<0? .HR> <SET HR 12>)>
<PRIN1 .HR .CH>
<PRINC ":" .CH>
<SET HR </ <MOD .TIM 7200> 120>>
<COND (<L? .HR 10> <PRINC "0" .CH>)>
<PRIN1 .HR .CH>
<PRINC .A/P .CH>)>>
<PSETG MONTHS
["January"
"February"
"March"
"April"
"May"
"June"
"July"
"August"
"September"
"October"
"November"
"December"]>
<GDECL (MONTHS) <VECTOR [12 STRING]>>
<DEFINE JIGS-UP (DESC
"AUX" (WINNER ,WINNER) (DEATHS ,DEATHS) (AOBJS <AOBJS .WINNER>)
(RANDOM-LIST ,RANDOM-LIST) (LAMP <FIND-OBJ "LAMP">)
LAMP-LOCATION (VAL-LIST ()) LC C)
#DECL ((DESC) STRING (DEATHS) FIX (AOBJS) <LIST [REST OBJECT]>
(VAL-LIST) <LIST [REST OBJECT]> (LAMP-LOCATION) <OR FALSE ROOM>