Skip to content
Permalink
Browse files
Zork source code from 1979.
  • Loading branch information
larsbrinkhoff authored and eswenson1 committed Apr 10, 2018
1 parent c67abad commit 1b555896ebae8fa122210322e0b01490a9bc02a4
Showing 23 changed files with 21,118 additions and 0 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -0,0 +1,145 @@
MARC MARC
CONN <ZORK>
<MDL>MDL104
<RESTORE "<MDL>M104UNI">
<SNAME "ZORK">
<FLOAD "LITLPK.GBIN">
<USE "CLEAN" "PURITY">
<SETG NULL!- <INSERT <STRING <ASCII 127>> <ROOT>>>
%%<BLOCK (<MOBLIST FROBOZZ> <GET INITIAL OBLIST> <ROOT>)>
<DEFINE GL (FILE "AUX" VAL (CH <OPEN "READ" .FILE>) L)
<SET L
<MAPF ,LIST
<FUNCTION ()
<SET VAL <READ .CH '<MAPSTOP>>>
<EVAL .VAL>
.VAL>>>
<SET <SET VAL <PARSE <7 .CH>>> .L>
.VAL>
<DEFINE FLUSHG (ATM "AUX" (G ..ATM))
<MAPF <>
<FUNCTION (X)
<COND (<AND <TYPE? .X FORM>
<G? <LENGTH .X> 2>
<MEMQ <1 .X> '![SETG DEFMAC DEFINE]>>
<AND <MANIFEST? <2 .X>>
<UNMANIFEST <2 .X>>>
<GUNASSIGN <2 .X>>)>>
.G>
<UNASSIGN <REMOVE .ATM>>>
%%<ENDBLOCK>
<GL!-FROBOZZ "PRIM.NBIN">
<GL!-FROBOZZ "MAKSTR.NBIN">
<FLOAD "ZORK.XGBIN">
<FLUSHG!-FROBOZZ PRIM>
<FLUSHG!-FROBOZZ MAKSTR>
<FLOAD "TYPHAK.NBIN">
<MAPF <> <FUNCTION (X)
<MAPF <> <FUNCTION (X)
<COND (<GBOUND? .X> <PUT-DECL <GLOC .X> ANY>)>>
.X>>
<GET INITIAL OBLIST>>
<CLEANUP>
<PRINT-CLEANUP>
%%<SET X ,PURELST>
<GROUP-PURIFY X>
<GL!-FROBOZZ "PRIM.NBIN">
<GL!-FROBOZZ "MAKSTR.NBIN">
<FLOAD "DUNG">
<SETG END-GAME-EXISTS? T>
%%<BLOCK (<GET FROBOZZ OBLIST> <GET INITIAL OBLIST> <ROOT>)>
<DEFINE ROOM-FROB (RM L "AUX" TL)
<COND (<SET TL <MEMBER <RDESC1 .RM> .L>>
<PUT .RM ,RDESC1 <1 .TL>>)
(<SET L (<RDESC1 .RM> !.L)>)>
<COND (<SET TL <MEMBER <RDESC2 .RM> .L>>
<PUT .RM ,RDESC2 <1 .TL>>)
(<SET L (<RDESC2 .RM> !.L)>)>
<MAPR <>
<FUNCTION (Y "AUX" (X <1 .Y>))
<COND (<AND <TYPE? .X CEXIT> <CXSTR .X>>
<COND (<SET TL <MEMBER <CXSTR .X> .L>>
<PUT .X ,CXSTR <1 .TL>>)
(<SET L (<CXSTR .X> !.L)>)>)
(<AND <TYPE? .X DOOR> <DSTR .X>>
<COND (<SET TL <MEMBER <DSTR .X> .L>>
<PUT .X ,DSTR <1 .TL>>)
(<SET L (<DSTR .X> !.L)>)>)
(<TYPE? .X NEXIT>
<COND (<SET TL <MEMBER .X .L>>
<PUT .Y 1 <1 .TL>>)
(<SET L (.X !.L)>)>)>>
<REXITS .RM>>
.L>
<DEFINE OBJECT-FROB (OBJ L "AUX" TL TEMP)
<COND (<SET TL <MEMBER <ODESC1 .OBJ> .L>>
<OPUT .OBJ ODESC1 <1 .TL>>)
(<SET L (<ODESC1 .OBJ> !.L)>)>
<COND (<SET TL <MEMBER <ODESC2 .OBJ> .L>>
<PUT .OBJ ,ODESC2 <1 .TL>>)
(<SET L (<ODESC2 .OBJ> !.L)>)>
<COND (<SET TL <MEMBER <ODESCO .OBJ> .L>>
<OPUT .OBJ ODESCO <1 .TL>>)
(<SET L (<ODESCO .OBJ> !.L)>)>
<COND (<SET TEMP <OREAD .OBJ>>
<SET L (.TEMP !.L)>)>
<COND (<SET TEMP <OFMSGS .OBJ>>
<SET L (.TEMP !.L)>)>
.L>
%%<ENDBLOCK>
<GL!-FROBOZZ "DISP1.GBIN">
<DISPATCH-HACK>
<FLUSHG!-FROBOZZ PRIM>
<FLUSHG!-FROBOZZ MAKSTR>
<FLUSHG!-FROBOZZ DISP1>
<SET Y ()>
<SETG FF "; \\\"Dungeon\\\"">
%%<MAPF <>
<FUNCTION (X)
<SET Y <ROOM-FROB!-FROBOZZ .X .Y>>>
,ROOMS>
%%<MAPF <>
<FUNCTION (X)
<SET Y <OBJECT-FROB!-FROBOZZ .X .Y>>>
,OBJECTS>
%%<PUT <PUT FROBOZZ OBLIST> OBLIST>
%%<MAPR <>
<FUNCTION (X)
<PUT .X 1 ,<1 .X>>>
,PURE-LIST>
%%<PUTREST <REST ,PURE-LIST <- <LENGTH ,PURE-LIST> 1>> .Y>
%%<SET Y <IVECTOR <LENGTH ,PURE-LIST>>>
%%<MAPR <>
<FUNCTION (X Y)
<PUT .X 1 <1 .Y>>>
.Y ,PURE-LIST>
%%<SETG PURE-LIST .Y>
<UNASSIGN <REMOVE Y>>
<LENGTH ,PURE-LIST>
%%<PURIFY ,PURE-LIST ,DISPATCH-TABLE>
<KILL:PURITY>
<FLUSH-CLEANUP>
<UNASSIGN X>
<REMOVE <GUNASSIGN PURE-LIST>>
<REMOVE <UNASSIGN FOO>>
<DEFINE F (BAR) <GUNASSIGN <REMOVE .BAR>>>
<F DROP>
<F L-UNUSE>
<F USE>
<F ENTRY>
<F PACKAGE>
<F ENDPACKAGE>
<F FIND/LOAD>
<F F>
<HANDLER <GET ERROR!-INTERRUPTS INTERRUPT> ,ERRH>
<SETG MUD-HAND <OFF <3 <GET ,INCHAN INTERRUPT>>>>
<SETG ZORK-HAND <OFF <HANDLER <GET ,INCHAN INTERRUPT> ,CTRL-S>>>
<GC 0 T>
<SETG DBG <>>
<GC-MON T>
<BLOAT 0 0 0 0 0 300>
<SAVE-IT "<TAA>MADADV.SAVE" <>>
<QUIT>
DEL ZORK.XGBIN
EXP

0 comments on commit 1b55589

Please sign in to comment.