From 54c1bdb84b3e0670793548982b151c94eee92bde Mon Sep 17 00:00:00 2001 From: Eric Swenson Date: Mon, 21 Oct 2024 18:19:24 +0200 Subject: [PATCH 1/2] Added OPS4. --- Makefile | 2 +- build/build.tcl | 1 + build/haunt.tcl | 17 + build/timestamps.txt | 3 + doc/programs.md | 1 + src/haunt/ops4.load | 21 + src/haunt/ops4.lsp | 2247 ++++++++++++++++++++++++++++++++++++++++++ src/haunt/user.lsp | 101 ++ 8 files changed, 2392 insertions(+), 1 deletion(-) create mode 100644 build/haunt.tcl create mode 100644 src/haunt/ops4.load create mode 100644 src/haunt/ops4.lsp create mode 100644 src/haunt/user.lsp diff --git a/Makefile b/Makefile index eca6056a9..ab10b999f 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ SRC = syseng sysen1 sysen2 sysen3 sysnet kshack dragon channa \ decus bsg muds54 hello rrs 2500 minsky danny survey librm3 librm4 \ klotz atlogo clusys cprog r eb cpm mini nova sits nlogo bee gld mprog2 \ cfs libmud librm1 librm2 mprog mprog1 mudbug mudsav _batch combat \ - mits_b minits spacy _xgpr_ + mits_b minits spacy _xgpr_ haunt DOC = info _info_ sysdoc sysnet syshst kshack _teco_ emacs emacs1 c kcc \ chprog sail draw wl pc tj6 share _glpr_ _xgpr_ inquir mudman system \ xfont maxout ucode moon acount alan channa fonts games graphs humor \ diff --git a/build/build.tcl b/build/build.tcl index f2e2d31bb..a3de385b5 100644 --- a/build/build.tcl +++ b/build/build.tcl @@ -171,6 +171,7 @@ if {$env(BASICS)!="yes"} { source $build/misc.tcl source $build/$cpu/processor.tcl source $build/lisp.tcl + source $build/haunt.tcl if {$env(MACSYMA)=="yes"} { source $build/macsyma.tcl } diff --git a/build/haunt.tcl b/build/haunt.tcl new file mode 100644 index 000000000..574438a17 --- /dev/null +++ b/build/haunt.tcl @@ -0,0 +1,17 @@ +log_progress "ENTERING BUILD SCRIPT: HAUNT" + +respond "*" ":cwd haunt\r" + +# build ops4 +respond "*" "complr\013" +respond "_" "haunt;_haunt;ops4 lsp\r" +respond "_" "\032" +type ":kill\r" + +# dump ops4 +respond "*" "lisp\013" +respond "Alloc?" "n\r" +respond "*" "(load '((haunt) ops4 load))" +respond "T" "(dump-it)" +respond ":\$Job Suspended\$" ":pdump haunt;ts ops4\r" +type ":kill\r" diff --git a/build/timestamps.txt b/build/timestamps.txt index 853774ac6..b66a440be 100644 --- a/build/timestamps.txt +++ b/build/timestamps.txt @@ -766,6 +766,9 @@ gt40/bootvt.s09 197202050000.00 gt40/vt07.bin29 197508142300.00 gz/macn80.mid 198305031813.01 gz/mmodem.181 198511261237.46 +haunt/ops4.load 202410180740.00 +haunt/ops4.lsp 198207011415.01 +haunt/user.lsp 198207011415.01 humor/alices.pdp10 198505161952.01 humor/dover.poem 198106262242.08 humor/jargon.68 198308102314.15 diff --git a/doc/programs.md b/doc/programs.md index 2ef3cd6a7..fca0cf9e6 100644 --- a/doc/programs.md +++ b/doc/programs.md @@ -262,6 +262,7 @@ - OCTPUS, print character representations. - OINIT, init program reporting last login, email. - OS, realtime TTY spy. +- OPS4, a production system that supports HAUNT. - OTHELLO, the original Othello game -- simpler than Go. - OTJ6, an old version of TJ6. - PALX, PDP-11 cross assembler. diff --git a/src/haunt/ops4.load b/src/haunt/ops4.load new file mode 100644 index 000000000..f6b15d05b --- /dev/null +++ b/src/haunt/ops4.load @@ -0,0 +1,21 @@ +;; init file for OPS4 + +(comment) + +(SETSYNTAX '/# (STATUS SYNTAX =) NIL) +(ALLOC ''(LIST (20000. 177000. 4000.) + HUNK4 (24000. 24000. 0) + HUNK8 (24000. 24000. 0) + SYMBOL (3000. 24000. 50.) + FIXNUM (3000. 127000. 0.3))) +(load "haunt;ops4 fasl") + +(defun dump-it () + (setq *nopoint t) + (setq base 10.) + (setq ibase 10.) + (and (filep uread) (close uread)) + (and (filep infile) (not (eq infile tyi)) (close infile)) + (setq infile 'T) + (SAVEIT)) + diff --git a/src/haunt/ops4.lsp b/src/haunt/ops4.lsp new file mode 100644 index 000000000..3df68aa41 --- /dev/null +++ b/src/haunt/ops4.lsp @@ -0,0 +1,2247 @@ + +; OPS4.MCL -- (Maclisp) interpreter for OPS4 +; +; Copyright (C) 1979 Charles L. Forgy +; Pittsburgh, Pennsylvania +; +; Reproduction of this program for noncommercial purposes is +; permitted. No copy of any part of the program text shall be +; made unless the copy contains this notice of copyright. + +(COMMENT --CONTENTS-- INTERSECT COPY CONSP MYERR READP TIME-GCTIME + GELM PRINTLINE PRINTLINE* PRINTLINEC PRINTLINEC* WITHIN + ENCODE ENCODE-VAR-TYPE NEWNODE SYSTEM COMPILE-AND-UPDATE + MATRIX EXCISE-P KILL-NODE COMPILE-PRODUCTION CMP-P DOPE-PART + RHS-PART MAKE-VAR-DOPE CMP-LHS NOTP CMP-NOT CMP-PRIN-FORM + BUILD-BETA PROTOMEM FUDGE FUDGE* FULL-NAME ROOT-NAME VAR-ASSQ + CMP-CEA* CMP-CONDITION CMP-CE* CMP-CEA CMP-CE CMP-VAR + CMP-P-VAR CMP-N-VAR CMP-NEW-P-VAR CMP-OLD-P-VAR CMP-P-N-VAR + MAKE-VIN-TEST MAKE-VL-VECTOR VARIABLE-TYPE VARIABLEP POSVARP + CONSTANTP CMP-CONSTANT USERDEFP PREDICATE CMP-USERDEF + REGULARLISTP CMP-LIST RESET-POSITION NESTING-LEVEL NEST + UNNEST LOC-LOOP CURRENT-POSITION MAKE-BOTTOM-NODE + PLACE-FIRST-NODE STORE-NODE RESET-NODE-STORAGE PLACE-NODES + PLACE-NODES* PLACE-NODES** LINK-NEW-NODE-BOTH + LINK-NEW-NODE-LEFT LINK-NEW-NODE-RIGHT LINK-NEW-NODE + FIND-EQUIV-NODE EQUIV EQUIV1 EQUIV2 EQUIV2NOVAR + ATTACH-NODE-RIGHT ATTACH-NODE-LEFT RIGHT-OUTS LEFT-OUTS + ASSEMBLE-NODE MEMORY-PART NAME-PART DENY REAL-DENY REFRESH + REAL-REFRESH ASSERT REASSERT REAL-ASSERT BUILD-ASSERT MAPWM + WM WM-CNTS* PP-WM REMOVE-FROM-WM CREATION-TIME PRESENTP + FIND-EQUAL-WME ADD-TOKEN REAL-ADD-TOKEN REMOVE-OLD + REMOVE-OLD-NUM REMOVE-OLD-NO-NUM SIMILAR-TOKENP NEXT + FIRST-ATOM DELETE-OLDS VARIABLE LEVEL1 LEVEL2 TRACEP TRACER + TRACER* UNTRACER START-OPTIONS START DO-START CONTINUE + SWITCHES SWASSOC SWNUMBER CYCLE-COUNT ACTION-COUNT RESTART-P + MAIN PRINT-TIMES PM-SIZE AUTOMATIC-DELETE MATCH &BUS &ATOM + &LEN &LEN+ &USER &VIN &P &OLD &TWO &MEM FIND-PREDICATE + DO-TEST &VNO &VEX DO&VEX &NOT DO&NOT SENDTO EVAL-NODELIST + REMOVECS INSERTCS DSORT CONFLICT-RESOLUTION BEST-OF BEST-OF* + REMOVE-FROM-CONFLICT-SET CONFLICT-SET-COMPARE + PNAME-INSTANTIATION ORDER-PART INSTANTIATION NUMCOMP + UPDATE-RECENCY INTERSECTQ + MAKE-NEW-P-NAME + BUILDIT EVAL-RHS + EVAL-RHS-INIT EVAL-LIST OPS-VARIABLE-VALUE EVAL-ELEM FLATTEN + COPY1L RHS-FUNCTION OPS-READ OPS-READ* OPS-READ** PR EXCISER + EDITR EQUAL-LHS INITIALIZE-GLOBAL-VARIABLES SAVEIT) + + +;;; Definitions + +(DECLARE (SETQ IBASE 10.)) + +(DECLARE (FIXSW T) + (MAPEX T)) + +;* try also: (setq nfunvars t) (noargs t) + +(DECLARE (SPECIAL SENDTOCALL* BUILD-FLAG* ADD-LIST* DELETE-LIST* + REFRESHED-WMES* REASSERT-LIST* REFRESH-LHS-FLAG* CURRENT-WM* + NEW-FLAG* WMPART-LIST* WM* ACTION-COUNT* CURRENT-TOKEN* + FIRST-NODE* NEXT-LOCVEC* MAX-LOCVEC* REG3* REG4* REG5* REG1* + REG2* REG0* ATOM-PRIORITY* LENGTH-PRIORITY* PCOUNT* + LAST-NAME* LAST-MATRIX* CREATION-TIME* SPECIAL-CASE-NUMBER* + CONSTANT-COUNT* KEEP-LHS* POS-VAR-POSN* NEG-VAR-POSN* + LAST-NODE* SEGMENT-FLAG* LAST-LENGTH* LOCATION-VECTOR* + VIRTUAL-NODE-COUNT* FEATURES* REAL-FEATURES* + REAL-NODE-COUNT* TRACE-FUNCTION* CYCLE-COUNT* TRACED-RULES* + PNODE* TOTAL-WM* MAX-WM* TOTAL-CS* MAX-CS* TOTAL-TOKEN* + MAX-TOKEN* RUNNING* HALT-FLAG* PHASE* TOTAL-TIME* + NEXT-DELETE-TIME* MAXIMUM-AGE* ALPHA-FLAG-PART* + ALPHA-DATA-PART* PM-NAMES* CONFLICT-SET* + BUILD-FUNCTION* LAST-GENBIND* VARIABLE-MEMORY* SEGMENT* + VARIABLE-DOPE* DATA-MATCHED* FOUND-BINDING* FLAG-PART* + DATA-PART* SIDE* TE-TRACE-FUNCTION* READPROMPT* -LINE* + VAR-FNS* RESTART* INSTANCE*)) + +(DECLARE (*FEXPR PRINL)) + +(DECLARE (NOTYPE (GELM FIXNUM NOTYPE))) + + +;;; Utility functions +; Intersect two lists using EQ for the equality test + +(DEFUN INTERSECT (X Y) + (COND ((ATOM X) NIL) + ((MEMQ (CAR X) Y) (CONS (CAR X) (INTERSECT (CDR X) Y))) + (T (INTERSECT (CDR X) Y)))) + +(DEFMACRO COPY (X) `(SUBST NIL NIL ,X)) + +(DEFMACRO CONSP (X) `(NOT (ATOM ,X))) + +(DEFUN MYERR (X Y) (ERROR Y X)) + +; READP returns T if there is anything in the input buffer +; Dont ask how it works -- it is a total hack + +(DEFUN READP NIL + (PROG (WEDGE) + (SETQ WEDGE (TYIPEEK)) + TOP (COND ((< (LISTEN) 2.) (RETURN NIL)) + ((= (TYIPEEK) 13.) (TYI) (GO TOP)) + (T (RETURN T))))) + +(DEFUN TIME-GCTIME NIL (- (RUNTIME) (STATUS GCTIME))) + +(ARRAY LOCVEC T 501.) + +(DEFUN GELM (LOC X) + (PROG (VEC) + (COND ((< LOC 1.) + (COND ((= LOC -1.) (RETURN REG1*)) + ((= LOC -2.) (RETURN REG2*)) + ((= LOC 0.) (RETURN REG0*)) + ((= LOC -3.) (RETURN REG3*)) + ((= LOC -4.) (RETURN REG4*)) + (T (RETURN REG5*))))) + (SETQ VEC (CDR (LOCVEC LOC))) + TOP (SETQ LOC (CAR VEC)) + NTH (COND ((> LOC 1.) + (SETQ LOC (1- LOC)) + (SETQ X (CDR X)) + (GO NTH))) + (SETQ VEC (CDR VEC)) + (OR VEC (RETURN X)) + (SETQ X (CAR X)) + (GO TOP))) + +; List printing functions + +(DEFUN PRINTLINE (X) (MAPC (FUNCTION PRINTLINE*) X)) + +(DEFUN PRINTLINE* (Y) (PRINC '| |) (PRIN1 Y)) + +(DEFUN PRINTLINEC (X) (MAPC (FUNCTION PRINTLINEC*) X)) + +(DEFUN PRINTLINEC* (Y) (PRINC '| |) (PRINC Y)) + +(DEFUN WITHIN (X LIS) + (COND ((EQ X LIS) T) + ((ATOM LIS) NIL) + (T (OR (WITHIN X (CAR LIS)) (WITHIN X (CDR LIS)))))) + + +;;; The LHS Compiler + +(DEFUN ENCODE (X) + (PROG (I NEW) + (SETQ NEW + (CONS (ENCODE-VAR-TYPE (CAR X)) (REVERSE (CDR X)))) + (COMMENT |This COND is a special encode for one-input nodes|) + (COND ((EQUAL NEW '(NIL 1. 1.)) (RETURN 0.)) + ((EQUAL NEW '(NIL 1. 1. 1.)) (RETURN -1.)) + ((EQUAL NEW '(NIL 1. 2. 1.)) (RETURN -2.)) + ((EQUAL NEW '(NIL 1. 3. 1.)) (RETURN -3.)) + ((EQUAL NEW '(NIL 1. 4. 1.)) (RETURN -4.)) + ((EQUAL NEW '(NIL 1. 5. 1.)) (RETURN -5.))) + (SETQ I 1.) + LAB (COND ((NOT (< I NEXT-LOCVEC*)) (GO NOTFOUND)) + ((EQUAL NEW (LOCVEC I)) (RETURN I))) + (SETQ I (1+ I)) + (GO LAB) + NOTFOUND (COND ((> NEXT-LOCVEC* MAX-LOCVEC*) + (MYERR NEXT-LOCVEC* '|Too many index vectors|))) + (STORE (LOCVEC NEXT-LOCVEC*) NEW) + (SETQ NEXT-LOCVEC* (1+ NEXT-LOCVEC*)) + (RETURN (1- NEXT-LOCVEC*)))) + +(DEFUN ENCODE-VAR-TYPE (X) X) + +; If first argument to NEWNODE is non-negative it is a priority +; Nodes with priority are stored for later insertion +; 0 is the highest priority + +(DEFUN NEWNODE N + (PROG (A B C) + (SETQ A N) + (SETQ B NIL) + L1 (COND ((> 3. A) (GO L2))) + (SETQ B (CONS (ARG A) B)) + (SETQ A (1- A)) + (GO L1) + (COMMENT |Add the appropriate number of successor fields|) + L2 (SETQ B + (COND ((EQ (ARG 2.) '&P) (CONS (ARG 2.) B)) + ((OR (EQ (ARG 2.) '&TWO) (EQ (ARG 2.) '&MEM)) + (CONS (ARG 2.) (CONS NIL (CONS NIL B)))) + (T (CONS (ARG 2.) (CONS NIL B))))) + (SETQ C (ARG 1.)) + (COND ((> C -1.) (STORE-NODE (NESTING-LEVEL) C B))) + (RETURN B))) + +(DEFUN SYSTEM FEXPR (SYS) + (PROG (NAME MATRIX) + L1 (COND ((ATOM SYS) (RETURN NIL))) + (SETQ NAME (CAR SYS)) + (SETQ SYS (CDR SYS)) + (COND ((ATOM NAME) + (OR (CONSP SYS) (MYERR SYS '|NO PRODUCTION|)) + (SETQ MATRIX (CAR SYS)) + (SETQ SYS (CDR SYS))) + (T (SETQ MATRIX NAME) (SETQ NAME NIL))) + (COMPILE-PRODUCTION NAME MATRIX) + (PRINC '*) + (GO L1))) + +(DEFUN COMPILE-AND-UPDATE (NAME MATRIX) + (SETQ BUILD-FLAG* (LIST FIRST-NODE*)) + (COMPILE-PRODUCTION NAME MATRIX) + (MAPWM (FUNCTION BUILD-ASSERT)) + (SETQ BUILD-FLAG* NIL)) + +(DEFUN MATRIX (NAME) (AND (SYMBOLP NAME) (GET NAME 'PRODUCTION))) + +(DEFUN EXCISE-P (NAME) + (COND ((AND (SYMBOLP NAME) (GET NAME 'RHS)) + (PROGN (REMPROP NAME 'PRODUCTION) + (REMPROP NAME 'RHS) + (REMPROP NAME 'VARIABLE-DOPE) + (REMOVE-FROM-CONFLICT-SET NAME) + (KILL-NODE (GET NAME 'TOPNODE)) + (REMPROP NAME 'TOPNODE) + (SETQ PCOUNT* (1- PCOUNT*)))))) + +(DEFUN KILL-NODE (NODE) (COND ((CONSP NODE) (RPLACA NODE '&OLD)))) + +(DEFUN COMPILE-PRODUCTION (NAME MATRIX) + (PROG (ERM) + (SETQ LAST-NAME* NAME) + (SETQ LAST-MATRIX* MATRIX) + (SETQ ERM (ERRSET (CMP-P LAST-NAME* LAST-MATRIX*))) + (AND (NULL ERM) + (NOT (NULL NAME)) + (PRINT (LIST 'ERROR 'IN NAME))))) + +(DEFUN CMP-P (NAME MATRIX) + (PROG (LHS M DOPE NODE IDENT RATING) + (SETQ PCOUNT* (1+ PCOUNT*)) + (SETQ CREATION-TIME* (1+ CREATION-TIME*)) + (SETQ SPECIAL-CASE-NUMBER* 0.) + (SETQ CONSTANT-COUNT* 0.) + (SETQ M MATRIX) + (SETQ LHS NIL) + L1 (COND ((ATOM M) + (MYERR MATRIX '|WRONG FORMAT FOR PRODUCTION|)) + ((EQ '--> (CAR M)) (GO L2))) + (SETQ LHS (CONS (CAR M) LHS)) + (SETQ M (CDR M)) + (GO L1) + L2 (CMP-LHS (NREVERSE LHS)) + (SETQ DOPE (MAKE-VAR-DOPE M POS-VAR-POSN*)) + (SETQ IDENT + (COND ((NOT (NULL NAME)) NAME) + (T (CONS DOPE (CDR M))))) + (SETQ RATING + (+ (* 5000000. SPECIAL-CASE-NUMBER*) + (* 5000. CONSTANT-COUNT*) + CREATION-TIME*)) + (SETQ NODE (LINK-NEW-NODE (NEWNODE -1. '&P RATING IDENT))) + (COND ((NOT (NULL NAME)) + (EXCISE-P NAME) + (PUTPROP NAME (CDR M) 'RHS) + (AND KEEP-LHS* (PUTPROP NAME MATRIX 'PRODUCTION)) + (PUTPROP NAME DOPE 'VARIABLE-DOPE) + (PUTPROP NAME NODE 'TOPNODE))))) + +(DEFUN DOPE-PART (X) (CAR X)) + +(DEFUN RHS-PART (X) (CDR X)) + +(DEFUN MAKE-VAR-DOPE (RHS POSN) + (PROG (R NAME VECTOR) + (SETQ R NIL) + TOP (AND (ATOM POSN) (RETURN R)) + (SETQ NAME (CAAR POSN)) + (SETQ VECTOR (CDAR POSN)) + (SETQ POSN (CDR POSN)) + (SETQ NAME (FULL-NAME NAME)) + (AND (WITHIN NAME RHS) + (SETQ R (CONS (CONS NAME (ENCODE VECTOR)) R))) + (GO TOP))) + +(DEFUN CMP-LHS (LHS) + (SETQ NEG-VAR-POSN* (SETQ POS-VAR-POSN* NIL)) + (CMP-PRIN-FORM LHS) + (COND (NEG-VAR-POSN* + (MYERR (CAAR NEG-VAR-POSN*) + '|UNRESOLVED NOT-VARIABLES IN LHS|)))) + +(DEFUN NOTP (X) (AND (CONSP X) (EQ (CAR X) '))) + +(DEFUN CMP-NOT (X) (CMP-PRIN-FORM X)) + +; In the following, P, PNEW, POS-VAR-POSN* hold pointers to variables, +; and N, NNEW, NEG-VAR-POSN* hold pointers to NOT-variables. The two +; SPECIALs are needed because nested s have to be able to +; communicate back to higher levels. + +(DEFUN CMP-PRIN-FORM (FORM) + (PROG (N P TYPEOFLAST NNEW PNEW A Z NEWLOCS OLDLOCS LAST X + SEEN-POS) + (COND ((ATOM FORM) + (MYERR FORM '|Null LHS or null argument to |))) + (SETQ LAST NIL) + (SETQ SEEN-POS NIL) + (SETQ X FORM) + L1 (COND ((ATOM X) (RETURN NIL))) + (SETQ N NEG-VAR-POSN*) + (SETQ P POS-VAR-POSN*) + (SETQ POS-VAR-POSN* (SETQ NEG-VAR-POSN* NIL)) + (RESET-POSITION) + (COND ((EQ (CAR X) '-) + (COND ((NOT SEEN-POS) + (MYERR FORM + ' + +|First condition element cannot be negated| + ))) + (CMP-NOT (LIST (CADR X))) + (SETQ X (CDDR X)) + (SETQ TYPEOFLAST NIL)) + ((NOTP (CAR X)) + (COND ((NOT SEEN-POS) + (MYERR FORM + ' + +|First condition element cannot be negated| + ))) + (CMP-NOT (CDAR X)) + (SETQ X (CDR X)) + (SETQ TYPEOFLAST NIL)) + (T + (SETQ SEEN-POS T) + (SETQ X (CMP-CONDITION X)) + (SETQ TYPEOFLAST T))) + LX (SETQ PNEW (SETQ NNEW NIL)) + (SETQ NEWLOCS (SETQ OLDLOCS NIL)) + (COMMENT |If anything in POS-VAR-POSN* use it|) + BETA (COND ((ATOM POS-VAR-POSN*) (GO BETAN))) + (SETQ A (CAR POS-VAR-POSN*)) + (SETQ POS-VAR-POSN* (CDR POS-VAR-POSN*)) + (SETQ Z (ASSQ (CAR A) P)) + (COND (Z + (SETQ NEWLOCS (CONS (CDR A) NEWLOCS)) + (SETQ OLDLOCS (CONS (CDR Z) OLDLOCS))) + (T (SETQ PNEW (CONS A PNEW)))) + LB (SETQ Z (ASSQ (CAR A) N)) + (COND ((ATOM Z) (GO BETA))) + (SETQ NEWLOCS (CONS (CDR A) NEWLOCS)) + (SETQ OLDLOCS (CONS (CDR Z) OLDLOCS)) + (SETQ N (DELQ Z N)) + (GO LB) + (COMMENT |If anything in NEG-VAR-POSN* use it|) + BETAN (COND ((ATOM NEG-VAR-POSN*) (GO L5))) + (SETQ A (CAR NEG-VAR-POSN*)) + (SETQ NEG-VAR-POSN* (CDR NEG-VAR-POSN*)) + (SETQ Z (ASSQ (CAR A) P)) + (COND (Z + (SETQ NEWLOCS (CONS (CDR A) NEWLOCS)) + (SETQ OLDLOCS (CONS (CDR Z) OLDLOCS))) + (T (SETQ NNEW (CONS A NNEW)))) + (GO BETAN) + (COMMENT |Build a beta node unless this is the first CE|) + L5 (COND (LAST + (COND ((> (LENGTH NEWLOCS) 6.) + (MYERR FORM '|Too many variables|))) + (SETQ LAST + (BUILD-BETA TYPEOFLAST OLDLOCS NEWLOCS LAST))) + (T (SETQ LAST LAST-NODE*))) + (COMMENT |Reset SPECIALs so can go to next principal|) + (COND (TYPEOFLAST + (FUDGE N) + (FUDGE P) + (SETQ NEG-VAR-POSN* (APPEND NNEW N)) + (SETQ POS-VAR-POSN* (APPEND PNEW P))) + (T (SETQ NEG-VAR-POSN* N) (SETQ POS-VAR-POSN* P))) + (GO L1))) + +(DEFUN BUILD-BETA (TYPE OLD-VAR-LOCS NEW-VAR-LOCS NODE-ON-LEFT) + (PROG (R NEW OLD LEFT-PRED LTYPE RIGHT-PRED FUN RIT LEF) + (SETQ RIGHT-PRED + (LINK-NEW-NODE (NEWNODE -1. '&MEM (PROTOMEM)))) + (SETQ LTYPE + (COND (TYPE (NEWNODE -1. '&MEM (PROTOMEM))) + (T (NEWNODE -1. '&TWO)))) + (SETQ LEFT-PRED (LINK-NEW-NODE-RIGHT LTYPE NODE-ON-LEFT)) + (SETQ OLD + (MAPCAN (FUNCTION (LAMBDA (P) (LIST (ENCODE P)))) + OLD-VAR-LOCS)) + (SETQ NEW + (MAPCAN (FUNCTION (LAMBDA (P) (LIST (ENCODE P)))) + NEW-VAR-LOCS)) + (COND (TYPE + (COND (NEW (SETQ FUN '&VEX)) + (T (SETQ FUN '&VNO))) + (SETQ LEF LEFT-PRED)) + (T (SETQ FUN '&NOT) (SETQ LEF (PROTOMEM)))) + (SETQ RIT RIGHT-PRED) + (COND ((EQ FUN '&VNO) (SETQ R (NEWNODE -1. FUN RIT LEF))) + (T (SETQ R (NEWNODE -1. FUN RIT LEF OLD NEW)))) + (RETURN (LINK-NEW-NODE-BOTH R LEFT-PRED RIGHT-PRED)))) + +(DEFUN PROTOMEM NIL (LIST NIL)) + +; Both POS-VAR-POSN* and NEG-VAR-POSN* have the same format. +; Both are association lists; associations are along root name. +; Root name of a variable is the name with first char taken off. +; Example of one entry: (X . LOCATION-VECTOR) + +(DEFUN FUDGE (X) (MAPC (FUNCTION FUDGE*) X)) + +(DEFUN FUDGE* (X) + (COND ((ATOM (CDR X)) (RPLACA X (1+ (CAR X)))) + (T (FUDGE* (CDR X))))) + +(DEFUN FULL-NAME (ROOT) (READLIST (CONS '= (EXPLODE ROOT)))) + +(DEFUN ROOT-NAME (VAR) (READLIST (CDR (EXPLODE VAR)))) + +(DEFUN VAR-ASSQ (X L) (ASSQ (ROOT-NAME X) L)) + +(DEFUN CMP-CEA* (X) + (COND ((ATOM X) (MYERR X '|Illegal CEA*|))) + (CMP-CEA (CAR X)) + (COND ((ATOM (CDR X)) (CDR X)) + ((EQ '& (CADR X)) (CMP-CEA* (CDDR X))) + (T (CDR X)))) + +; CMP-CONDITION is a special kind of CMP-CE* +; It is only called at the top level of the production + +(DEFUN CMP-CONDITION (X) + (PROG (R) + (SETQ SEGMENT-FLAG* NIL) + (SETQ SPECIAL-CASE-NUMBER* (1+ SPECIAL-CASE-NUMBER*)) + (RESET-NODE-STORAGE) + (SETQ R (CMP-CE* X)) + (PLACE-NODES) + (RETURN R))) + +(DEFUN CMP-CE* (X) + (COND ((ATOM X) (MYERR X '|Illegal CE*|))) + (CMP-CE (CAR X)) + (COND ((ATOM (CDR X)) (CDR X)) + ((EQ '& (CADR X)) (CMP-CE* (CDDR X))) + (T (CDR X)))) + +(DEFUN CMP-CEA (X) + (COND ((VARIABLEP X) (CMP-VAR X)) + ((CONSTANTP X) (CMP-CONSTANT X)) + ((USERDEFP X) (CMP-USERDEF X)) + (T (MYERR X '|Unidentifiable condition element|)))) + +(DEFUN CMP-CE (X) + (COND ((REGULARLISTP X) (CMP-LIST X)) + (T (CMP-CEA X)))) + +(DEFUN CMP-VAR (V) + (COND ((EQ '= V)) + ((POSVARP V) (CMP-P-VAR V)) + (T (CMP-N-VAR V)))) + +(DEFUN CMP-P-VAR (V) + (PROG (A VL) + (SETQ VL (MAKE-VL-VECTOR V)) + (SETQ A (VAR-ASSQ V POS-VAR-POSN*)) + (COND (A (RETURN (CMP-OLD-P-VAR VL (CDR A))))) + L1 (SETQ A (VAR-ASSQ V NEG-VAR-POSN*)) + (COND ((NOT A) (RETURN (CMP-NEW-P-VAR V VL)))) + (CMP-P-N-VAR VL (CDR A)) + (SETQ NEG-VAR-POSN* (DELQ A NEG-VAR-POSN*)) + (GO L1))) + +(DEFUN CMP-N-VAR (V) + (PROG (A VL) + (SETQ VL (MAKE-VL-VECTOR V)) + (SETQ A (VAR-ASSQ V POS-VAR-POSN*)) + (COND (A (MAKE-VIN-TEST VL (CDR A))) + (T + (SETQ NEG-VAR-POSN* + (CONS (CONS (ROOT-NAME V) VL) NEG-VAR-POSN*)))))) + +(DEFUN CMP-NEW-P-VAR (NAME VARLOC) + (SETQ POS-VAR-POSN* + (CONS (CONS (ROOT-NAME NAME) VARLOC) POS-VAR-POSN*))) + +(DEFUN CMP-OLD-P-VAR (VAR OLD) (MAKE-VIN-TEST VAR OLD)) + +(DEFUN CMP-P-N-VAR (VAR NOT) (MAKE-VIN-TEST VAR NOT)) + +(DEFUN MAKE-VIN-TEST (A B) + (NEWNODE 2. '&VIN (ENCODE A) (ENCODE B))) + +; COPY needed below because FUDGE will munge these numbers + +(DEFUN MAKE-VL-VECTOR (VAR) + (COPY (CURRENT-POSITION (VARIABLEP VAR)))) + +(DEFUN VARIABLE-TYPE (V) (CAR (LOCVEC V))) + +(DEFUN VARIABLEP (PROBE) + (PROG (Z) + (OR (SYMBOLP PROBE) (RETURN NIL)) + (SETQ Z (GETCHAR PROBE 1.)) + (COND ((ASSOC Z VAR-FNS*) (RETURN Z)) + (T (RETURN NIL))))) + +(DEFUN POSVARP (V) (EQ (VARIABLEP V) '=)) + +(DEFUN CONSTANTP (X) + (OR (NUMBERP X) (AND (SYMBOLP X) (NOT (VARIABLEP X))))) + +(DEFUN CMP-CONSTANT (X) + (SETQ CONSTANT-COUNT* (1+ CONSTANT-COUNT*)) + (NEWNODE ATOM-PRIORITY* '&ATOM (ENCODE (CURRENT-POSITION NIL)) X)) + +(DEFUN USERDEFP (X) + (AND (CONSP X) (SYMBOLP (CAR X)) (GET (CAR X) 'LHS-FN))) + +(DEFUN PREDICATE FEXPR (L) + (MAPC (FUNCTION (LAMBDA (X) (PUTPROP X T 'LHS-FN))) L)) + +(DEFUN CMP-USERDEF (L) + (NEWNODE 2. + '&USER + (ENCODE (CURRENT-POSITION NIL)) + (CAR L) + (CDR L))) + +(DEFUN REGULARLISTP (X) (AND (CONSP X) (NOT (USERDEFP X)))) + +(DEFUN CMP-LIST (X) + (PROG (A TYPE) + (NEST) + (SETQ A X) + (SETQ TYPE '&LEN) + (SETQ SEGMENT-FLAG* NIL) + L1 (COND ((ATOM A) (GO L2))) + (SETQ A (CMP-CE* A)) + (LOC-LOOP) + (COND ((NOT (AND (CONSP A) (EQ (CAR A) '!))) (GO L1))) + (SETQ TYPE '&LEN+) + (SETQ SEGMENT-FLAG* T) + (SETQ A (CMP-CEA* (CDR A))) + (COND (A (MYERR X '|Extra form in SEGMENT|))) + L2 (UNNEST) + (SETQ SEGMENT-FLAG* NIL) + (NEWNODE LENGTH-PRIORITY* + TYPE + (ENCODE (CURRENT-POSITION NIL)) + (1- LAST-LENGTH*)))) + +(DEFUN RESET-POSITION NIL (SETQ LOCATION-VECTOR* (LIST 1.))) + +(DEFUN NESTING-LEVEL NIL (1- (LENGTH LOCATION-VECTOR*))) + +(DEFUN NEST NIL (SETQ LOCATION-VECTOR* (CONS 1. LOCATION-VECTOR*))) + +(DEFUN UNNEST NIL + (SETQ LAST-LENGTH* (CAR LOCATION-VECTOR*)) + (SETQ LOCATION-VECTOR* (CDR LOCATION-VECTOR*))) + +(DEFUN LOC-LOOP NIL + (SETQ LOCATION-VECTOR* + (CONS (1+ (CAR LOCATION-VECTOR*)) (CDR LOCATION-VECTOR*)))) + +(DEFUN CURRENT-POSITION (X) + (CONS X + (COND (SEGMENT-FLAG* LOCATION-VECTOR*) + (T (CONS 1. LOCATION-VECTOR*))))) + +(DEFUN MAKE-BOTTOM-NODE NIL (SETQ FIRST-NODE* (LIST '&BUS NIL))) + +(DEFUN PLACE-FIRST-NODE NIL (SETQ LAST-NODE* FIRST-NODE*)) + +; Note that NEWNODES* has more elements than are used +; Actually it s used as a 3 by 10 array + +(ARRAY NEWNODES* T 4. 11.) + +(DEFUN STORE-NODE (NESTED-TO PRIORITY NODE) + (PROG (N) + (SETQ N NESTED-TO) + (COND ((> N 9.) (SETQ N 9.))) + (STORE (NEWNODES* PRIORITY N) + (CONS NODE (NEWNODES* PRIORITY N))))) + +(DEFUN RESET-NODE-STORAGE NIL + (PROG (I J) + (SETQ I -1.) + LOUT (SETQ I (1+ I)) + (COND ((> I 9.) (RETURN NIL))) + (SETQ J -1.) + LIN (SETQ J (1+ J)) + (COND ((> J 2.) (GO LOUT))) + (STORE (NEWNODES* J I) NIL) + (GO LIN))) + +(DEFUN PLACE-NODES NIL + (PROG (LVL PRTY) + (PLACE-FIRST-NODE) + (SETQ LVL -1.) + LOUT (SETQ LVL (1+ LVL)) + (COND ((> LVL 9.) (RETURN NIL))) + (SETQ PRTY -1.) + LIN (SETQ PRTY (1+ PRTY)) + (COND ((> PRTY 2.) (GO LOUT))) + (PLACE-NODES* (NEWNODES* PRTY LVL)) + (GO LIN))) + +(DEFUN PLACE-NODES* (X) + (COND ((ATOM X)) + (T (PLACE-NODES* (CDR X)) (PLACE-NODES** (CAR X))))) + +(DEFUN PLACE-NODES** (NODE) (LINK-NEW-NODE NODE)) + +(DEFUN LINK-NEW-NODE-BOTH (NODE LEFTPRED RIGHTPRED) + (PROG (A R) + (SETQ VIRTUAL-NODE-COUNT* (1+ VIRTUAL-NODE-COUNT*)) + (COND ((MEMQ (CAR NODE) '(&VEX &NOT)) + (SETQ FEATURES* + (+ FEATURES* (LENGTH (CAR (CDDDDR NODE)))))) + ((MEMQ (CAR NODE) '(&LEN &LEN+ &ATOM &VIN &USER)) + (SETQ FEATURES* (1+ FEATURES*)))) + (COND ((AND LEFTPRED RIGHTPRED) + (SETQ A + (INTERSECT (RIGHT-OUTS RIGHTPRED) + (LEFT-OUTS LEFTPRED)))) + (RIGHTPRED (SETQ A (RIGHT-OUTS RIGHTPRED))) + (T (SETQ A (LEFT-OUTS LEFTPRED)))) + (SETQ R (FIND-EQUIV-NODE NODE A)) + (COND (R + (COND (BUILD-FLAG* + (SETQ BUILD-FLAG* (CONS R BUILD-FLAG*)))) + (RETURN (SETQ LAST-NODE* R)))) + (COND ((MEMQ (CAR NODE) '(&VEX &NOT)) + (SETQ REAL-FEATURES* + (+ REAL-FEATURES* + (LENGTH (CAR (CDDDDR NODE)))))) + ((MEMQ (CAR NODE) '(&LEN &LEN+ &ATOM &VIN &USER)) + (SETQ REAL-FEATURES* (1+ REAL-FEATURES*)))) + (SETQ REAL-NODE-COUNT* (1+ REAL-NODE-COUNT*)) + (SETQ NODE (ASSEMBLE-NODE NODE)) + (COND (RIGHTPRED (ATTACH-NODE-RIGHT NODE RIGHTPRED))) + (COND (LEFTPRED (ATTACH-NODE-LEFT NODE LEFTPRED))) + (SETQ LAST-NODE* NODE) + (COND (BUILD-FLAG* + (SETQ BUILD-FLAG* (CONS NODE BUILD-FLAG*)))) + (RETURN NODE))) + +(DEFUN LINK-NEW-NODE-LEFT (NODE PRED) + (LINK-NEW-NODE-BOTH NODE PRED NIL)) + +(DEFUN LINK-NEW-NODE-RIGHT (NODE PRED) + (LINK-NEW-NODE-BOTH NODE NIL PRED)) + +(DEFUN LINK-NEW-NODE (NODE) + (LINK-NEW-NODE-BOTH NODE NIL LAST-NODE*)) + +(DEFUN FIND-EQUIV-NODE (NODE LIST) + (PROG (A) + (SETQ A LIST) + L1 (COND ((ATOM A) (RETURN NIL)) + ((EQUIV NODE (CAR A)) (RETURN (CAR A)))) + (SETQ A (CDR A)) + (GO L1))) + + +;;; The functions on this page know which nodes are HUNKS +; &ATOM, &VIN, &LEN, &LEN+, &VEX, &VNO, and &NOT are HUNKS +; &MEM, &P, and &OLD are modified during execution, so they are lists +; &TWO is a list so that it will be like &MEM +; &BUS and &USER are rare, so little point in making them HUNKS +; EQUIV will not consider a new node to be equivalent to an +; old node if the old node has anything in its memory. +; THE MECHANISMS FOR GROWING NEW PRODUCTIONS REQUIRE THIS. + +(DEFUN EQUIV (NODE1 NODE2) + (AND (EQ (CAR NODE1) (CAR NODE2)) + (COND ((EQ (CAR NODE1) '&MEM) + (EQUAL (CDDDR NODE1) (CDDDR NODE2))) + ((EQ (CAR NODE1) '&TWO) T) + ((EQ (CAR NODE1) '&P) NIL) + ((MEMQ (CAR NODE1) '(&ATOM &LEN &LEN+ &VIN)) + (EQUIV1 NODE1 NODE2)) + ((MEMQ (CAR NODE1) '(&VEX &NOT)) + (EQUIV2 NODE1 NODE2)) + ((EQ (CAR NODE1) '&VNO) (EQUIV2NOVAR NODE1 NODE2)) + (T (EQUAL (CDDR NODE1) (CDDR NODE2)))))) + +(DEFUN EQUIV1 (X Y) + (AND (EQUAL (CAR X) (CXR 1. Y)) + (EQUAL (CADDR X) (CXR 3. Y)) + (EQUAL (CADDDR X) (CXR 0. Y)))) + +;* Using EQUAL for the memory pointer parts of 2-input nodes +;* could be very expensive, computationally. It could be that +;* many nodes would be examined on some occassions. + +(DEFUN EQUIV2 (X Y) + (AND (EQUAL (CAR X) (CXR 1. Y)) + (EQUAL (CADR (CDDDDR X)) (CXR 0. Y)) + (EQUAL (CAR (CDDDDR X)) (CXR 5. Y)) + (EQUAL (CADDDR X) (CXR 4. Y)) + (EQUAL (CADDR X) (CXR 3. Y)))) + +(DEFUN EQUIV2NOVAR (X Y) + (AND (EQUAL (CAR X) (CXR 1. Y)) + (EQUAL (CADDDR X) (CXR 0. Y)) + (EQUAL (CADDR X) (CXR 3. Y)))) + +(DEFUN ATTACH-NODE-RIGHT (NEW OLD) + (COND ((MEMQ (CAR OLD) '(&ATOM &VIN &LEN &LEN+ &VEX &NOT &VNO)) + (RPLACX 2. OLD (CONS NEW (CXR 2. OLD)))) + (T (RPLACA (CDR OLD) (CONS NEW (CADR OLD)))))) + +(DEFUN ATTACH-NODE-LEFT (NEW OLD) + (RPLACA (CDDR OLD) (CONS NEW (CADDR OLD)))) + +(DEFUN RIGHT-OUTS (X) + (COND ((MEMQ (CAR X) '(&ATOM &VIN &LEN &LEN+ &VEX &NOT &VNO)) + (CXR 2. X)) + (T (CADR X)))) + +(DEFUN LEFT-OUTS (NODE) (CADDR NODE)) + +(DEFUN ASSEMBLE-NODE (X) + (COND ((MEMQ (CAR X) '(&ATOM &VIN &LEN &LEN+)) + (HUNK (CAR X) (CADR X) (CADDR X) (CADDDR X))) + ((MEMQ (CAR X) '(&VEX &NOT)) + (HUNK (CAR X) + (CADR X) + (CADDR X) + (CADDDR X) + (CAR (CDDDDR X)) + (CADR (CDDDDR X)))) + ((EQ (CAR X) '&VNO) + (HUNK (CAR X) (CADR X) (CADDR X) (CADDDR X))) + (T X))) + +(DEFUN MEMORY-PART (MEM-NODE) (CAR (CADDDR MEM-NODE))) + +(DEFUN NAME-PART (PROD-NODE) (CADDR PROD-NODE)) + + +;;; Working Memory Maintaining Functions +; WM is stored in pieces under property WMPART*. +; Each part is an association list of form: (WME . CREATION-TIME) + +(DEFUN DENY (ELM) + (PROG (A) + (COND ((OR (NOT ELM) + (MEMBER ELM ADD-LIST*) + (MEMBER ELM DELETE-LIST*)) + (RETURN NIL))) + (SETQ A (FIND-EQUAL-WME ELM NIL)) + (COND (A (SETQ DELETE-LIST* (CONS A DELETE-LIST*)))))) + +(DEFUN REAL-DENY (ELM) + (SETQ CURRENT-WM* (1- CURRENT-WM*)) + (MATCH NIL ELM)) + +(DEFUN REFRESH (OLDELEM) + (OR (MEMBER OLDELEM ADD-LIST*) + (MEMBER OLDELEM DELETE-LIST*) + (REAL-REFRESH (FIND-EQUAL-WME OLDELEM NIL)))) + +(DEFUN REAL-REFRESH (X) + (SETQ REFRESHED-WMES* (CONS X REFRESHED-WMES*))) + +(DEFUN ASSERT (ELM) + (COND ((NOT (OR (NOT ELM) + (MEMBER ELM ADD-LIST*) + (MEMBER ELM DELETE-LIST*))) + (SETQ ADD-LIST* (CONS ELM ADD-LIST*))))) + +(DEFUN REASSERT (ELM) + (COND ((NOT (OR (NOT ELM) + (MEMBER ELM ADD-LIST*) + (MEMBER ELM DELETE-LIST*))) + (SETQ ADD-LIST* (CONS ELM ADD-LIST*)) + (SETQ REASSERT-LIST* (CONS ELM REASSERT-LIST*))))) + +(DEFUN REAL-ASSERT (ELM) + (PROG (NEWELM) + (SETQ NEWELM (FIND-EQUAL-WME ELM T)) + (COND ((OR (EQ NEW-FLAG* 'NEW) (MEMQ ELM REASSERT-LIST*)) + (MATCH NEW-FLAG* NEWELM)) + (T (REAL-REFRESH NEWELM))))) + +; BUILD-ASSERT is called only when is executed +; all nodes except the newly added ones are disabled then + +(DEFUN BUILD-ASSERT (WM-ENTRY) (MATCH 'NEW (CAR WM-ENTRY))) + +; MAPWM maps down the elements of wm, applying FN to each element +; each element is of form (DATUM . CREATION-TIME) + +(DEFUN MAPWM (FN) + (PROG (WMPL PART) + (SETQ WMPL WMPART-LIST*) + LAB1 (COND ((ATOM WMPL) (RETURN NIL))) + (SETQ PART (GET (CAR WMPL) 'WMPART*)) + (SETQ WMPL (CDR WMPL)) + (MAPC FN PART) + (GO LAB1))) + +(DEFUN WM NIL + (SETQ WM* NIL) + (MAPWM (FUNCTION WM-CNTS*)) + (PROG2 NIL WM* (SETQ WM* NIL))) + +(DEFUN WM-CNTS* (ELEM) (SETQ WM* (CONS (CAR ELEM) WM*))) + +(DEFUN PP-WM NIL (WM)) + +; REMOVE-FROM-WM uses EQ so WME must be an actual element + +(DEFUN REMOVE-FROM-WM (WME) + (PROG (FA Z PART) + (SETQ PART (GET (SETQ FA (FIRST-ATOM WME)) 'WMPART*)) + (SETQ Z (ASSQ WME PART)) + (PUTPROP FA (DELQ Z PART) 'WMPART*))) + +(DEFUN CREATION-TIME (WME) + (CDR (ASSQ WME (GET (FIRST-ATOM WME) 'WMPART*)))) + +(DEFUN PRESENTP (OBJ) (ASSOC OBJ (GET (FIRST-ATOM OBJ) 'WMPART*))) + +(DEFUN FIND-EQUAL-WME (ELM ADD-FLAG) + (PROG (FIRST-ATOM PART OLD) + (SETQ ACTION-COUNT* (1+ ACTION-COUNT*)) + (SETQ NEW-FLAG* 'OLD) + (SETQ FIRST-ATOM (FIRST-ATOM ELM)) + (SETQ PART (GET FIRST-ATOM 'WMPART*)) + (SETQ OLD (ASSOC ELM PART)) + (COND (OLD (RPLACD OLD ACTION-COUNT*) (RETURN (CAR OLD))) + ((NOT ADD-FLAG) (RETURN NIL))) + (SETQ CURRENT-WM* (1+ CURRENT-WM*)) + (SETQ NEW-FLAG* 'NEW) + (PUTPROP FIRST-ATOM + (CONS (CONS ELM ACTION-COUNT*) PART) + 'WMPART*) + (COND ((NOT (MEMQ FIRST-ATOM WMPART-LIST*)) + (SETQ WMPART-LIST* (CONS FIRST-ATOM WMPART-LIST*)))) + (RETURN ELM))) + +(DEFUN ADD-TOKEN (LIS F D NUM) + (PROG (WAS-PRESENT) + (COMMENT |LIS is a list whose CAR is a memory| + |F is a flag and D is a data part|) + (COND ((EQ F 'NEW) + (COND (BUILD-FLAG* + (SETQ WAS-PRESENT (REMOVE-OLD LIS D NUM))) + (T (SETQ WAS-PRESENT NIL))) + (REAL-ADD-TOKEN LIS D NUM)) + ((NOT F) (SETQ WAS-PRESENT (REMOVE-OLD LIS D NUM))) + ((EQ F 'OLD) (SETQ WAS-PRESENT T))) + (RETURN WAS-PRESENT))) + +(DEFUN REAL-ADD-TOKEN (LIS DATA-PART NUM) + (SETQ CURRENT-TOKEN* (1+ CURRENT-TOKEN*)) + (COND (NUM (RPLACA LIS (CONS NUM (CAR LIS))))) + (RPLACA LIS (CONS DATA-PART (CAR LIS)))) + +(DEFUN REMOVE-OLD (LIS DATA NUM) + (COND (NUM (REMOVE-OLD-NUM LIS DATA)) + (T (REMOVE-OLD-NO-NUM LIS DATA)))) + +(DEFUN REMOVE-OLD-NUM (LIS DATA) + (PROG (M NEXT LAST) + (SETQ M (CAR LIS)) + (COND ((ATOM M) (RETURN NIL)) + ((SIMILAR-TOKENP DATA (CAR M)) + (SETQ CURRENT-TOKEN* (1- CURRENT-TOKEN*)) + (RPLACA LIS (CDDR M)) + (RETURN (CAR M)))) + (SETQ NEXT M) + LOC-LOOP (SETQ LAST NEXT) + (SETQ NEXT (CDDR NEXT)) + (COND ((ATOM NEXT) (RETURN NIL)) + ((SIMILAR-TOKENP DATA (CAR NEXT)) + (RPLACD (CDR LAST) (CDDR NEXT)) + (SETQ CURRENT-TOKEN* (1- CURRENT-TOKEN*)) + (RETURN (CAR NEXT))) + (T (GO LOC-LOOP))))) + +(DEFUN REMOVE-OLD-NO-NUM (LIS DATA) + (PROG (M NEXT LAST) + (SETQ M (CAR LIS)) + (COND ((ATOM M) (RETURN NIL)) + ((SIMILAR-TOKENP DATA (CAR M)) + (SETQ CURRENT-TOKEN* (1- CURRENT-TOKEN*)) + (RPLACA LIS (CDR M)) + (RETURN (CAR M)))) + (SETQ NEXT M) + LOC-LOOP (SETQ LAST NEXT) + (SETQ NEXT (CDR NEXT)) + (COND ((ATOM NEXT) (RETURN NIL)) + ((SIMILAR-TOKENP DATA (CAR NEXT)) + (RPLACD LAST (CDR NEXT)) + (SETQ CURRENT-TOKEN* (1- CURRENT-TOKEN*)) + (RETURN (CAR NEXT))) + (T (GO LOC-LOOP))))) + +; SIMILAR-TOKENP was made faster by adding first clause in COND. +; That clause helps because many tokens share common tails. + +(DEFUN SIMILAR-TOKENP (LA LB) + (PROG NIL + LX (COND ((EQ LA LB) (RETURN T)) + ((NULL LA) (RETURN NIL)) + ((NULL LB) (RETURN NIL)) + ((NOT (EQ (CAR LA) (CAR LB))) (RETURN NIL))) + (SETQ LA (CDR LA)) + (SETQ LB (CDR LB)) + (GO LX))) + +(DEFUN NEXT (MEMORY NUMBER) + (COND (NUMBER (CDR MEMORY)) + (T (CDDR MEMORY)))) + +; FIRST-ATOM places some restrictions on the form of WMEs +; FIND-EQUAL-WME & REMOVE-FROM-WM make similar assumptions + +(DEFUN FIRST-ATOM (X) + (COND ((NOT X) (MYERR X '|ILLEGAL WM ELEMENT|)) + ((SYMBOLP X) X) + ((ATOM X) ') + (T (FIRST-ATOM (CAR X))))) + +(DEFUN DELETE-OLDS (WMENTRY) + (COND ((< MAXIMUM-AGE* (- ACTION-COUNT* (CDR WMENTRY))) + (DENY (CAR WMENTRY))))) + + +;;; Functions to interact with the user + +(DEFUN VARIABLE FEXPR (L) + (PROG (X A B R) + (OR (EQUAL (LENGTH L) 3.) + (EQUAL (LENGTH L) 2.) + (MYERR L '|Wrong number of arguments|)) + (SETQ X (CAR L)) + (SETQ B (SETQ A (CADR L))) + (AND (EQUAL (LENGTH L) 3.) (SETQ B (CADDR L))) + (OR (AND (ATOM X) (EQUAL 1. (FLATSIZE X))) + (MYERR X '|Must be a single character|)) + (OR (ATOM A) (MYERR A '|Must be an atom|)) + (OR (ATOM B) (MYERR B '|Must be an atom|)) + (SETQ R (LIST X A B)) + (AND (ASSOC X VAR-FNS*) + (PRINC '|Warning: Variable type is being redefined|)) + (SETQ VAR-FNS* (CONS R VAR-FNS*)) + (RETURN X))) + +(DEFUN LEVEL1 (NAME DATA ADDS DELETES) + (COND ((TRACEP NAME) + (COND ((= CYCLE-COUNT* (* 10. (// CYCLE-COUNT* 10.))) + (TERPRI)) + (T (PRINC '| |))) + (OR (ATOM NAME) (SETQ NAME '|(anon)|)) + (PRINC CYCLE-COUNT*) + (PRINC '|. |) + (PRINC NAME)))) + +(DEFUN LEVEL2 (P DATA ADDS DELS) + (PROG (X POS LEN) + (OR (TRACEP P) (RETURN NIL)) + (TERPRI) + (OR (ATOM P) (SETQ P '|(anon)|)) + (PRINC P) + (SETQ POS 99.) + L2 (COND ((NOT DATA) (GO L3))) + (SETQ X (CAR DATA)) + (SETQ DATA (CDR DATA)) + (SETQ LEN (FLATC X)) + (SETQ POS (+ 1. LEN POS)) + (COND ((> POS 77.) + (TERPRI) + (PRINC '| |) + (SETQ POS (+ 2. LEN)))) + (PRINC '| |) + (PRINC X) + (GO L2) + L3 (TERPRI) + (PRINC '| -->|) + (SETQ POS 99.) + L4 (COND ((NOT ADDS) (GO L5))) + (SETQ X (CAR ADDS)) + (SETQ ADDS (CDR ADDS)) + (SETQ LEN (FLATC X)) + (SETQ POS (+ 1. LEN POS)) + (COND ((> POS 77.) + (TERPRI) + (PRINC '| |) + (SETQ POS (+ 3. LEN)))) + (PRINC '| |) + (PRINC X) + (GO L4) + L5 (COND ((NOT DELS) (TERPRI) (TERPRI) (RETURN NIL))) + (TERPRI) + (PRINC '| Deleted:|) + (SETQ POS 99.) + L6 (COND ((NOT DELS) (TERPRI) (TERPRI) (RETURN NIL))) + (SETQ X (CAR DELS)) + (SETQ DELS (CDR DELS)) + (SETQ LEN (FLATC X)) + (SETQ POS (+ 1. LEN POS)) + (COND ((> POS 77.) + (TERPRI) + (PRINC '| |) + (SETQ POS (+ 3. LEN)))) + (PRINC '| |) + (PRINC X) + (GO L6))) + +(DEFUN TRACEP (X) (OR (NOT TRACED-RULES*) (MEMQ X TRACED-RULES*))) + +(DEFUN TRACER FEXPR (L) (MAPC (FUNCTION TRACER*) L)) + +(DEFUN TRACER* (R) + (COND ((NOT (MEMQ R TRACED-RULES*)) + (SETQ TRACED-RULES* (CONS R TRACED-RULES*))))) + +(DEFUN UNTRACER FEXPR (L) + (COND ((ATOM L) (SETQ TRACED-RULES* NIL)) + (T + (MAPC (FUNCTION (LAMBDA (R) + (SETQ TRACED-RULES* + (DELQ R TRACED-RULES*)))) + L)))) + +(DEFUN START-OPTIONS (|W M I|) + (COND ((> (LENGTH |W M I|) 1.) |W M I|) + ((ATOM |W M I|) |W M I|) + ((ATOM (CAR |W M I|)) (EVAL (CAR |W M I|))) + (T (CAR |W M I|)))) + +(DEFUN START FEXPR (|W M I|) + (SETQ |W M I| (START-OPTIONS |W M I|)) + (AND RUNNING* + (PRINC '|Warning: WM and the network memory may be inconsistent| + )) + (DO-START |W M I|)) + +(DEFUN DO-START (WM-LIST) + (SETQ TOTAL-TIME* 0.) + (SETQ ACTION-COUNT* 0.) + (SETQ CYCLE-COUNT* 0.) + (SETQ TOTAL-CS* 0.) + (SETQ MAX-CS* 0.) + (SETQ TOTAL-TOKEN* (SETQ MAX-TOKEN* 0.)) + (SETQ TOTAL-WM* 0.) + (SETQ MAX-WM* 0.) + (SETQ NEXT-DELETE-TIME* (IFIX (*$ 1.1 (FLOAT MAXIMUM-AGE*)))) + (SETQ DELETE-LIST* NIL) + (SETQ ADD-LIST* NIL) + (SETQ REASSERT-LIST* NIL) + (SETQ REFRESHED-WMES* NIL) + (MAPC (FUNCTION REASSERT) WM-LIST) + (MAPC (FUNCTION DENY) (WM)) + (MAIN)) + +(DEFUN CONTINUE FEXPR (|W M|) + (SETQ |W M| (START-OPTIONS |W M|)) + (AND RUNNING* + (PRINC '|Warning: WM and the network memory may be inconsistent| + )) + (COND ((NOT (WM)) (DO-START |W M|)) + (T + (SETQ ADD-LIST* (SETQ DELETE-LIST* NIL)) + (SETQ REASSERT-LIST* (SETQ REFRESHED-WMES* NIL)) + (MAPC (FUNCTION REASSERT) |W M|) + (MAIN)))) + +(DEFUN SWITCHES FEXPR (B) + (PROG (X WHAT) + TOP (AND (ATOM B) (RETURN 'SET)) + (AND (ATOM (CDR B)) (RETURN '(ODD NUMBER OF ARGUMENTS))) + (SETQ X (CAR B)) + (SETQ WHAT (CADR B)) + (SETQ B (CDDR B)) + (COND ((EQ X 'TRACE) (SETQ TRACE-FUNCTION* WHAT)) + ((EQ X 'BUILD-TRACE) (SETQ BUILD-FUNCTION* WHAT)) + ((EQ X 'RETIRE-AT) + (SETQ MAXIMUM-AGE* (SWNUMBER WHAT MAXIMUM-AGE*))) + ((EQ X 'RESTART) + (SETQ RESTART* + (SWASSOC WHAT '(ON T OFF NIL) RESTART*))) + ((EQ X 'KEEP-LHS) + (SETQ KEEP-LHS* + (SWASSOC WHAT '(ON T OFF NIL) KEEP-LHS*))) + ((EQ X 'LHS-REFRESH) + (SETQ REFRESH-LHS-FLAG* + (SWASSOC WHAT + '(ON T OFF NIL) + REFRESH-LHS-FLAG*))) + ((EQ X 'COMPILE-PRIORITY) + (SETQ ATOM-PRIORITY* + (SWASSOC WHAT + '(ORDER 0. SYMBOLS 1. LENGTH 0.) + ATOM-PRIORITY*)) + (SETQ LENGTH-PRIORITY* + (SWASSOC WHAT + '(ORDER 0. SYMBOLS 0. LENGTH 1.) + LENGTH-PRIORITY*))) + (T (PRINC (CONS X '(NOT A SWITCH))))) + (GO TOP))) + +(DEFUN SWASSOC (X LIST DEFAULT) + (PROG NIL + TOP (COND ((ATOM LIST) + (PRINC (CONS X '(NOT A VALID OPTION))) + (RETURN DEFAULT)) + ((EQUAL X (CAR LIST)) (RETURN (CADR LIST)))) + (SETQ LIST (CDDR LIST)) + (GO TOP))) + +(DEFUN SWNUMBER (N DEFAULT) + (COND ((NUMBERP N) N) + (T (PRINC (CONS N '(NOT A NUMBER))) DEFAULT))) + +(DEFUN CYCLE-COUNT NIL CYCLE-COUNT*) + +(DEFUN ACTION-COUNT NIL ACTION-COUNT*) + +;* The following function has to know the form of an instantiation +;* if the compiler changes, this function must change too + +(DEFUN RESTART-P NIL + (COND ((NOT RESTART*) NIL) + ((PRESENTP 'RESTART) NIL) + (T '((NIL RESTART))))) + + +;;; Top-level interpreter routines + +(DEFUN MAIN NIL + (PROG (START-TIME) + (SETQ RUNNING* T) + (SETQ HALT-FLAG* NIL) + (SETQ INSTANCE* NIL) + (SETQ START-TIME (TIME-GCTIME)) + DIL (SETQ PHASE* 'AUTO-DELETE) + (AUTOMATIC-DELETE) + (SETQ PHASE* 'MATCH) + (MAPC (FUNCTION REAL-DENY) DELETE-LIST*) + (AND REFRESH-LHS-FLAG* + INSTANCE* + (MAPC (FUNCTION REFRESH) (CDR INSTANCE*))) + (MAPC (FUNCTION REAL-ASSERT) ADD-LIST*) + (MAPC (FUNCTION REMOVE-FROM-WM) DELETE-LIST*) + (MAPC (FUNCTION UPDATE-RECENCY) CONFLICT-SET*) + (SETQ PHASE* 'CONFICT-RESOLUTION) + (COND (HALT-FLAG* + (TERPRI) + (PRINC '|END -- EXPLICIT HALT|) + (GO FINIS))) + (SETQ INSTANCE* (CONFLICT-RESOLUTION)) + (OR INSTANCE* (SETQ INSTANCE* (RESTART-P))) + (COND ((NOT INSTANCE*) + (TERPRI) + (PRINC '|END -- NO PRODUCTION TRUE|) + (GO FINIS))) + (SETQ PHASE* 'ACT) + (EVAL-RHS (EVAL-RHS-INIT (CAR INSTANCE*) (CDR INSTANCE*))) + (SETQ PHASE* 'TRACE) + (COND (TRACE-FUNCTION* + (FUNCALL TRACE-FUNCTION* + (CAR INSTANCE*) + (CDR INSTANCE*) + ADD-LIST* + DELETE-LIST*))) + (GO DIL) + FINIS (SETQ RUNNING* NIL) + (SETQ TOTAL-TIME* + (+ TOTAL-TIME* (- (TIME-GCTIME) START-TIME))) + (RETURN (PRINT-TIMES TOTAL-TIME*)))) + +(DEFUN PRINT-TIMES (TOTALTIME) + (PROG (MSEC CC AC) + (SETQ MSEC (//$ (FLOAT TOTALTIME) 1000.0)) + (SETQ CC (+$ (FLOAT CYCLE-COUNT*) 1.0E-20)) + (SETQ AC (+$ (FLOAT ACTION-COUNT*) 1.0E-20)) + (PM-SIZE) + (PRINTLINEC (LIST CYCLE-COUNT* + '|firings| + (LIST ACTION-COUNT* '|RHS actions|))) + (TERPRI) + (PRINTLINEC (LIST (//$ (FLOAT TOTAL-WM*) CC) + '|mean working memory size| + (LIST MAX-WM* '|maximum|))) + (TERPRI) + (PRINTLINEC (LIST (//$ (FLOAT TOTAL-CS*) CC) + '|mean conflict set size| + (LIST MAX-CS* '|maximum|))) + (TERPRI) + (PRINTLINEC (LIST (//$ (FLOAT TOTAL-TOKEN*) CC) + '|mean token memory size| + (LIST MAX-TOKEN* '|maximum|))) + (TERPRI) + (PRINTLINEC (LIST (//$ MSEC 1000.0) + '|seconds| + (LIST (//$ MSEC CC) '|msec per firing|) + (LIST (//$ MSEC AC) '|msec per action|))) + (TERPRI))) + +(DEFUN PM-SIZE NIL + (TERPRI) + (PRINTLINEC (LIST PCOUNT* + '|productions| + (LIST REAL-NODE-COUNT* + '// + VIRTUAL-NODE-COUNT* + '|nodes|) + (LIST REAL-FEATURES* '// FEATURES* '|features|))) + (TERPRI)) + +(DEFUN AUTOMATIC-DELETE NIL + (COND ((> ACTION-COUNT* NEXT-DELETE-TIME*) + (MAPWM (FUNCTION DELETE-OLDS)) + (SETQ NEXT-DELETE-TIME* + (+ ACTION-COUNT* (// MAXIMUM-AGE* 10.)))))) + + +;;; Network Interpreter + +(DEFUN MATCH (FLAG WME) + (SENDTO FLAG (LIST WME) 'LEFT (LIST FIRST-NODE*))) + +(DEFUN &BUS (OUTS) + (PROG (X) + (SETQ ALPHA-FLAG-PART* FLAG-PART*) + (SETQ ALPHA-DATA-PART* DATA-PART*) + (SETQ X (CAR ALPHA-DATA-PART*)) + (SETQ REG0* X) + (SETQ REG1* + (SETQ REG2* + (SETQ REG3* (SETQ REG4* (SETQ REG5* NIL))))) + (COND ((ATOM X) (GO LAB))) + (SETQ REG1* (CAR X)) + (SETQ X (CDR X)) + (COND ((NOT X) (GO LAB))) + (SETQ REG2* (CAR X)) + (SETQ X (CDR X)) + (COND ((NOT X) (GO LAB))) + (SETQ REG3* (CAR X)) + (SETQ X (CDR X)) + (COND ((NOT X) (GO LAB))) + (SETQ REG4* (CAR X)) + (SETQ X (CDR X)) + (COND ((NOT X) (GO LAB))) + (SETQ REG5* (CAR X)) + LAB (EVAL-NODELIST OUTS))) + +(DEFUN &ATOM (OUTS LOCATION PARM) + (AND (EQUAL PARM (GELM LOCATION ALPHA-DATA-PART*)) + (EVAL-NODELIST OUTS))) + +(DEFUN &LEN (OUTS LOCATION LENGTH) + (PROG (Z) + (SETQ Z (GELM LOCATION ALPHA-DATA-PART*)) + (COND ((ATOM Z) (RETURN NIL)) + ((= (LENGTH Z) LENGTH) (EVAL-NODELIST OUTS))))) + +(DEFUN &LEN+ (OUTS LOCATION LENGTH) + (PROG (Z) + (SETQ Z (GELM LOCATION ALPHA-DATA-PART*)) + (COND ((ATOM Z) (RETURN NIL)) + ((NOT (< (LENGTH Z) LENGTH)) (EVAL-NODELIST OUTS))))) + +(DEFUN &USER (OUTS LOCATION PRED% ARGUMENTS) + (AND (FUNCALL PRED% ARGUMENTS (GELM LOCATION ALPHA-DATA-PART*)) + (EVAL-NODELIST OUTS))) + +(DEFUN &VIN (OUTS LOCATION1 LOCATION2) + (COND ((DO-TEST (FIND-PREDICATE LOCATION1 LOCATION2) + (GELM LOCATION1 ALPHA-DATA-PART*) + (GELM LOCATION2 ALPHA-DATA-PART*)) + (EVAL-NODELIST OUTS)))) + +(DEFUN &P (RATING NAME) + (PROG (FP DP) + (COND (SENDTOCALL* + (SETQ FP FLAG-PART*) + (SETQ DP DATA-PART*)) + (T + (SETQ FP ALPHA-FLAG-PART*) + (SETQ DP ALPHA-DATA-PART*))) + (AND (MEMQ FP '(NIL OLD)) (REMOVECS NAME DP)) + (AND FP (INSERTCS NAME DP RATING)))) + +(DEFUN &OLD (A B) NIL) + +(DEFUN &TWO (RIGHT-OUTS LEFT-OUTS) + (PROG (FP DP) + (COND (SENDTOCALL* + (SETQ FP FLAG-PART*) + (SETQ DP DATA-PART*)) + (T + (SETQ FP ALPHA-FLAG-PART*) + (SETQ DP ALPHA-DATA-PART*))) + (SENDTO FP DP 'LEFT LEFT-OUTS) + (SENDTO FP DP 'RIGHT RIGHT-OUTS))) + +(DEFUN &MEM (RIGHT-OUTS LEFT-OUTS MEMORY-LIST) + (PROG (FP DP) + (COND (SENDTOCALL* + (SETQ FP FLAG-PART*) + (SETQ DP DATA-PART*)) + (T + (SETQ FP ALPHA-FLAG-PART*) + (SETQ DP ALPHA-DATA-PART*))) + (SENDTO FP DP 'LEFT LEFT-OUTS) + (ADD-TOKEN MEMORY-LIST FP DP NIL) + (SENDTO FP DP 'RIGHT RIGHT-OUTS))) + +(DEFUN FIND-PREDICATE (X Y) + (PROG (XV YV) + (SETQ XV (CAR (LOCVEC X))) + (SETQ YV (CAR (LOCVEC Y))) + (RETURN (COND ((EQ XV '=) (CADR (ASSOC YV VAR-FNS*))) + (T (CADDR (ASSOC XV VAR-FNS*))))))) + +(DEFUN DO-TEST (P A B) + (COND ((EQ P 'EQUAL) (EQUAL A B)) + ((EQ P 'NOT-EQUAL) (NOT (EQUAL A B))) + (T (FUNCALL P A B)))) + +(DEFUN &VNO (A B C) (&VEX A B C NIL NIL)) + +(DEFUN &VEX (RIGHT-OUTS RT-PRED LEF-PRED LOCATION1 LOCATION2) + (PROG (MEM) + (COND ((EQ SIDE* 'RIGHT) + (SETQ MEM (MEMORY-PART LEF-PRED))) + (T (SETQ MEM (MEMORY-PART RT-PRED)))) + (COND (MEM (DO&VEX RIGHT-OUTS MEM LOCATION1 LOCATION2))))) + +(DEFUN DO&VEX (RIGHT-OUTS MEMORY LOCATION1 LOCATION2) + (PROG (SIDE FLAG-PART DATA-PART MEMPART TOKPART T1 T2 T3 T4 T5 + T6 X1 X2 X3 X4 X5 X6 RMEM-ELEM LMEM-ELEM) + (SETQ SIDE SIDE*) + (SETQ FLAG-PART FLAG-PART*) + (SETQ DATA-PART DATA-PART*) + (COND ((EQ SIDE 'LEFT) + (SETQ TOKPART LOCATION1) + (SETQ MEMPART LOCATION2)) + (T (SETQ TOKPART LOCATION2) (SETQ MEMPART LOCATION1))) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T1 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X1 (GELM (CAR TOKPART) DATA-PART)) + (SETQ TOKPART (CDR TOKPART)) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T2 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X2 (GELM (CAR TOKPART) DATA-PART)) + (SETQ TOKPART (CDR TOKPART)) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T3 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X3 (GELM (CAR TOKPART) DATA-PART)) + (SETQ TOKPART (CDR TOKPART)) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T4 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X4 (GELM (CAR TOKPART) DATA-PART)) + (SETQ TOKPART (CDR TOKPART)) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T5 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X5 (GELM (CAR TOKPART) DATA-PART)) + (SETQ TOKPART (CDR TOKPART)) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T6 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X6 (GELM (CAR TOKPART) DATA-PART)) + LAB3 (COND ((EQ SIDE 'RIGHT) (GO LAB2))) + LAB1 (COND ((NOT MEMORY) (RETURN NIL))) + (SETQ RMEM-ELEM (CAR MEMORY)) + (SETQ MEMORY (CDR MEMORY)) + (SETQ MEMPART LOCATION2) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T1 X1 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LAB1))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T2 X2 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LAB1))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T3 X3 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LAB1))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T4 X4 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LAB1))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T5 X5 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LAB1))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T6 X6 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LAB1))) + SUCC1 (SENDTO FLAG-PART + (CONS (CAR RMEM-ELEM) DATA-PART) + 'RIGHT + RIGHT-OUTS) + (GO LAB1) + LAB2 (COND ((NOT MEMORY) (RETURN NIL))) + (SETQ LMEM-ELEM (CAR MEMORY)) + (SETQ MEMORY (CDR MEMORY)) + (SETQ MEMPART LOCATION1) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T1 X1 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T2 X2 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T3 X3 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T4 X4 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T5 X5 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T6 X6 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + SUCC2 (SENDTO FLAG-PART + (CONS (CAR DATA-PART) LMEM-ELEM) + 'RIGHT + RIGHT-OUTS) + (GO LAB2))) + +(DEFUN &NOT (RIGHT-OUTS RT-PRED LEF-MEM LOCATION1 LOCATION2) + (PROG (MEM) + (COND ((AND (EQ SIDE* 'RIGHT) (EQ FLAG-PART* 'OLD)) + (RETURN NIL))) + (COND ((EQ SIDE* 'RIGHT) (SETQ MEM (CAR LEF-MEM))) + (T (SETQ MEM (MEMORY-PART RT-PRED)))) + (COND ((OR MEM (EQ SIDE* 'LEFT)) + (DO&NOT RIGHT-OUTS MEM LEF-MEM LOCATION1 LOCATION2))))) + +(DEFUN DO&NOT (RIGHT-OUTS MEMORY LEF-MEM LOCATION1 LOCATION2) + (PROG (SIDE FLAG-PART DATA-PART NUMBER-DENIALS MEMPART TOKPART + T1 T2 T3 T4 T5 T6 X1 X2 X3 X4 X5 X6 RMEM-ELEM LMEM-ELEM + REST-LMEM) + (SETQ SIDE SIDE*) + (SETQ FLAG-PART FLAG-PART*) + (SETQ DATA-PART DATA-PART*) + (COND ((EQ SIDE 'LEFT) + (SETQ TOKPART LOCATION1) + (SETQ MEMPART LOCATION2)) + (T (SETQ TOKPART LOCATION2) (SETQ MEMPART LOCATION1))) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T1 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X1 (GELM (CAR TOKPART) DATA-PART)) + (SETQ TOKPART (CDR TOKPART)) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T2 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X2 (GELM (CAR TOKPART) DATA-PART)) + (SETQ TOKPART (CDR TOKPART)) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T3 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X3 (GELM (CAR TOKPART) DATA-PART)) + (SETQ TOKPART (CDR TOKPART)) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T4 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X4 (GELM (CAR TOKPART) DATA-PART)) + (SETQ TOKPART (CDR TOKPART)) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T5 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X5 (GELM (CAR TOKPART) DATA-PART)) + (SETQ TOKPART (CDR TOKPART)) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT TOKPART) (GO LAB3))) + (SETQ T6 (FIND-PREDICATE (CAR TOKPART) (CAR MEMPART))) + (SETQ X6 (GELM (CAR TOKPART) DATA-PART)) + LAB3 (COND ((EQ SIDE 'RIGHT) (GO RNEW))) + (SETQ NUMBER-DENIALS 0.) + LNEW (COND ((NOT MEMORY) (GO LBL))) + (SETQ RMEM-ELEM (CAR MEMORY)) + (SETQ MEMORY (CDR MEMORY)) + (SETQ MEMPART LOCATION2) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T1 X1 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LNEW))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T2 X2 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LNEW))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T3 X3 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LNEW))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T4 X4 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LNEW))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T5 X5 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LNEW))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC1)) + ((NOT (DO-TEST T6 X6 (GELM (CAR MEMPART) RMEM-ELEM))) + (GO LNEW))) + SUCC1 (SETQ NUMBER-DENIALS (1+ NUMBER-DENIALS)) + (GO LNEW) + LBL (ADD-TOKEN LEF-MEM FLAG-PART DATA-PART NUMBER-DENIALS) + (COND ((= NUMBER-DENIALS 0.) + (SENDTO FLAG-PART DATA-PART 'RIGHT RIGHT-OUTS))) + (RETURN NIL) + RNEW (SETQ REST-LMEM MEMORY) + LOC-LOOP (COND ((ATOM REST-LMEM) (RETURN NIL))) + (SETQ NUMBER-DENIALS (CADR REST-LMEM)) + (SETQ LMEM-ELEM (CAR REST-LMEM)) + (SETQ MEMPART LOCATION1) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T1 X1 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T2 X2 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T3 X3 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T4 X4 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T5 X5 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + (SETQ MEMPART (CDR MEMPART)) + (COND ((NOT MEMPART) (GO SUCC2)) + ((NOT (DO-TEST T6 X6 (GELM (CAR MEMPART) LMEM-ELEM))) + (GO LAB2))) + SUCC2 (COND (FLAG-PART + (SETQ NUMBER-DENIALS (1+ NUMBER-DENIALS)) + (RPLACA (CDR REST-LMEM) NUMBER-DENIALS) + (AND (= NUMBER-DENIALS 1.) + (SENDTO NIL LMEM-ELEM 'RIGHT RIGHT-OUTS))) + (T + (SETQ NUMBER-DENIALS (1- NUMBER-DENIALS)) + (RPLACA (CDR REST-LMEM) NUMBER-DENIALS) + (AND (= NUMBER-DENIALS 0.) + (SENDTO 'NEW LMEM-ELEM 'RIGHT RIGHT-OUTS)))) + LAB2 (SETQ REST-LMEM (CDDR REST-LMEM)) + (GO LOC-LOOP))) + +(DEFUN SENDTO (FLAG DATA SIDE NODELIST) + (PROG (F AL NODE) + L1 (OR NODELIST (RETURN NIL)) + (SETQ NODE (CAR NODELIST)) + (SETQ NODELIST (CDR NODELIST)) + (AND BUILD-FLAG* (NOT (MEMQ NODE BUILD-FLAG*)) (GO L1)) + (SETQ SIDE* SIDE) + (SETQ FLAG-PART* FLAG) + (SETQ DATA-PART* DATA) + (SETQ SENDTOCALL* T) + (SETQ F (CAR NODE)) + (SETQ AL (CDR NODE)) + (COND ((EQ F '&VEX) + (&VEX (CXR 2. NODE) + (CXR 3. NODE) + (CXR 4. NODE) + (CXR 5. NODE) + (CXR 0. NODE))) + ((EQ F '&MEM) (&MEM (CAR AL) (CADR AL) (CADDR AL))) + ((EQ F '&VNO) + (&VNO (CXR 2. NODE) (CXR 3. NODE) (CXR 0. NODE))) + ((EQ F '&NOT) + (&NOT (CXR 2. NODE) + (CXR 3. NODE) + (CXR 4. NODE) + (CXR 5. NODE) + (CXR 0. NODE))) + ((EQ F '&TWO) (&TWO (CAR AL) (CADR AL))) + ((EQ F '&P) (&P (CAR AL) (CADR AL))) + ((EQ F '&BUS) (&BUS (CAR AL))) + ((EQ F '&OLD) (&OLD (CAR AL) (CADR AL)))) + (GO L1))) + +(DEFUN EVAL-NODELIST (NL) + (PROG (N F AL) + LAB (COND ((NOT NL) (RETURN NIL))) + (SETQ N (CAR NL)) + (SETQ NL (CDR NL)) + (SETQ F (CAR N)) + (SETQ AL (CDR N)) + (SETQ SENDTOCALL* NIL) + (COND ((AND BUILD-FLAG* (NOT (MEMQ N BUILD-FLAG*)))) + ((EQ F '&LEN) + (&LEN (CXR 2. N) (CXR 3. N) (CXR 0. N))) + ((EQ F '&ATOM) + (&ATOM (CXR 2. N) (CXR 3. N) (CXR 0. N))) + ((EQ F '&LEN+) + (&LEN+ (CXR 2. N) (CXR 3. N) (CXR 0. N))) + ((EQ F '&MEM) (&MEM (CAR AL) (CADR AL) (CADDR AL))) + ((EQ F '&TWO) (&TWO (CAR AL) (CADR AL))) + ((EQ F '&USER) + (&USER (CAR AL) (CADR AL) (CADDR AL) (CADDDR AL))) + ((EQ F '&P) (&P (CAR AL) (CADR AL))) + ((EQ F '&VIN) + (&VIN (CXR 2. N) (CXR 3. N) (CXR 0. N))) + ((EQ F '&OLD) (&OLD (CAR AL) (CADR AL)))) + (GO LAB))) + + +;;; Conflict Resolution +; Each conflict set element is a list of the following form: +; ((p-name . data-part) (sorted wm-recency) special-case-number) + +(DEFMACRO PNAME-INSTANTIATION (CONFLICT-ELEM) `(CAR ,CONFLICT-ELEM)) + +(DEFMACRO INSTANTIATION (CONFLICT-ELEM) `(CDAR ,CONFLICT-ELEM)) + +(DEFMACRO ORDER-PART (CONFLICT-ELEM) `(CDR ,CONFLICT-ELEM)) + +(DEFUN REMOVECS (NAME DATA) + (PROG (CR-DATA INST) + (SETQ CR-DATA (CONS NAME DATA)) + (SETQ INST (ASSOC CR-DATA CONFLICT-SET*)) + (AND INST (SETQ CONFLICT-SET* (DELQ INST CONFLICT-SET*))))) + +(DEFUN INSERTCS (NAME DATA RATING) + (PROG (INSTAN) + (SETQ INSTAN + (LIST (CONS NAME DATA) + (DSORT (MAPCAR (FUNCTION CREATION-TIME) DATA)) + RATING)) + (COND ((ATOM CONFLICT-SET*) + (RETURN (SETQ CONFLICT-SET* (NCONS INSTAN)))) + (T + (RETURN (SETQ CONFLICT-SET* + (CONS INSTAN CONFLICT-SET*))))))) + +; Destructively sort X into descending order + +(DEFUN DSORT (X) + (PROG (SORTED CUR NEXT CVAL NVAL) + (AND (ATOM (CDR X)) (RETURN X)) + LOC-LOOP (SETQ SORTED T) + (SETQ CUR X) + (SETQ NEXT (CDR X)) + CHEK (SETQ CVAL (CAR CUR)) + (SETQ NVAL (CAR NEXT)) + (COND ((> NVAL CVAL) + (SETQ SORTED NIL) + (RPLACA CUR NVAL) + (RPLACA NEXT CVAL))) + (SETQ CUR NEXT) + (SETQ NEXT (CDR CUR)) + (COND ((NOT (NULL NEXT)) (GO CHEK)) + (SORTED (RETURN X)) + (T (GO LOC-LOOP))))) + +(DEFUN CONFLICT-RESOLUTION NIL + (PROG (BEST LEN) + (SETQ LEN (LENGTH CONFLICT-SET*)) + (COND ((> LEN MAX-CS*) (SETQ MAX-CS* LEN))) + (SETQ TOTAL-CS* (+ TOTAL-CS* LEN)) + (COND (CONFLICT-SET* + (SETQ BEST (BEST-OF CONFLICT-SET*)) + (SETQ CONFLICT-SET* (DELQ BEST CONFLICT-SET*)) + (RETURN (PNAME-INSTANTIATION BEST))) + (T (RETURN NIL))))) + +(DEFUN BEST-OF (SET) (BEST-OF* (CAR SET) (CDR SET))) + +(DEFUN BEST-OF* (BEST REM) + (COND ((NOT REM) BEST) + ((CONFLICT-SET-COMPARE BEST (CAR REM)) + (BEST-OF* BEST (CDR REM))) + (T (BEST-OF* (CAR REM) (CDR REM))))) + +(DEFUN REMOVE-FROM-CONFLICT-SET (NAME) + (PROG (CS ENTRY) + L1 (SETQ CS CONFLICT-SET*) + L2 (COND ((ATOM CS) (RETURN NIL))) + (SETQ ENTRY (CAR CS)) + (SETQ CS (CDR CS)) + (COND ((EQ NAME (CAAR ENTRY)) + (SETQ CONFLICT-SET* (DELQ ENTRY CONFLICT-SET*)) + (GO L1)) + (T (GO L2))))) + +; conflict-set-compare was made faster and simpler by replacing the +; two mapc's by explicit LOC-LOOPs + +(defun conflict-set-compare (x y) + (prog (x-order y-order xl yl xv yv) + (setq x-order (order-part x)) + (setq y-order (order-part y)) + (setq xl (car x-order)) + (setq yl (car y-order)) + data (cond ((and (null xl) (null yl)) (go ps)) + ((null yl) (return t)) + ((null xl) (return nil))) + (setq xv (car xl)) + (setq yv (car yl)) + (cond ((> xv yv) (return t)) + ((> yv xv) (return nil))) + (setq xl (cdr xl)) + (setq yl (cdr yl)) + (go data) + ps (setq xl (cdr x-order)) + (setq yl (cdr y-order)) + psl (cond ((null xl) (return t))) + (setq xv (car xl)) + (setq yv (car yl)) + (cond ((> xv yv) (return t)) + ((> yv xv) (return nil))) + (setq xl (cdr xl)) + (setq yl (cdr yl)) + (go psl))) + +(DEFUN UPDATE-RECENCY (ENTRY) + (PROG (DATA TIMES) + (SETQ DATA (INSTANTIATION ENTRY)) + (OR (INTERSECTQ DATA REFRESHED-WMES*) (RETURN ENTRY)) + (SETQ TIMES (DSORT (MAPCAR (FUNCTION CREATION-TIME) DATA))) + (RPLACA (ORDER-PART ENTRY) TIMES) + (RETURN ENTRY))) + +(DEFUN INTERSECTQ (SHORT LONG) + (DO ((X SHORT (CDR X))) + ((NOT X) NIL) + (AND (MEMQ (CAR X) LONG) (RETURN (CAR X))))) + + +;;; RHS interpreter + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) + (COND ((NULL L) (OPS-READ)) + (T + (TERPRI) + (TERPRI) + (PRINTLINEC '(ACTION ERROR)) + (TERPRI) + (TERPRI) + (PRINTLINEC '( SHOULD NOT HAVE ARGUMENTS)) + (TERPRI) + (PRINTLINEC L) + (TERPRI) + NIL))) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) + (TERPRI) + (COND ((NOT (ATOM L)) (PRINTLINEC (APPLY 'EVAL-LIST L)))) + NIL) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) + (COND ((NOT (ATOM L)) (PRINTLINEC (APPLY 'EVAL-LIST L)))) + NIL) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) + (MAPC (FUNCTION ASSERT) (APPLY 'EVAL-LIST L)) + NIL) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) + (MAPC (FUNCTION DENY) (APPLY 'EVAL-LIST L)) + NIL) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) + (MAPC (FUNCTION REASSERT) (APPLY 'EVAL-LIST L)) + NIL) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) (APPLY 'EVAL-LIST L) NIL) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) + (PROG (ARGS) + (SETQ ARGS (APPLY 'EVAL-LIST L)) + (MAPC (FUNCTION EXCISE-P) ARGS) + (RETURN NIL))) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) + (PROG (ARGLIST Z LEN) + (SETQ ARGLIST (APPLY 'EVAL-LIST L)) + (SETQ LEN (LENGTH ARGLIST)) + (COND ((= LEN 0.) + (TERPRI) + (TERPRI) + (PRINTLINEC '(ACTION ERROR)) + (TERPRI) + (TERPRI) + (PRINTLINEC '(NO ARGUMENT SUPPLIED TO )) + (TERPRI) + (RETURN NIL)) + ((= LEN 1.) + (BUILDIT (SETQ Z (MAKE-NEW-P-NAME)) (CAR ARGLIST)) + (RETURN (LIST Z))) + ((= LEN 2.) + (BUILDIT (CAR ARGLIST) (CADR ARGLIST)) + (COND ((CAR ARGLIST) (RETURN (LIST (CAR ARGLIST)))) + (T (RETURN NIL)))) + (T + (TERPRI) + (TERPRI) + (PRINTLINEC '(ACTION ERROR)) + (TERPRI) + (TERPRI) + (PRINTLINEC '(TOO MANY ARGUMENTS TO )) + (TERPRI) + (PRINTLINEC ARGLIST) + (TERPRI) + (RETURN NIL))))) + +(DEFUN MAKE-NEW-P-NAME NIL + (PROG (X) + LOC-LOOP (SETQ X (GENSYM)) + (INTERN X) + (COND ((GET X 'RHS) (GO LOC-LOOP))) + (RETURN X))) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) + (PROG (ARGLIST Z LEN) + (SETQ ARGLIST (APPLY 'EVAL-LIST L)) + (SETQ LEN (LENGTH ARGLIST)) + (COND ((= LEN 0.) + (TERPRI) + (TERPRI) + (PRINTLINEC '(ACTION ERROR)) + (TERPRI) + (TERPRI) + (PRINTLINEC '(NO ARGUMENT SUPPLIED TO )) + (TERPRI) + (RETURN NIL)) + ((= LEN 1.) + (COND ((SYMBOLP (CAR ARGLIST)) + (SETQ Z (GET (CAR ARGLIST) 'PRODUCTION)) + (COND (Z (RETURN (LIST Z))))) + (T + (TERPRI) + (TERPRI) + (PRINTLINEC '(ACTION ERROR)) + (TERPRI) + (TERPRI) + (PRINTLINEC '(ARGUMENT TO + + NOT + A + LITERAL + ATOM)) + (PRINC (CAR ARGLIST)) + (TERPRI) + (RETURN NIL)))) + (T + (TERPRI) + (TERPRI) + (PRINTLINEC '(ACTION ERROR)) + (TERPRI) + (TERPRI) + (PRINTLINEC '(TOO MANY ARGUMENTS TO )) + (TERPRI) + (PRINTLINEC ARGLIST) + (TERPRI) + (RETURN NIL))))) + +(DEFUN BUILDIT (NAME MATRIX) + (COMPILE-AND-UPDATE NAME (COPY MATRIX)) + (COND (BUILD-FUNCTION* (FUNCALL BUILD-FUNCTION* NAME)))) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) + (PROG (ARGUMENTS LEN) + (SETQ ARGUMENTS (APPLY 'EVAL-LIST L)) + (SETQ LEN (LENGTH ARGUMENTS)) + (COND ((= LEN 0.) + (SETQ LAST-GENBIND* (ADD1 LAST-GENBIND*))) + ((= LEN 1.) + (COND ((SYMBOLP (CAR ARGUMENTS)) + (SETQ LAST-GENBIND* (ADD1 LAST-GENBIND*)) + (SETQ VARIABLE-MEMORY* + (CONS (CONS (CAR ARGUMENTS) + LAST-GENBIND*) + VARIABLE-MEMORY*))) + (T + (TERPRI) + (TERPRI) + (PRINTLINEC '(ACTION ERROR)) + (TERPRI) + (TERPRI) + (PRINTLINEC '(OBJECT TO + BE + BOUND + NOT + A + LITERAL + ATOM)) + (PRINC (CAR ARGUMENTS)) + (TERPRI) + (RETURN NIL)))) + ((= LEN 2.) + (COND ((SYMBOLP (CAR ARGUMENTS)) + (SETQ VARIABLE-MEMORY* + (CONS (CONS (CAR ARGUMENTS) + (CADR ARGUMENTS)) + VARIABLE-MEMORY*)) + (RETURN (NCONS (CADR ARGUMENTS)))) + (T + (TERPRI) + (TERPRI) + (PRINTLINEC '(ACTION ERROR)) + (TERPRI) + (TERPRI) + (PRINTLINEC '(OBJECT TO + BE + BOUND + NOT + A + LITERAL + ATOM)) + (PRINC (CAR ARGUMENTS)) + (TERPRI) + (RETURN NIL)))) + (T + (TERPRI) + (TERPRI) + (PRINTLINEC '(ACTION ERROR)) + (TERPRI) + (TERPRI) + (PRINTLINEC '(TOO MANY ARGUMENTS TO )) + (TERPRI) + (PRINTLINEC ARGUMENTS) + (TERPRI) + (RETURN NIL))) + (RETURN (NCONS LAST-GENBIND*)))) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) L) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) (SETQ HALT-FLAG* T) L) + +(DEFPROP T RHS-FN) + +(DEFUN FEXPR (L) (APPLY 'EVAL-LIST (APPLY 'EVAL-LIST L))) + +(DEFUN EVAL-RHS (RHS) + (AND (READP) + (SETQ RHS (CONS '( (ATTEND ())) RHS))) + (MAPC (FUNCTION (LAMBDA (X) + (MAPC (FUNCTION ASSERT) (EVAL-ELEM X)))) + RHS)) + +(DEFUN EVAL-RHS-INIT (PNAME DATA) + (PROG (R) + (SETQ SEGMENT* NIL) + (SETQ CYCLE-COUNT* (1+ CYCLE-COUNT*)) + (SETQ TOTAL-TOKEN* (+ TOTAL-TOKEN* CURRENT-TOKEN*)) + (COND ((> CURRENT-TOKEN* MAX-TOKEN*) + (SETQ MAX-TOKEN* CURRENT-TOKEN*))) + (SETQ TOTAL-WM* (+ TOTAL-WM* CURRENT-WM*)) + (COND ((> CURRENT-WM* MAX-WM*) (SETQ MAX-WM* CURRENT-WM*))) + (SETQ ADD-LIST* (SETQ DELETE-LIST* NIL)) + (SETQ REASSERT-LIST* (SETQ REFRESHED-WMES* NIL)) + (SETQ VARIABLE-MEMORY* NIL) + (SETQ DATA-MATCHED* DATA) + (COND ((ATOM PNAME) + (SETQ VARIABLE-DOPE* (GET PNAME 'VARIABLE-DOPE)) + (SETQ R (GET PNAME 'RHS))) + (T + (SETQ VARIABLE-DOPE* (DOPE-PART PNAME)) + (SETQ R (RHS-PART PNAME)))) + (RETURN R))) + +(DEFUN EVAL-LIST FEXPR (ELEMS) + (MAPCAN (FUNCTION (LAMBDA (LIST-ELEM) (EVAL-ELEM LIST-ELEM))) + ELEMS)) + +(DEFUN OPS-VARIABLE-VALUE (VAR) + (PROG (BIND VB VALUE) + (SETQ FOUND-BINDING* NIL) + (SETQ BIND (ASSQ VAR VARIABLE-MEMORY*)) + (COND (BIND (SETQ FOUND-BINDING* T) (RETURN (CDR BIND)))) + (SETQ VB (ASSQ VAR VARIABLE-DOPE*)) + (COND ((NOT VB) (RETURN NIL))) + (SETQ VALUE (GELM (CDR VB) DATA-MATCHED*)) + (SETQ VARIABLE-MEMORY* + (CONS (CONS VAR VALUE) VARIABLE-MEMORY*)) + (SETQ FOUND-BINDING* T) + (RETURN VALUE))) + +(DEFUN EVAL-ELEM (ELEM) + (PROG (BINDING ELEM-VALUE SFLAG R) + (SETQ SFLAG SEGMENT*) + (SETQ SEGMENT* NIL) + (SETQ R NIL) + (COND ((EQ '! ELEM) (SETQ SEGMENT* T)) + ((NUMBERP ELEM) (SETQ R (FLATTEN ELEM SFLAG))) + ((ATOM ELEM) + (SETQ BINDING (OPS-VARIABLE-VALUE ELEM)) + (SETQ ELEM-VALUE + (COND (FOUND-BINDING* BINDING) + (T ELEM))) + (SETQ R (FLATTEN ELEM-VALUE SFLAG))) + ((AND (CONSP ELEM) + (SYMBOLP (CAR ELEM)) + (GET (CAR ELEM) 'RHS-FN)) + (SETQ ELEM-VALUE (EVAL ELEM)) + (SETQ R + (COND (SFLAG + (MAPCAN (FUNCTION (LAMBDA (SUB-ELEM) + (FLATTEN SUB-ELEM + T))) + ELEM-VALUE)) + (T (COPY1L ELEM-VALUE))))) + (T (SETQ R (FLATTEN (APPLY 'EVAL-LIST ELEM) SFLAG)))) + (RETURN R))) + +; FLATTEN was changed so that ! before an atom is ignored + +(DEFUN FLATTEN (Z FLAG) + (COND ((NOT FLAG) (NCONS Z)) + ((NOT Z) NIL) + ((CONSP Z) (COPY1L Z)) + (T (NCONS Z)))) + +(DEFUN COPY1L (X) + (COND ((ATOM X) X) + (T (CONS (CAR X) (COPY1L (CDR X)))))) + +(DEFUN RHS-FUNCTION FEXPR (L) + (MAPC (FUNCTION (LAMBDA (FNAME) (PUTPROP FNAME T 'RHS-FN))) L)) + +; PASSIVATE undoes the effect of PREDICATE and ACTIVATE +; (DEFUN PASSIVATE FEXPR (L) +; (MAPC (FUNCTION (LAMBDA (FNAME) (REMPROP FNAME 'RHS-FN) +; (REMPROP FNAME 'LHS-FN))) +; L)) + +(DEFUN OPS-READ NIL + (PROG (R) + (TERPRI) + (SETQ -LINE* NIL) + (SETQ R (OPS-READ*)) + (RETURN R))) + +(DEFUN OPS-READ* NIL + (PROG (CHAR LAST-CHAR IDENT RESULT) + (SETQ RESULT NIL) + (SETQ CHAR 0.) + (SETQ IDENT NIL) + TOP (OR -LINE* (SETQ -LINE* (OPS-READ**))) + (SETQ LAST-CHAR CHAR) + (SETQ CHAR (CAR -LINE*)) + (SETQ -LINE* (CDR -LINE*)) + (COND ((AND (= CHAR 46.) + (MEMBER LAST-CHAR + '(48. + 49. + 50. + 51. + 52. + 53. + 54. + 55. + 56. + 57.))) + (SETQ IDENT (CONS (ASCII CHAR) IDENT)) + (GO TOP)) + ((MEMBER CHAR '(32. 9. 10. 11. 12. 13.)) + (COND (IDENT + (SETQ RESULT + (CONS (READLIST (NREVERSE IDENT)) + RESULT)) + (SETQ IDENT NIL))) + (GO TOP)) + ((MEMBER CHAR + '(33. 34. 44. 46. 47. 58. 59. 63. 91. 93.)) + (COND (IDENT + (SETQ RESULT + (CONS (READLIST (NREVERSE IDENT)) + RESULT)) + (SETQ IDENT NIL))) + (SETQ RESULT (CONS (INTERN (ASCII CHAR)) RESULT)) + (GO TOP)) + ((= CHAR 40.) + (COND (IDENT + (SETQ RESULT + (CONS (READLIST (NREVERSE IDENT)) + RESULT)) + (SETQ IDENT NIL))) + (SETQ RESULT (CONS (OPS-READ*) RESULT)) + (GO TOP)) + ((MEMBER CHAR '(26. 41.)) + (COND (IDENT + (SETQ RESULT + (CONS (READLIST (NREVERSE IDENT)) + RESULT)) + (SETQ IDENT NIL))) + (RETURN (NREVERSE RESULT))) + (T (SETQ IDENT (CONS (ASCII CHAR) IDENT)) (GO TOP))))) + +(DEFUN OPS-READ** NIL + (PROG (IAL INL IC) + TOP (PRINC '*) + (AND (= (TYIPEEK) 10.) (TYI)) + (SETQ INL NIL) + L (SETQ IC (TYI)) + (SETQ INL (CONS IC INL)) + (COND ((= IC 27.) + (SETQ IAL + (MAPCAN (FUNCTION (LAMBDA (Z) + (NCONS (ASCII Z)))) + (CDR INL))) + (SETQ IAL + (READLIST (CONS '|(| + (NREVERSE (CONS '|)| IAL))))) + (AND IAL (PRINT (APPLY (CAR IAL) (CDR IAL)))) + (GO TOP)) + ((MEMBER IC '(10. 13.)) (RETURN (NREVERSE INL))) + ((MEMBER IC '(127. 8.)) + (SETQ INL (CDDR INL)) + (TYO 8.) + (PRINC '| |) + (TYO 8.)) + ((= IC 21.) (PRINC '^U) (TERPRI) (GO TOP)) + ((< IC 8.) (SETQ INL (CDR INL))) + ((AND (> IC 13.) (< IC 27.)) (SETQ INL (CDR INL)))) + (GO L))) + + +;;; Manipulating productions + +(DEFUN PR FEXPR (L) + (PROG (X) + TOP (COND ((ATOM L) (RETURN NIL))) + (TERPRI) + (PRINT (CAR L)) + (SETQ X (GET (CAR L) 'PRODUCTION)) + (COND (X (PRINT X)) + (T (PRINTLINE '(NOTHING STORED)))) + (SETQ L (CDR L)) + (GO TOP))) + +(DEFUN EXCISER FEXPR (L) (MAPC (FUNCTION EXCISE-P) L)) + +(DEFUN EDITR FEXPR (NAME-LIST) + (PROG (MATRIX NEW NAME OLD) + LBL (COND ((ATOM NAME-LIST) (RETURN NIL))) + (SETQ NAME (CAR NAME-LIST)) + (SETQ NAME-LIST (CDR NAME-LIST)) + (SETQ MATRIX (GET NAME 'PRODUCTION)) + (COND ((NOT MATRIX) + (TERPRI) + (PRINTLINE '(NO LHS STORED)) + (GO LBL))) + (SETQ OLD (COPY MATRIX)) + (SETQ NEW (EDITE MATRIX NIL NAME)) + (COND ((NOT (EQUAL-LHS NEW OLD)) + (COMPILE-AND-UPDATE NAME NEW))) + (GO LBL))) + +(DEFUN EQUAL-LHS (A B) + (COND ((NOT (EQUAL (CAR A) (CAR B))) NIL) + ((EQ (CAR A) '-->) T) + (T (EQUAL-LHS (CDR A) (CDR B))))) + + +;;; Initialize and save the system + +(DEFUN INITIALIZE-GLOBAL-VARIABLES NIL + (SETQ REAL-FEATURES* (SETQ FEATURES* 0.)) + (SETQ KEEP-LHS* NIL) + (SETQ RESTART* NIL) + (SETQ REFRESH-LHS-FLAG* NIL) + (SETQ CURRENT-TOKEN* 0.) + (SETQ CURRENT-WM* 0.) + (SETQ LAST-GENBIND* 0.) + (SETQ PCOUNT* 0.) + (SETQ CREATION-TIME* 0.) + (SETQ REAL-NODE-COUNT* 0.) + (SETQ VIRTUAL-NODE-COUNT* 0.) + (SETQ CONFLICT-SET* NIL) + (SETQ WMPART-LIST* NIL) + (SETQ RUNNING* NIL) + (SETQ TRACED-RULES* NIL) + (SETQ TRACE-FUNCTION* 'LEVEL1) + (SETQ BUILD-FLAG* NIL) + (SETQ VAR-FNS* NIL) +; (VARIABLE # NOT-EQUAL) + (VARIABLE = EQUAL) + (MAKE-BOTTOM-NODE) + (SETQ NEXT-DELETE-TIME* (SETQ MAXIMUM-AGE* 999999999.)) + (SETQ BUILD-FUNCTION* NIL) + (COMMENT |For the next entry: number given is size of array LOCVEC|) + (SETQ MAX-LOCVEC* 500.) + (SETQ NEXT-LOCVEC* 1.) + (NOUUO NIL) + (SETQ ATOM-PRIORITY* (SETQ LENGTH-PRIORITY* 0.))) + +(DEFUN SAVEIT NIL + (PROG (Z) + (SETQ Z (STATUS DATE)) + (SSTATUS FLUSH NIL) + (SSTATUS GCTIME 0.) + (SUSPEND) + (INITIALIZE-GLOBAL-VARIABLES) + (PRINC 'OPS4) + (TERPRI) + (RETURN (LIST 'CREATED (CADR Z) '- (CADDR Z) '- (CAR Z))))) + + \ No newline at end of file diff --git a/src/haunt/user.lsp b/src/haunt/user.lsp new file mode 100644 index 000000000..39e0ad1c6 --- /dev/null +++ b/src/haunt/user.lsp @@ -0,0 +1,101 @@ +; This is USER.LSP[A110PS99], a basic set of extensions to OPS4 +; provided for users who do not wish to provide their own +; extensions. It contains the necessary calls to define seven +; LHS functions, two new variable types, and five RHS functions. + +; The two new variable types are the < and > types. The < +; variable will match numeric atoms that are equal to or less +; than the atoms matching the corresponding = variable. The > +; variables will match numeric atoms that are equal to or +; greater than the atoms matching the corresponding = variable. +; In order not to slow the execution, the functions that define +; the variable types are compiled. (This file contains a +; command to read in the compiled code.) The uncompiled +; functions are: +; + (DEFUN L1ST (L G) + (AND (NUMBERP G) (NUMBERP L) (NOT (LESSP G L)))) + + (DEFUN L2ND (G L) + (AND (NUMBERP G) (NUMBERP L) (NOT (LESSP G L)))) + +; The seven new LHS functions are <<, >>, <=, >=, , +; , and . The first four of these are numeric +; functions which take exactly one argument. << matches numbers +; that are strictly smaller than its argument. >> matches +; numbers that are strictly greater than its argument. <= +; matches numbers that are equal to or smaller than its +; argument. >= matches numbers that are equal to or greater +; than its argument. The other three functions will accept more +; than one argument. will match any atom which is equal +; to one of its arguments. will match any atom except +; one which is equal to one of its arguments. will match +; any element whose type is listed in its argument. This +; function accepts for arguments one or more of ATOM, LIST, +; NUMBER, and SYMBOL. Thus ( SYMBOL) will match symbolic +; atoms only, and ( LIST NUMBER) will match anything but +; symbolic atoms. Note that can be used as a LHS quote: +; in order to get an atom like & or = in the LHS, one put it as +; an argument to . For example, the condition element +; ( =X) will match the atom =X. The definitions of these +; functions: +; + (DEFUN << (CONST ELEM) + (AND (NUMBERP ELEM) (LESSP ELEM (CAR CONST)))) + + (DEFUN >> (CONST ELEM) + (AND (NUMBERP ELEM) (GREATERP ELEM (CAR CONST)))) + + (DEFUN >= (CONST ELEM) + (AND (NUMBERP ELEM) (NOT (LESSP ELEM (CAR CONST))))) + + (DEFUN <= (CONST ELEM) + (AND (NUMBERP ELEM) (NOT (GREATERP ELEM (CAR CONST))))) + + (DEFUN (ARG ELM) (MEMBER ELM ARG)) + + (DEFUN (ARG ELM) (NOT (MEMBER ELM ARG))) + + (DEFUN (TYPES E) + (OR (AND (MEMQ 'ATOM TYPES) (ATOM E)) + (AND (MEMQ 'LIST TYPES) (NOT (ATOM E))) + (AND (MEMQ 'NUMBER TYPES) (NUMBERP E)) + (AND (MEMQ 'SYMBOL TYPES) + (ATOM E) (NOT (NUMBERP E))))) + +; The five RHS functions, <+>, <->, <*>, , and <^>, are +; arithmetic functions. <+>, <->, <*>, and take any number +; of arguments; <^> takes exactly two arguments. <+> adds its +; arguments together. <*> multiplies its arguments. <-> +; subtracts the second through last arguments (if there is more +; than one argument) from the first. divides the first +; argument by the second through last arguments. <^> raises the +; first argument to the power of the second argument. All the +; functions are capable of mixed mode arithmetic. They are +; defined as follows. +; + (DEFUN <+> FEXPR (X) + (LIST (APPLY 'PLUS (APPLY 'EVAL-LIST X)))) + + (DEFUN <-> FEXPR (X) + (LIST (APPLY 'DIFFERENCE (APPLY 'EVAL-LIST X)))) + + (DEFUN <*> FEXPR (X) + (LIST (APPLY 'TIMES (APPLY 'EVAL-LIST X)))) + + (DEFUN FEXPR (X) + (LIST (APPLY 'QUOTIENT (APPLY 'EVAL-LIST X)))) + + (DEFUN <^> FEXPR (X) + (LIST (APPLY 'EXPT (APPLY 'EVAL-LIST X)))) + + +;;; (FASLOAD USER FAS) ; Load the compiled code + +(VARIABLE < L2ND L1ST) ; Make the declarations +(VARIABLE > L1ST L2ND) + +(PREDICATE << >> <= >= ) + +(RHS-FUNCTION <+> <-> <*> <^>) + From ef1e568001ed6d695e9d42c510cb7049bef61226 Mon Sep 17 00:00:00 2001 From: Eric Swenson Date: Sat, 19 Oct 2024 09:57:31 -0700 Subject: [PATCH 2/2] Added HAUNT. --- build/haunt.tcl | 20 + build/timestamps.txt | 9 + doc/programs.md | 1 + src/haunt/comman.lsp | 9 + src/haunt/haunt.load | 20 + src/haunt/haunt.lsp | 293 +++++ src/haunt/hauntb.mps | 805 ++++++++++++ src/haunt/haunth.mps | 2802 ++++++++++++++++++++++++++++++++++++++++++ src/haunt/haunto.mps | 2136 ++++++++++++++++++++++++++++++++ src/haunt/hauntp.mps | 2026 ++++++++++++++++++++++++++++++ src/haunt/slurp.lsp | 1076 ++++++++++++++++ src/haunt/tlist.lsp | 142 +++ 12 files changed, 9339 insertions(+) create mode 100644 src/haunt/comman.lsp create mode 100644 src/haunt/haunt.load create mode 100644 src/haunt/haunt.lsp create mode 100644 src/haunt/hauntb.mps create mode 100644 src/haunt/haunth.mps create mode 100644 src/haunt/haunto.mps create mode 100644 src/haunt/hauntp.mps create mode 100644 src/haunt/slurp.lsp create mode 100644 src/haunt/tlist.lsp diff --git a/build/haunt.tcl b/build/haunt.tcl index 574438a17..41368cc75 100644 --- a/build/haunt.tcl +++ b/build/haunt.tcl @@ -15,3 +15,23 @@ respond "*" "(load '((haunt) ops4 load))" respond "T" "(dump-it)" respond ":\$Job Suspended\$" ":pdump haunt;ts ops4\r" type ":kill\r" + +# build compile haunt lisp code +respond "*" "complr\013" +respond "_" "haunt;_haunt;comman lsp\r" +respond "_" "haunt;_haunt;haunt lsp\r" +respond "_" "haunt;_haunt;slurp lsp\r" +respond "_" "haunt;_haunt;tlist lsp\r" +respond "_" "haunt;_haunt;user lsp\r" +respond "_" "\032" +type ":kill\r" + +# dump haunt +respond "*" ":haunt;ops4\r" +respond "(CREATED" "(load '((haunt) haunt load))" +respond ":\$Job Suspended\$" ":sl sys;purqio >\r" +respond "*" ":pdump haunt;ts haunt\r" + +# make available in SYS: +respond "*" ":link sys3;ts haunt,haunt;ts haunt\r" +respond "*" ":link sys3;ts ops4,haunt;ts ops4\r" diff --git a/build/timestamps.txt b/build/timestamps.txt index b66a440be..704627bf1 100644 --- a/build/timestamps.txt +++ b/build/timestamps.txt @@ -766,8 +766,17 @@ gt40/bootvt.s09 197202050000.00 gt40/vt07.bin29 197508142300.00 gz/macn80.mid 198305031813.01 gz/mmodem.181 198511261237.46 +haunt/comman.lsp 198207011415.01 +haunt/haunt.load 202410171505.00 +haunt/haunt.lsp 198207011415.01 +haunt/hauntb.mps 198207011415.01 +haunt/haunth.mps 198207011415.01 +haunt/haunto.mps 198207011415.01 +haunt/hauntp.mps 198207011415.01 haunt/ops4.load 202410180740.00 haunt/ops4.lsp 198207011415.01 +haunt/slurp.lsp 198207011415.01 +haunt/tlist.lsp 198207011415.01 haunt/user.lsp 198207011415.01 humor/alices.pdp10 198505161952.01 humor/dover.poem 198106262242.08 diff --git a/doc/programs.md b/doc/programs.md index fca0cf9e6..90fbe94be 100644 --- a/doc/programs.md +++ b/doc/programs.md @@ -141,6 +141,7 @@ - GUNNER, gun down jobs. - GMSGS, copy system messages to mail file. - H3MAKE, a job that requests DRAGON to build host table. +- HAUNT, a text-based adventure game written by John Laird in OPS4. - HEXIFY, convert COM file into Intel HEX format. - HOST, display information about a network host. - HOSTAB, display HOSTS2 format host table. diff --git a/src/haunt/comman.lsp b/src/haunt/comman.lsp new file mode 100644 index 000000000..ae05fbaf5 --- /dev/null +++ b/src/haunt/comman.lsp @@ -0,0 +1,9 @@ +(SWITCHES TRACE NIL + KEEP-LHS OFF) + +(SLURP USER LSP) + +(PREDICATE ) + +(RHS-FUNCTION + ) diff --git a/src/haunt/haunt.load b/src/haunt/haunt.load new file mode 100644 index 000000000..f036b44d7 --- /dev/null +++ b/src/haunt/haunt.load @@ -0,0 +1,20 @@ +(alloc ''(list (70000 76000 nil) fixnum (15000 22000 .1))) +(linel t 79) +(defun gco (x) nil) +(setq gc-overflow 'gco) +(load '((lisp) format fasl)) +(load '((haunt) slurp fasl)) +(load '((haunt) comman fasl)) +(load '((haunt) tlist fasl)) +(load '((haunt) haunt fasl)) +;(lslurp comman lsp) +;(lslurp tlist lsp) +;(lslurp haunt lsp) +(lslurp hauntp mps) +(lslurp haunth mps) +(lslurp haunto mps) +(lslurp hauntb mps) +(alloc ''(list (40000))) +(sstatus flush nil) +(begin) + diff --git a/src/haunt/haunt.lsp b/src/haunt/haunt.lsp new file mode 100644 index 000000000..9f795e4bb --- /dev/null +++ b/src/haunt/haunt.lsp @@ -0,0 +1,293 @@ +; (LEFT-OUT/: MYTPLEVEL STARTER TESTPPN ) +(DECLARE (SPECIAL -LINE/# READPROMPT/# RUNNING/# BAD-INPUT-ATN WMI HAUNTSFNS OLDDAY OLDRUN NAME-ATN) + (*FEXPR TRACE-FUNCTION CONTINUE START) + (*EXPR WM RUN LOAD-TEST) + (MAPEX T) + (FIXSW T)) + +; THE FOLLOWING DISABLES INTERRUPTS +(DEFUN READP NIL NIL) + +(DEFUN (CONSTANT ELM) (AND (NUMBERP ELM) (> ELM (CAR CONSTANT)))) + +(DEFUN (CONSTANT ELM) (AND (NUMBERP ELM) (< ELM (CAR CONSTANT)))) + +;(DEFUN FEXPR (L) +; (PROG (EXTIME D1 D2 I1 time) +; (SETQ EXTIME (EXPLODEC (CAR (SETQ L (APPLY 'EVAL-LIST L))))) +; (SETQ D1 (READLIST (LIST (CAR EXTIME) (CADR EXTIME)))) +; (SETQ D2 (READLIST (LIST (CADDDR EXTIME) (CAR (CDDDDR EXTIME))))) +; (SETQ D2 (+ D2 (CADR L))) +; (SETQ I1 (// D2 60.)) +; (SETQ D2 (\ D2 60.)) +; (SETQ D1 (\ (+ D1 I1) 24.)) +; (RETURN (NCONS (READLIST (CONS '// +; (APPEND (COND ((< D1 10.) (CONS '/0 (EXPLODE D1))) +; (T (EXPLODE D1))) +; '(// /:) +; (COND ((< D2 10.) (CONS '/0 (EXPLODE D2))) +; (T (EXPLODE D2)))))))))) + +(DEFUN FEXPR (L) + (PROG (EXTIME D1 D2 I1 time *nopoint ibase) + (setq *nopoint t) + (setq ibase 10.) + (SETQ EXTIME (EXPLODEC (CAR (SETQ L (APPLY 'EVAL-LIST L))))) + (setq d1 (readlist (list (nth 0 extime) (nth 1 extime)))) + (setq d2 (readlist (list (nth 3 extime) (nth 4 extime)))) + (SETQ D2 (+ D2 (CADR L))) + (SETQ I1 (// D2 60.)) + (SETQ D2 (\ D2 60.)) + (SETQ D1 (\ (+ D1 I1) 24.)) + (setq time (format nil "~2,48d:~2,48d" d1 d2)) + (return (ncons (readlist (reverse (cdr (reverse (cdr (explode time)))))))))) + +(DEFUN FEXPR (L) (LIST (RANDOM 9.))) + +(DEFUN FEXPR (L) ( BAD-INPUT-ATN)) + +(DEFUN FEXPR (L) + (PROG NIL + L1 (QUIT) + (TERPRI) + (PRINC '|Not to be continued.|) + (TERPRI) + (GO L1))) + +;(DEFUN FEXPR (L) +; (break l)) + +(DEFUN NEWSYS SLXN + (PROG (SYSTEM-NAME STARTUP-FUNCTION) + (SETQ SYSTEM-NAME (ARG 1.)) + (COND ((= SLXN 2.) (SETQ STARTUP-FUNCTION (ARG 2.)))) + (SUSPEND) + (AND STARTUP-FUNCTION (FUNCALL STARTUP-FUNCTION)) + (RETURN 'READY))) + +(DEFUN RANDPOS (LENGTH) (RANDOM LENGTH)) + +(DEFUN MANYPRINQ FEXPR (PL) (MAPC (FUNCTION (LAMBDA (PLONE) (PRINC PLONE))) PL)) + +(DEFUN FLATN (L) + (COND ((ATOM L) L) + ((ATOM (CAR L)) (CONS (CAR L) (FLATN (CDR L)))) + (T (APPEND (FLATN (CAR L)) (FLATN (CDR L)))))) + +(DEFUN TIN (WT) + (COND ((ATOM WT) WT) + ((NUMBERP (CAR WT)) (TIN (NTH (RANDPOS (CAR WT)) (CDR WT)))) + (T (CONS (TIN (CAR WT)) (TIN (CDR WT)))))) + +(DEFUN COMPILE-TEMPLATE (TMPLT) + (PROG (TEMP) + (RETURN (COND ((EQ (TYPEP TMPLT) 'LIST) + (COND ((EQ (CAR TMPLT) '/#) + (SETQ TEMP + (MAPDEL (FUNCTION NUMBERP) + (APPLY 'APPEND + (MAPCAR (FUNCTION (LAMBDA (DTMP) + (SETQ DTMP (COMPILE-TEMPLATE DTMP)) + (COND ((EQ (TYPEP DTMP) 'LIST) + DTMP) + (T (NCONS DTMP))))) + (CDR TMPLT))))) + (CONS (LENGTH TEMP) TEMP)) + ((EQ (CAR TMPLT) '%) + (SETQ TEMP (MAPCAR (FUNCTION COMPILE-TEMPLATE) (CDR TMPLT))) + (CONS (LENGTH TEMP) TEMP)) + (T (CONS (COMPILE-TEMPLATE (CAR TMPLT)) (COMPILE-TEMPLATE (CDR TMPLT)))))) + ((NULL TMPLT) NIL) + ((BOUNDP TMPLT) (COMPILE-TEMPLATE (EVAL TMPLT))) + (T TMPLT))))) + +(DEFUN STRINGREAD NIL + (PROG (STRLIST) + (COND ((= (TYIPEEK) 13.) (TYI) (TERPRI) (RETURN NIL))) + (SETQ STRLIST (NCONS (ASCII 124.))) + LAB (COND ((= (TYIPEEK) 13.) (TYI) (TYI) (RETURN (MAKNAM (NREVERSE (CONS (ASCII 124.) STRLIST))))) + (T (SETQ STRLIST (CONS (ASCII (TYI)) STRLIST)) (GO LAB))))) + +(DEFUN ADD-PHRASE (PHLN) + (PROG (NPHS NPH) + (SETQ NPHS NIL) + (COND ((NOT (BOUNDP PHLN)) (SET PHLN '(%)))) + LAB (PRINC '|Phrase/:|) + (SETQ NPH (STRINGREAD)) + (COND (NPH (SETQ NPHS (CONS NPH NPHS)) (GO LAB)) + (T (SET PHLN (APPEND (EVAL PHLN) NPHS)))))) + +(DEFUN CHAT (ATL) (NTH (RANDPOS (LENGTH ATL)) ATL)) + +(DEFUN MAPDEL (PRED LST) + (COND ((ATOM LST) LST) + ((FUNCALL PRED (CAR LST)) (MAPDEL PRED (CDR LST))) + (T (CONS (CAR LST) (MAPDEL PRED (CDR LST)))))) + +(DEFUN CAPITALIZE (WRD) + (PROG (EWRD CHRNUM) + (SETQ CHRNUM (GETCHARN WRD 2.)) + (RETURN (COND ((AND (> CHRNUM 96.) (< CHRNUM 123.)) + (READLIST (APPEND (NCONS (ASCII 124.)) + (RPLACA (SETQ EWRD (EXPLODEC WRD)) + (ASCII (- (CHRVAL (CAR EWRD)) 32.))) + (NCONS (ASCII 124.))))) + (T WRD))))) + +(DEFUN CHRVAL (X) (GETCHARN X 1.)) + +(DEFUN MY-STRING-APPEND FEXPR (STRINGS) + (READLIST (APPEND (NCONS (ASCII 124.)) + (DELETE (ASCII 124.) + (MAPCAN (FUNCTION (LAMBDA (STR) + (EXPLODEC (COND ((OR (BOUNDP STR) + (EQ (TYPEP STR) 'LIST)) + (EVAL STR)) + (T STR))))) + STRINGS)) + (NCONS (ASCII 124.))))) + +(DEFUN FEXPR (AN) + (PROG (UNCS) + (SETQ UNCS (FLATN (TIN (EVAL (CAR AN))))) + (RETURN (NCONS (APPLY 'MY-STRING-APPEND (CONS (CAPITALIZE (CAR UNCS)) (CDR UNCS))))))) + +(DEFUN FEXPR (LN) + (MAPCAR (FUNCTION (LAMBDA (WD) + (READLIST (APPEND (NCONS (ASCII 124.)) + (MAPCAR (FUNCTION (LAMBDA (CHR) + (COND ((AND (> CHR 64.) (< CHR 91.)) + (ASCII (+ CHR 32.))) + (T (ASCII CHR))))) + (MAPCAR (FUNCTION CHRVAL) (EXPLODE WD))) + (NCONS (ASCII 124.)))))) + (APPLY 'EVAL-LIST LN))) + +(DEFUN OPS-READ** NIL + (PROG (INL IC) + (PRINC '*) + (SETQ INL NIL) + LAB (SETQ IC (TYI)) + (SETQ INL (CONS IC INL)) + (COND ;;((= IC #\return) (RETURN (NREVERSE (CONS 26. INL)))) + ((= IC 13.) ; + (RETURN (NREVERSE (CONS 26. INL)))) + ((MEMBER IC '(127. 8.)) (SETQ INL (CDDR INL)) (TYO 8.) (PRINC '| |) (TYO 8.)) + ((= IC 18.) + (SETQ INL (CDR INL)) + (tyo 8) + (tyo 8) + (princ '| |) + (tyo 8) + (tyo 8) + (terpri) + (mapc '(lambda (x) (princ (ascii x))) (reverse inl))) +; ((= IC #\ctrl-t) + ((= IC 24.) ; control-t) + (SETQ INL (CDR INL)) + (tyo 8) + (tyo 8) + (PRINc '|DAY/: |) + (DAY) + (princ '| RUN/: |) + (RUN) + (PRINC '| RD/:0 WR/:0 HAUNT 243+85P TI PC/:413102|) + (TERPRI) (PRINC '|INPUT WAIT FOR TTY14|) + (TERPRI)) + ((= ic 21.) (setq inl nil) (princ '|^U|) (terpri)) + ((< IC 27.) (SETQ INL (CDR INL))) + ((MEMBER IC '(124. 39.)) (SETQ INL (CDR INL)))) + (GO LAB))) + +(DEFUN DAY NIL + (PROG (MIN SEC CENTI-SEC) + (SETQ CENTI-SEC + (- (- OLDDAY (SETQ OLDDAY (IFIX (*$ (TIME) 100.0)))))) + (SETQ MIN (// CENTI-SEC 6000.)) + (SETQ SEC (// (\ CENTI-SEC 6000.) 100.)) + (SETQ CENTI-SEC (\ CENTI-SEC 100.)) + (COND ((= MIN 0.) (PRINC SEC) (PRINC '|.|) (PRINC CENTI-SEC)) + (T + (PRINC '/:) + (COND ((NULL (CDR (EXPLODEN MIN))) (PRINC '/0))) + (PRINC MIN) + (PRINC '/:) + (PRINC SEC))))) + +(DEFUN RUN NIL + (PROG (MICRO TEMP) + (SETQ MICRO (- (- OLDRUN (SETQ OLDRUN (RUNTIME))))) + (PRINC (// MICRO 1000000.)) + (PRINC '|.|) + (SETQ TEMP (// MICRO 10000.)) + (COND ((NULL (CDR (SETQ TEMP (EXPLODEC TEMP)))) + (SETQ TEMP (CONS '/0 TEMP)))) + (COND ((CDDR TEMP) (RPLACD (CDR TEMP) NIL))) + (MAPC 'PRINC TEMP))) + +(DEFUN BEGIN NIL + (PROG NIL + (START 'START) + (LINEL T 79.) + (SSTATUS TOPLEVEL + '(COND((EQ (STATUS XUNAME) 'ejs) + (print '*) + (print (eval (read)))) + (T ()))) + (NOINTERRUPT T) + (and (filep uread) (close uread)) + (and (filep infile) (not (eq infile tyi)) (close infile)) + (setq infile 'T) + (SUSPEND) + (NOINTERRUPT T) + (cond ((eq (status XUNAME) 'ejs) (nointerrupt nil))) + (cond ((not (eq (status XUNAME) 'ejs)) + (SETQ UNBND-VRBL 'error-exit + UNDF-FNCTN 'error-exit + FAIL-ACT 'error-exit + UNSEEN-GO-TAG 'error-exit + WRNG-TYPE-ARG 'error-exit + WRNG-NO-ARGS 'error-exit + IO-LOSSAGE 'error-exit + *RSET-TRAP 'error-exit + MACHINE-ERROR 'error-exit + GC-LOSSAGE 'error-exit + PDL-OVERFLOW 'error-exit))) + (DO X (CADDR (STATUS DAYTIME)) (1- X) (< X 0.) (RANDOM)) + (SETQ OLDDAY (IFIX (*$ (TIME) 100.0))) + (SETQ OLDRUN (RUNTIME)) + (LINEL T 79.) + (CONTINUE 'XYZZY))) + +(DEFUN XBEGIN NIL + (PROG NIL + (START 'START) + (LINEL T 79.) + (SSTATUS TOPLEVEL + '(COND((EQ (STATUS XUNAME) 'ejs) + (print '*) + (print (eval (read)))) + (T ()))) + (NOINTERRUPT T) + (cond ((eq (status XUNAME) 'ejs) (nointerrupt nil))) + (cond ((not (eq (status XUNAME) 'ejs)) + (SETQ UNBND-VRBL 'error-exit + UNDF-FNCTN 'error-exit + FAIL-ACT 'error-exit + UNSEEN-GO-TAG 'error-exit + WRNG-TYPE-ARG 'error-exit + WRNG-NO-ARGS 'error-exit + IO-LOSSAGE 'error-exit + *RSET-TRAP 'error-exit + MACHINE-ERROR 'error-exit + GC-LOSSAGE 'error-exit + GC-OVERFLOW 'error-exit + PDL-OVERFLOW 'error-exit))) + (DO X (CADDR (STATUS DAYTIME)) (1- X) (< X 0.) (RANDOM)) + (SETQ OLDDAY (IFIX (*$ (TIME) 100.0))) + (SETQ OLDRUN (RUNTIME)) + (LINEL T 79.) + (CONTINUE 'XYZZY))) + +(defun error-exit (x) ()) + diff --git a/src/haunt/hauntb.mps b/src/haunt/hauntb.mps new file mode 100644 index 000000000..9b8f8e4ed --- /dev/null +++ b/src/haunt/hauntb.mps @@ -0,0 +1,805 @@ +(SYSTEM +(BDIE & =A (PLACE ! =X) & =B (score =Y) & =C ( DIED) --> +(score (<-> =Y 20)) (PLACE dark hall) ( =A) ( =B) +( =C) ( | |) +( |Neptune appears and blows new life in your body!|) +( |You return to life but neptune doesn't want you back in his world again.|) + (elevator broke) DIED)) + +(SYSTEM +(BDIE & =A DIED & =B --> ( =A) ( =B) +HALT)) + +(SYSTEM +((orc suicide =X) & =A (time is =X) (time is =X) UNDERWATER & =B +--> ( =B) ( =A) BDIE +( |You can't stand it anymore, you are now totally crazy.|) +( |You start laughing uncontrollably, but you|) +( |lose the regulator on your wetsuit and can't get any air.|) +( |Ugh! Well at least you died happy!|))) + +(SYSTEM +(UNDERWATER ( (wears wetsuit)) --> DROWN)) + +(SYSTEM +((PLACE ocean =y =x 6) DROWN & =A --> ( =a))) + +(SYSTEM +(BDIE BDIE BDIE UNDERWATER & =A --> ( =A))) + +(SYSTEM +(BDIE BDIE BDIE (wears wetsuit) & =A --> ( =A))) + +(SYSTEM +(DROWN & =A --> ( =A) +( |The water fills your lungs, choke, cough!|) +( |Your life passes before your eyes.|) +( |Maybe next time you'll remember to get a wetsuit.|) +BDIE)) + +(SYSTEM +((PLACE bathysphere) (PLACE bathysphere) ( (WASAT bathysphere)) --> +( |You are in the airlock of a bathysphere. To the south is a|) +( |large water tight door. There are a green and red buttons near the door.|) +( |There is the elevator to the north, with its white button.|) +( | |) +( |Through a window you can see the murky depths.|))) + +(SYSTEM +((PLACE bathysphere) (wdoor closed) (water IS out) +(INPUT open door) & =A --> ( =A) ( |The door won't open.|))) + +(SYSTEM +((PLACE bathysphere) (wdoor closed) & =A UNDERWATER +(INPUT open ! =Q) & =B --> ( =A) ( =B) (wdoor opened) +( |The water tight door opens.|))) + +(SYSTEM +((PLACE bathysphere) UNDERWATER +(INPUT press red ! =X) & =A --> +( =A) ( |Nothing happens.|))) + +(SYSTEM +((PLACE bathysphere) (wdoor closed) UNDERWATER +& =A (INPUT press green ! =Y) & =B --> ( =A) ( =B) +(water IS out) ( |The water drains out, it is now dry.|))) + +(SYSTEM +((PLACE bathysphere) (wdoor closed) (water IS out) +(INPUT press green ! =Y) & =B --> +( =B) ( |Nothing happens.|))) + +(SYSTEM +((PLACE bathysphere) (wdoor closed) (water IS out) & =A +(INPUT press red ! =Y) & =B --> ( =A) ( =B) +UNDERWATER ( |Water rushes in and fills the chamber.|))) + +(SYSTEM +((PLACE bathysphere) (elevator closed) & =B +(INPUT press white ! =Y) & =A --> ( =A) ( =B) +(elevator opened) ( |The elevator door opens.|))) + +(SYSTEM +((PLACE bathysphere) & =A (elevator opened) +(GOING n) & =B --> ( =A) ( =B) +(WASAT bathysphere) (PLACE elevator))) + +(SYSTEM +((PLACE BATHSYPHERE) (INPUT ENTER ! =X) & =A --> ( =A) +(GOING N) (WENT N))) + +(SYSTEM +((PLACE bathysphere) (elevator opened) & =A +UNDERWATER & =c --> ( =C) ( =A) +( |The water rushes into the elevator.|) +( |As it fills with water, the elevator begins to shake.|) +( |Suddenly the elevator car disappears down the shaft and the|) +( |rushing water pushes you down the shaft to your death.|) +BDIE)) + +(SYSTEM +((PLACE bathysphere) & =A (wdoor opened) +(GOING S) & =B --> ( =A) ( =B) +(WASAT bathysphere) (PLACE ocean 5 3 5))) + +(SYSTEM +((PLACE bathysphere) (wdoor opened) & =A +(INPUT close ! =x) & =B --> ( =A) ( =B) +(wdoor closed) ( |The water tight door is closed.|))) + +(SYSTEM +((PLACE bathysphere) (wdoor opened) (INPUT press green ! =X) & =A --> +( =A) ( |Nothing happens.|))) + +(SYSTEM +((PLACE bathysphere) UNDERWATER (HOLDS cube) & =A --> ( =A) +( |The water dissolves the sugar cube.|))) + +(SYSTEM +((PLACE bathysphere) UNDERWATER +(HOLDS candy) & =A --> ( =A) +( |The water dissolves the candy.|))) + +(SYSTEM +((in candy bathysphere) & =A UNDERWATER +--> ( =A) ( |The water dissolves the candy.|))) + +(SYSTEM +((PLACE bathysphere) UNDERWATER +(HOLDS painting) & =A --> ( =A) +( |The water destroys the painting. It disappears.|))) + +(SYSTEM +((IN painting bathysphere) & =A UNDERWATER --> ( =A) +( |The water destroys the painting, it disappears.|))) + +(SYSTEM +((IN cube bathysphere) & =A UNDERWATER +--> ( =A) (< write> |The water dissolves the sugar cube.|))) + +(SYSTEM +((PLACE bathysphere) UNDERWATER (holds marijuana) & =A --> +( =A) +( |The water ruins the marijuana and it is lost in the water.|))) + +(SYSTEM +((in marijuana bathysphere) & =A UNDERWATER --> +( =A) ( |The incoming water destroys the marijuana.|))) + (SYSTEM +((PLACE ocean ( 1) & =C ! =REST) & =A (GOING N) & =B --> +( =A) ( =B) (PLACE OCEAN (<-> =C 1) ! =REST))) + +(SYSTEM +((PLACE ocean ( 0) & =S ! =rest) & =A (GOING s) & =B +--> ( =A) ( =B) +(PLACE ocean (<+> 1 =S) ! =rest))) + +(SYSTEM +((PLACE ocean =s ( 1) & =E =u) & =A (GOING w) & =B +--> ( =A) ( =B) +(PLACE ocean =s (<-> =E 1) =U))) + +(SYSTEM +((PLACE ocean =S ( 0) & =E =U) & =A (GOING E) & =B +--> ( =A) ( =B) +(PLACE ocean =s (<+> 1 =e) =U))) + +(SYSTEM +((PLACE ocean =S =E ( 0) & =U) & =A (GOING U) & =B +--> ( =A) ( =B) +(PLACE ocean =S =E (<+> 1 =U)))) + +(SYSTEM +((PLACE ocean =s =e ( 1) & =U) & =A (GOING D) & =B +--> ( =a) ( =B) +(PLACE ocean =S =E (<-> =U 1)))) + +(SYSTEM +((PLACE ocean 1 =E =U) (GOING n) & =A --> ( =A) +( |You'd run into a sandy wall if you go that way.|))) + +(SYSTEM +((PLACE ocean 1 =e =u) --> +( |There is an underwater sandy cliff to the north.|))) + +(SYSTEM +((PLACE ocean 1 =E 6) --> +( |There is a sandy beach that rises from the sandy cliff.|))) + +(SYSTEM +((PLACE ocean 1 =e 6) & =A +UNDERWATER & =Q +(GOING n) & =B --> ( =A) ( =B) +( =Q) (PLACE beach =E))) + +(SYSTEM +((PLACE ocean =s =e 6) ( (hiwater)) --> +(hiwater) +( |The waves are very choppy, making it difficult to see very far.|) +( |Looking overhead you see that you are still underground.|) +( |There is a rock ceiling 500 feet above.|))) + +(SYSTEM +((PLACE ocean =s =e 6) --> +( |You are on the surface.|))) + +(SYSTEM +((PLACE ocean =S =E 6) +(GOING u) & =A --> ( =A) +( |You are as high as you'll get.|))) + +(SYSTEM +((PLACE ocean 5 3 5) --> +( |You are outside the bathysphere. The door is to the north.|))) + +(SYSTEM +((PLACE ocean 5 3 5) (INPUT close ! =X) & =A --> ( =A) +( |The door can only be closed from the inside.|))) + +(SYSTEM +((PLACE ocean 5 3 5) & =A (GOING N) & =B --> +( =A) ( =B) (PLACE bathysphere))) + +(SYSTEM +((PLACE ocean ! =rest) (INPUT enter ! =X) & =A +--> ( =A) (GOING N) (WENT N))) + +(SYSTEM +((PLACE ocean ! =rest) --> ( |You are in sea water.|))) + +(SYSTEM +((PLACE ocean =S =E 1) --> +( |You are at the bottom of the ocean.|))) + +(SYSTEM +((PLACE ocean =s =e 1) (GOING d) & =A +--> ( =A) ( |You can't go through the sea floor.|))) + +(SYSTEM +((PLACE ocean =s =E 1) (INPUT dig ! =X) & =A +--> ( =A) ( |The sea bed is too hard.|))) + +(SYSTEM +((PLACE ocean 5 =e =U) --> +( |There is seaweed around here.|))) + +(SYSTEM +((PLACE ocean 6 =e =U) --> +( |The seaweed is very thick now.|))) + +(SYSTEM +((PLACE ocean 6 =e =u) +(GOING s) & =B --> ( =B) +( |The seaweed is too thick to penetrate.|))) + +(SYSTEM +((PLACE ocean =s =e =U) (HOLDS speargun) +(speargun IS loaded) & =A (INPUT shoot ! =X) & =B +--> ( =A) ( =B) (IN spear ocean =s =e 1) +(speargun IS unloaded) ( |You missed whatever you shot at.|))) + +(SYSTEM +((PLACE ocean =s 1 =U) --> +( |To the west is a wall of ice, you can't get through it.|))) + +(SYSTEM +((PLACE ocean =s 1 =U) (GOING w) & =A --> +( =A) ( |You bump into the ice wall.|))) + +(SYSTEM +((PLACE ocean =s 2 6) --> +( |There is a misty fog to the west that you can't see through.|))) + +(SYSTEM +((PLACE ocean =s 2 =U) --> ( |The water is very cold.|))) + +(SYSTEM +((PLACE ocean =s 6 =U) --> +( |There is a rock cliff to the east.|))) + +(SYSTEM +((PLACE ocean =s 6 =U)(GOING e) & =A --> ( =A) +( |Ouch, you ran into the rock wall.|))) + +(SYSTEM +((PLACE ocean 4 3 5) (Went =x) --> +( |You bumped into the bathysphere I think.|) +(INPUT back))) + +(SYSTEM +((PLACE ocean ( 4) ( 4) 6) +--> ( |You seem to be in a warm current of water.|))) + +(SYSTEM +((PLACE ocean ( 5) ( 5) 5) --> +( |The water is very warm here.|))) + +(SYSTEM +((PLACE ocean 5 6 4) --> ( |The water is hot is this area. |) +( |There is a hole in the east wall.|))) + +(SYSTEM +((PLACE ocean 5 6 4) & =A (GOING e) & =B --> ( =A) ( =B) + (PLACE hot water))) + +(SYSTEM +((HOLDS gold) (PLACE ocean ! =X) --> +(sinks))) + +(SYSTEM +((HOLDS chest) (PLACE ocean ! =X) --> +(sinks))) + +(SYSTEM +((HOLDS stereo) (PLACE ocean ! =x) --> +(sinks))) + +(SYSTEM +((HOLDS candlesticks) (PLACE ocean ! =x) --> +(sinks))) + +(SYSTEM +((holds coins) (PLACE ocean ! =X) --> (sinks))) + +(SYSTEM +((sinks) & =A (PLACE ocean =S =E 1) --> ( =A))) + +(SYSTEM +((sinks) & =A (PLACE ocean =s =E =U) & =B +--> ( =A) ( =B) (PLACE ocean =s =E 1) +( |The weight of something you're carrying has pulled you to the bottom.|))) + +(SYSTEM +((IN =x ocean ! =rest) --> (Sink or float =X))) + +(SYSTEM +((sink or float =x) & =A (IN =x ocean =S =E =U) +& =B --> ( |It sinks out of sight.|) + ( =A) ( =B) (IN =x ocean =S =E 1))) + +(SYSTEM +((sink or float =x) & =A (IN =X ocean =S =e 1) --> ( =A))) + +(SYSTEM +((sink or float stool) & =A (IN stool ocean =S =E =U) & =B +--> ( =A) ( =B) +( |The stool floats up and away.|) +(IN stool ocean =S =E 6))) + +(SYSTEM +((sink or float stool) & =A (IN stool ocean =S =E 6) --> +( =A))) + +(SYSTEM +((sink or float football) & =A (IN football ocean =S =E =U) & =B +--> ( =A) ( =B) +( |The football disappears as it floats away.|) +(IN football ocean =s =E 6))) + +(SYSTEM +((sink or float football) & =A +(IN football ocean =S =E 6) --> ( =A))) + +(SYSTEM +((sink or float bottle) & =A (IN bottle ocean =S =E +=U) & =B ( (INSIDE =z bottle)) --> ( =A) ( =B) +( |The bottle disappears as it floats away.|) +(IN bottle ocean =s =E 6))) + +(SYSTEM +((sink or float bottle) & =A ( (INSIDE =z bottle)) +(IN bottle ocean =S =E 6)--> ( =A))) + +(SYSTEM +((PLACE ocean 2 2 1) +(octopus IS alive) --> +( |There is a huge octopus huddling in the shadows.|))) + +(SYSTEM +((PLACE ocean 2 2 1) +(octopus IS alive) (INPUT get chest) (INPUT get chest) & =A +--> ( =A) +( |The octopus prevents you from getting the chest.|))) + +(SYSTEM +((PLACE ocean 2 2 1) (octopus is alive) (in cecil ocean 2 2 1) & =A +--> ( =A) ( |Cecil doesn't mess with octopus, you're going to have handle it yourself.|))) + +(SYSTEM +((PLACE ocean 2 2 1) +(octopus IS alive) & =A (IN chest ocean 2 2 1) & =B +(INPUT shoot =X) & =A --> +( =A) ( =B) ( =C) (INPUT shoot speargun) +( |The octopus emits a cloud of black ink|) +( |and disappears forever with the treasure.|))) + + +(SYSTEM +((PLACE ocean 2 2 1) +(octopus IS alive) (INPUT kill octopus) & =a --> +( =A) ( |You'd be the kind to try and wrestle an octopus.|))) + +(SYSTEM +((PLACE ocean 2 2 1) +(octopus IS alive) & =A (INPUT wrestle ! =x) & =B --> +( =A) ( =B) ( +|You grab arm 1. He gets you in a body hold. You grab arm2.|) +( |He gets you in a head hold. You tie arm1 to arm2.|) +( |With his remaining SIX arms he throws you straight up.|) +( |You clear the water and notice the fine bathing beach to|) +( |the north. But you don't give up. Down you go, deeper, deeper.|) +( |You sight him again and sneak up while he is attemping to untie his legs.|) +( |Quickly you try the Vulcan death grip. Unfortunately, there is no|) +( |Vulcan death grip, but that does not stop you.|) +( |He is about to turn on you and squeeze you to death when you|) +( |remember the overhand octopus knot, and tie up arms 3 4 5 6 7 and 8.|) +( |He appears disgruntled and swims away.|))) + + +(SYSTEM +((PLACE beach =E) ( (WASAT beach)) --> +(WASAT beach) ( +|You are on the white sands of a beautiful beach that runs east west.|) +( |To the north are unclimbable cliffs.|))) + +(SYSTEM +((PLACE beach =e) --> ( |There is cool sand beneath your feet.|))) + +(SYSTEM +((PLACE beach =e) & =A (GOING s) & =B +--> UNDERWATER ( =A) ( =B) +(PLACE ocean 1 =E 6))) + +(SYSTEM +((PLACE beach ( 1) & =E) & =A (GOING w) & =B +--> ( =a) ( =B) (PLACE beach (<-> =E 1)))) + +(SYSTEM +((PLACE beach ( 0) & =E) & =A (GOING E) & =B +--> ( =A) ( =B) (PLACE beach (<+> 1 =E)))) + +(SYSTEM +((PLACE beach 6) --> ( |You have come to a hard stone cliff.|))) + +(SYSTEM +((PLACE beach 1)--> +( |You have reach a wall of ice! Brrrr!|))) + +(SYSTEM +((PLACE beach =E) (INPUT dig ! =X) & =A --> +( =a) ( |You don't find anything under the sand.|))) + +(SYSTEM +((PLACE beach 3) --> ( +|You have come across a pool of water.|) +( |There are words saying 'unta o out' on the side.|))) + +(SYSTEM +((PLACE beach 5) (INPUT dig ! =X) & =A +( (scored conch)) --> ( =A) +(IN conch beach 5))) + +(SYSTEM +((HOLDS conch) (PLACE beach ! =X) (INPUT blow conch) & =A --> +( =A) ( +|'Toot!! Toot!!' The water near the beach begins to bubble.|) +( |A large form emerges from the foam.|) +(IN cecil beach ! =X))) + +(SYSTEM +((HOLDS conch) UNDERWATER (INPUT blow conch) & =B +--> ( =B) ( |Blaaat! You are in the ocean, and can't blow it well.|))) + +(SYSTEM +((IN cecil ! =X) (PLACE ! =X) --> +( |There is a large sea serpent here. He looks friendly|) +( |and he 'slurp!' licks your face.|))) + +(SYSTEM +((in cecil ! =x) (PLACE ! =x) (INPUT =z loch ness ! =o) & =a +--> ( =A) ( |This isn't Scotland, and that isn't Nessie.|))) + +(SYSTEM +((INPUT =z ness ! =o) & =a +--> ( =a) (INPUT =z loch ness))) + +(SYSTEM +((INPUT =z nessie ! =o) & =a --> ( =a) +(INPUT =z loch ness))) +(SYSTEM +((IN cecil ! =X) (PLACE ! =X) (INPUT Hi cecil) & =A +--> ( =A) ( |The sea serpent replys: 'Hi Beanie Boy.'|) +( |If you ever need help, you know what to say.|))) + +(SYSTEM +((INPUT Hello cecil) & =A --> ( =A) (INPUT hi cecil))) + +(SYSTEM +((INPUT pet ! =X) & =A --> ( =A) (INPUT hi cecil))) + +(SYSTEM +((IN cecil ! =x) & =A (PLACE ! =x) +(INPUT shoot ! =y) --> ( =A) +( |The sea serpent is upset and leaves.|))) + +(SYSTEM +((IN cecil ! =X) (PLACE ! =x) (INPUT kill serpent) & =A +--> ( =A) (INPUT shoot serpent))) + +(SYSTEM +((IN cecil ! =X) (PLACE ! =x) (INPUT =y serpent) & =A +--> ( =A) ( |The sea serpent should be address by its real name.|))) + +(SYSTEM +((IN cecil ! =x) (PLACE ! =X) (INPUT =y sea serpent) & =A +--> ( =A) (Input =y serpent))) + +(SYSTEM +((IN cecil ! =W) & =A (GOING =X) (GOING =x) --> ( =A))) + + +(SYSTEM +((PLACE beach =E) (INPUT build sandcastle) & =A +--> ( =A) (sandcastle beach =E) +(INPUT dig hole))) + +(SYSTEM +((PLACE beach =E) (sandcastle beach =E) +--> ( |There is an elegant sandcastle on the beach.|))) + +(SYSTEM +((INPUT make sandcastle) & =A --> ( =A) (INPUT build sandcastle))) + +(SYSTEM +((PLACE beach =E) (sandcastle beach =E) & =A +(INPUT =x sandcastle) & =B --> ( =A) ( =B) +( |The sandcastle is destroyed. There is only sand.|))) + +(SYSTEM +((INPUT =x sand castle) & =A --> ( =a) (Input =X sandcastle))) + +(SYSTEM +((INPUT =x castle) & =A --> ( =A) (INPUt =X sandcastle))) + +(SYSTEM +((INPUT Get Sand) & =A --> ( =A) +( |The sand falls through your fingers.|))) + +(SYSTEM +((PLACE beach 3) (INPUT drink ! =X) & =A +--> ( =A) ( |The water tastes cool and refreshing.|) +( |I like to drink wa wa. Um Um. goo goo poo touh goo moo.|) +( |(I think you're a little too young to continue this adventure.)|) +BDIE)) + + (SYSTEM +((PLACE beach 1) (GOING w) & =A --> ( =A) +( |You can't go there.|))) + +(SYSTEM +((PLACE beach 6) (GOING e) & =A --> ( =A) +( |You lose, the way is blocked.|))) + +(SYSTEM +((PLACE ocean ( 1) ( 1) 6) +(seamonster IS alive) --> ( |There is a angry ugly sea monster trying|) +( |to eat you.|) (seamonster IS near))) + +(SYSTEM +((seamonster IS alive) & =A (seamonster IS near) & =B (Holds speargun) +(INPUT shoot ! =x) & =D (speargun IS loaded) & =c --> +( =A) ( =B) ( =C) ( =D) (speargun IS unloaded) +(IN spear ocean 4 1 1) +( |You slay the monster.|))) + +(SYSTEM +((seamonster IS alive) (seamonster IS near) & =a +(GOING =X) & =B --> ( =A) ( =B) +( |As you try and flee, you chicken, the sea monster eats you. Yum yum.|) BDIE)) + +(SYSTEM +((INPUT =x sea monster ! =Y) & =A --> ( =A) +(Input =x seamonster))) + +(SYSTEM +((INPUT =X monster ! =Y) & =A (seamonster is near) --> +( =A) (INPUT =X seamonster ! =Y))) + +(SYSTEM +((seamonster IS alive) & =A (seamonster IS near) & =B +(IN cecil ocean ! =X) (PLACE ocean ! =x) --> +( =A) ( =B) +( |The sea serpent licks the monster to death.|))) + + +(SYSTEM +((seamonster is near) (holds =y) & =A (INPUT =q seamonster) & =B +--> ( =A) ( =B) +( |While you were wasting your time trying to| ( =q)) +( |the seamonster, he attacked! You avoided him, but he ate your|) +( ( =y) |. You better come up with another idea.|))) + +(SYSTEM +((PLACE ocean ! =x) (INPUT help cecil help) (INPUT help cecil help) +(INPUT HELP CECIL HELP) & =A --> +( =A) (IN cecil ocean ! =X))) + +(SYSTEM +((PLACE ! =X) (IN CECIL ! =X) (INPUT HELP CECIL HELP) & =A +--> ( =A) ( |Cecil is already here.|))) + + +(SYSTEM +((PLACE hot water) +--> ( |You are in a small tunnel in the rock wall.|) +( |It is very hot, but you are protected by your magic wetsuit.|) +( |It is too dark to see, so you must guess at directions.|))) + +(SYSTEM +((PLACE hot water) & =A (GOING w) & =B --> +( =A) ( =B) +(PLACE ocean 5 6 4))) + +(SYSTEM +((PLACE hot water) & =A (GOING d) & =B --> +( =A) ( =B) +(PLACE black water))) + +(SYSTEM +((PLACE black water) --> + ( |You are in water that is completely black.|))) + +(SYSTEM +((PLACE black water) & =A (GOING u) & =B --> +( =A) ( =B) (PLACE hot water))) + +(SYSTEM +((PLACE black water) & =A (GOING e) & =B --> + ( =A) ( =B) (PLACE end dead))) + +(SYSTEM +((PLACE end dead) (PLACE end dead) --> +( |The water is a little cooler here.|))) + +(SYSTEM +((PLACE end dead) & =A (GOING w) & =B --> +( =A) ( =B) +(PLACE black water))) + +(SYSTEM +((PLACE end dead) (moray eel is alive) --> +( |There is a vicious eel here. He grabs you and starts squeezing.|) +( |You have time for one last request.|) +(IN pearls end dead) +(person will die))) + +(SYSTEM +((PLACE end dead) (moray eel is alive) +(HOLDS speargun) & =A --> ( =A) +(IN speargun black water) ( |Something grabs the speargun from you and tosses it away.|))) + +(SYSTEM +((person will die) & =B (INPUT pray ! =X) & =A (PLACE end dead) --> +( =A) ( =B) +( |You are struck down by a lightening bolt.|) +BDIE)) + +(SYSTEM +((person will die) & =A (INPUT ! =X) & =B (PLACE end dead) --> + ( =A) ( =B) +( |Wrong request! BUZZZ|) +BDIE)) + +(SYSTEM +((person will die) & =A (moray eel is alive) & =B +(PLACE end dead) +(INPUT help cecil help) & =C --> ( =A) ( =B) +( =C) (IN cecil end dead) ( |'I'm coming Beanie boy!'|) +( |Cecil grabs the eel by the neck and hurls it away.|))) + +(SYSTEM +((PLACE black water) & =A (GOING w) & =B --> +( =A) ( =B) (PLACE hotter water))) + +(SYSTEM +((PLACE hotter water) --> ( |It's quite toasty here.|))) + +(SYSTEM +((PLACE hotter water) & =A (GOING e) & =B --> +( =A) ( =B) (PLACE black water))) + +(SYSTEM +((PLACE hotter water) & =A (GOING n) & =B --> +( =A) ( =B) (PLACE hot spring))) + +(SYSTEM +((PLACE hot spring) +--> ( |You are in the middle of a hot spring. |) +( |Above you is light.|))) + +(SYSTEM +((PLACE hot spring) & =A (GOING s) & =B --> +( =A) ( =B) +(PLACE hotter water))) + +(SYSTEM +((PLACE hot spring) & =A (GOING u) & =B UNDERWATER & =C --> +( =C) ( =B) ( =A) +(PLACE cave) ( |As you go up, you come out of the water and are on dry ground.|))) + +(SYSTEM +((PLACE cave) (PLACE cave) +--> ( |You are in a warm cave. There is a hot spring down below.|) +( |The PLACE is lit with luminous moss. The only way out is by|) +( |the spring. There is a rusted old diving helmet on the ground|) +( |that is immovable. Next to it is a skeleton and a note scrawled|) +( |on the wall.|) +( |Dear B___ie,|) + ( | I ran out of air and had to come here. The moss isn't|) +( |nutritious enough to survive on. I hope you can use the diamonds.|) +( |Take care of _ec_l and he will take care up you.|) +( | Diver Dan|))) + +(system +((PLACE cave) & =A (INPUT ENTER ( spring water pool)) & =B --> +( =a) ( =b) UNDERWATER (PLACE hot spring))) + +(SYSTEM +((PLACE cave) & =A (GOING D) & =B --> +( =A) ( =B) UNDERWATER +(PLACE hot spring))) + +(SYSTEM +((PLACE ocean =S =E 2) + (IN =x ocean =S =E 1) --> ( |Below you is an object.|))) + +(SYSTEM +((INPUT follow moose) & =A UNDERWATER (time is /00/:02) --> +( =A) ( |The moose is too fast for you, you get tossed around in its wake.|) (INPUT w then n then u))) + +(SYSTEM +((INPUT get seaweed) & =A UNDERWATER --> ( =A) +( |The seaweed is too strong, and you can't break off a piece.|))) + +(SYSTEM +((INPUT eat seaweed) & =A UNDERWATER --> +( =A) ( |Chomp! Blaaachk! The seaweed is terrible.|))) + +(SYSTEM +((holds chest) (score =Y) & =A ( (scored chest)) --> +( =A) (score (<+> =y 15)) (scored chest))) + +(SYSTEM +((holds diamonds) (score =Y) & =A ( (scored diamonds)) --> +( =A) (score (<+> =y 15)) (scored diamonds))) + +(SYSTEM +((holds conch) (score =Y) & =A ( (scored conch)) --> +( =A) (score (<+> =y 15)) (scored conch))) + +(SYSTEM +((holds bottle) (inside water bottle) (score =Y) & =A ( (scored youth)) --> +( =A) (score (<+> =y 15)) (scored youth))) + +(SYSTEM +((holds pearls) (score =Y) & =A ( (scored pearls)) --> +( =A) (score (<+> =y 15)) (scored pearls))) + +(SYSTEM +((holds coins) (score =Y) & =A ( (scored coins)) --> +( =A) (score (<+> =y 15)) (scored coins))) + +(SYSTEM +((INPUT swim) & =A UNDERWATER --> +( =A) ( |Just give me a direction and we will swim that way.|))) + +(SYSTEM + ((MIDNIGHT) & =A UNDERWATER --> + ( =A) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |A moose comes swimming out of the darkness, at full speed straight at you.|) + ( |He has on full scuba gear, and is really moving.|) + ( |He is right on top of you. He runs right through you and disappears.|))) + +(SYSTEM +(UNDERWATER (wears wetsuit) (INPUT take off ! =X) --> DROWN)) + +(SYSTEM +((holds soap) & =A UNDERWATER --> ( =A) +( |The soap dissolves in the water. You are left with a gem.|) +(holds gem))) + +(SYSTEM +((PLACE ! =X) (in soap ! =X) & =A UNDERWATER --> +( =A) (in gem ! =X) ( |The soap dissolves.|))) diff --git a/src/haunt/haunth.mps b/src/haunt/haunth.mps new file mode 100644 index 000000000..9971a2765 --- /dev/null +++ b/src/haunt/haunth.mps @@ -0,0 +1,2802 @@ +(SYSTEM + ((PLACE FOYER) + (PLACE FOYER) + (Time is =) + ( (WASAT FOYER)) + --> ( |You are inside the house in the inner foyer.|) + ( |There is a walk-in closet to the west, an entrance to a hall to the north.|))) + +(SYSTEM + ((PLACE FOYER) + (GOING S) + & =A (LARGE-DOOR opened) + & =B --> ( =A) + ( =B) + (LARGE-DOOR closed) + ( |Before you can get out the large door slams shut; BOOM!|) + ( |Laughter can be heard in the upper floors of the house.|))) + +(SYSTEM + ((PLACE FOYER) + (LARGE-DOOR closed) + (INPUT OPEN ! =Z) + & =A --> ( =A) + ( |The large door is locked impossible to open.|))) + +(SYSTEM + ((PLACE FOYER) + & =A (GOING N) + & =B --> ( =A) + (WASAT FOYER) + (PLACE MAIN HALL) + ( =B))) + +(SYSTEM + ((PLACE FOYER) + (LARGE-DOOR closed) + (GOING S) + & =A --> ( =A) + ( |The door is shut.|))) + +(SYSTEM + ((PLACE FOYER) + (INPUT ENTER CLOSET) + & =A --> ( =A) + (GOING W)(WENT W))) + +(SYSTEM + ((PLACE FOYER) + (INPUT ENTER HALL) + & =A --> (GOING N) (WENT N) + ( =A))) + +(SYSTEM + ((PLACE FOYER) + & =A (GOING W) + & =B --> (WASAT FOYER) + ( =A) + (PLACE CLOSET) + ( =B))) + +(SYSTEM + ((PLACE FOYER) + (LARGE-DOOR opened) + & =B (INPUT CLOSE ! =X) + & =A --> ( =A) + ( =B) + (LARGE-DOOR closed) + ( |The door closes.|))) + + +(SYSTEM + ((PLACE FOYER) + (FOYER IS VIRGIN) + & =X (time is =Y) --> ( =X) + (orc sweat ( =Y 160)) + ( |You feel a chill run down your spine, and you doubt your own sanity.|) +( | |) + ( |A booming voice proclaims:|) + ( |'YOU WON'T GET OUT BY A DOOR.'|) + ( |'... at least alive!'|) + ( | |) + ( |The house is very damp and musty.|))) + +(system +((PLACE foyer) (time is =y) (orced =z =q) & =A --> ( =A) +(orc =Z ( =y 20)) ( |A booming voice proclaims:|) +( |'You must be mad to return. If you're not, you will be soon.'|))) + +(system +((PLACE foyer) (time is =y) (orced =z =q) & =A EATIT & =b --> +( =A) ( =B))) + +(SYSTEM + ((PLACE FOYER) + (SOUND IS ON) + --> ( |Some noise is coming from the hall.|))) + +(SYSTEM + ((PLACE MAIN HALL) + & =A (GOING S) + & =B --> ( =A) + (WASAT MAIN HALL) + (PLACE FOYER) + ( =B))) + +(SYSTEM + ((PLACE MAIN HALL) + (PLACE MAIN HALL) + ( (WASAT MAIN HALL)) + --> ( |You are in the main hall.|) + ( |The foyer is south.|) + ( |The hall extends west and darkens.|) + ( |A large room is to the east.|))) + +(SYSTEM + ((PLACE MAIN HALL) + & =A (GOING W) + & =B --> ( =A) + (PLACE DARK HALL) + ( =B))) + +(SYSTEM + ((PLACE MAIN HALL) + & =A (GOING E) + & =B --> ( =A) + (WASAT MAIN HALL) + (PLACE LIBRARY) + ( =B))) + +(SYSTEM + ((PLACE MAIN HALL) + & =A (GOING U) + & =B (STAIRS ARE WHOLE) + --> ( =A) + ( =B) + (WASAT MAIN HALL) + (PLACE STAIRS) + ( =B))) + +(SYSTEM + ((PLACE MAIN HALL) + & =A (GOING N) + & =B (STAIRS ARE WHOLE) + --> ( =A) + ( =B) + (WASAT MAIN HALL) + (PLACE STAIRS) + ( =B))) + +(SYSTEM + ((PLACE MAIN HALL) + & =A (GOING N) + & =B (STAIRS ARE COLLAPSED) + --> ( =A) + (WASAT MAIN HALL) + (PLACE STAIRS DEBRIS) + ( =B))) + +(SYSTEM + ((PLACE MAIN HALL) + (SOUND IS ON) + --> ( |Weird noises are coming from above.|))) + +(SYSTEM + ((PLACE CLOSET) + & =A (GOING E) + & =B --> ( =A) + (WASAT CLOSET) + (PLACE FOYER) + ( =B))) + +(SYSTEM + ((PLACE CLOSET) + (PLACE CLOSET) + ( (WASAT CLOSET)) + --> + ( |You are in a large closet, you can see all its contents|) + ( | by the light from the foyer.|))) + + +(SYSTEM + ((PLACE DARK HALL) + ( (WASAT DARK HALL)) + --> + ( |You are in a poorly lit hall. There is a faint scent of fresh paint.|))) + +(SYSTEM + ((PLACE DARK HALL) + & =A (GOING W) + & =B --> ( =A) + ( =B) + (WASAT DARK HALL) + (PLACE SMELLY ROOM))) + +(SYSTEM + ((PLACE DARK HALL) + & =A (GOING E) + & =B --> ( =A) + ( =B) + (WASAT DARK HALL) + (PLACE MAIN HALL))) + +(SYSTEM + ((PLACE STAIRS) + ( (WASAT STAIRS)) + --> + ( |You are on the landing of the stair case.|) + ( |Stairs go up and down.|) + ( | |) + ( |The stairs are squeeky! They seem about to collapse.|))) + +(SYSTEM + ((PLACE STAIRS) + & =C (GOING U) + & =A --> ( =A) + ( =C) + (WASAT STAIRS) + (PLACE UPPER HALL))) + +(SYSTEM + ((PLACE STAIRS) + & =A (GOING D) + & =B --> ( =A) + ( =B) + (WASAT STAIRS) + (PLACE MAIN HALL))) + +(SYSTEM + ((PLACE STAIRS) +(WASAT STAIRS) + --> + ( |SQUEEK! These stairs are delicate!|))) + +(SYSTEM + ((PLACE STAIRS) + (INPUT JUMP ! =X) + & =A --> ( =A) + (BREAK STAIRS))) + +(SYSTEM +((PLACE stairs) & =a +(stairs are Whole) & =B +(break stairs) & =C +--> ( =A) ( =B) ( =C) +( |CRASH! You've collapsed the stairs.|) +(Stairs are collapsed) (PLACE stairs debris))) + +(SYSTEM + ((PLACE SMELLY ROOM) + (PLACE SMELLY ROOM) + ( (WASAT SMELLY ROOM)) + --> ( |You are in a room that smells of paint.|) + ( |There are no windows or door except the one you came through.|) + ( |The walls are wood panel.|))) + +(SYSTEM + ((PLACE SMELLY ROOM) + & =A (GOING E) + & =B --> ( =A) + ( =B) + (WASAT SMELLY ROOM) + (PLACE DARK HALL))) + +(SYSTEM + ((PLACE LIBRARY) + ( (WASAT LIBRARY)) + --> + ( |You are in the library. All the walls are lined with books.|) + ( |There is a bust of Homer within reach.|))) + +(SYSTEM + ((PLACE LIBRARY) + & =A (GOING W) + & =B --> ( =A) + ( =B) + (WASAT LIBRARY) + (PLACE MAIN HALL))) + +(SYSTEM + ((PLACE LIBRARY) + (INPUT GET BUST) + & =A --> ( =A) + ( |The bust is too heavy to carry.|))) + +(SYSTEM + ((PLACE LIBRARY) + (INPUT TURN BUST) + & =A --> ( =A) + OpenedStacks + (STACKS WERE OPEN))) + +(SYSTEM + ((PLACE LIBRARY) + (INPUT ENTER ! =X) + & =A OpenedStacks + --> ( =A) + (GOING E)(WENT E))) + +(SYSTEM + ((PLACE LIBRARY) + OpenedStacks + (wears WETSUIT) + (GOING E) + & =A --> ( =A) + ( |You can't fit into the opening.|))) + +(SYSTEM + ((PLACE LIBRARY) + OpenedStacks + (holds wetsuit) + (going e) & =A + --> ( =A) + ( |Something you're carrying is to big to fit through the door.|))) + +(SYSTEM + ((PLACE LIBRARY) & =A OpenedStacks + (GOING E) & =B --> + ( =A) + ( =B) + (WASAT LIBRARY) + (PLACE SECRET STAIRS))) + +(SYSTEM + ((PLACE LIBRARY) + (INPUT TURN BUST) + & =A OpenedStacks + & =B --> ( =A) + ( =B) + ( |The shelves close.|))) + +(SYSTEM + ((PLACE LIBRARY) + OpenedStacks + --> ( |The east wall of books is open!|))) + +(SYSTEM + ((PLACE LIBRARY) + (INPUT =X BUST) + & =A --> ( =A) + ( ( HOMER-ATN)))) + +(system +((PLACE library) +(INPUT rub bust) & =A --> ( =A) +( |That isn't very rewarding, nothing happens.|))) + +(system +((PLACE library) +(INPUT kiss bust) & =A --> ( =A) +( |That might turn on a frog, but homer is unmoved.|))) + +(SYSTEM + ((PLACE LIBRARY) + (INPUT GET BOOK) + & =X --> ( =X) + ( |You get a book but discover it has only virtual pages.|) + GOTBOOK + ( |The book disappears.|))) + +(SYSTEM + ((PLACE LIBRARY) + (INPUT GET BOOK) + & =X GOTBOOK + ( GOTBOOK2) + --> ( |The title of the book is 'Vampires I have known'|) + ( =X) + GOTBOOK2 + (HOLDS BOOK))) + +(SYSTEM + ((PLACE LIBRARY) + (INPUT GET BOOK) + (INPUT GET BOOK) + & =A GOTBOOK + GOTBOOK2 + --> ( =A) + ( |All the rest of the books are fake.|) + ( |They seem to be wood.|))) + +(SYSTEM + ((PLACE SECRET STAIRS) + ( (WASAT SECRET STAIRS)) + --> ( |You are in the head of a secret staircase.|) + ( |The stairs go down. A pole in the room goes through a hole in the ceiling.|))) + +(SYSTEM + ((PLACE SECRET STAIRS) + & =B (GOING W) + & =A OpenedStacks + --> ( =B) + (WASAT SECRET STAIRS) + (PLACE LIBRARY) + ( =A))) + +(SYSTEM + ((PLACE SECRET STAIRS) + & =B (GOING D) + & =A --> ( =A) + ( =B) + (WASAT SECRET STAIRS) + (PLACE WINE CELLAR))) + +(SYSTEM + ((PLACE SECRET STAIRS) + ( OpenedStacks) + (INPUT OPEN ! =X) + & =A --> ( =A) + ( |The stacks can't be opened from here.|))) + +(SYSTEM + ((PLACE SECRET STAIRS) + OpenedStacks + --> ( |The west wall is open.|))) + +(SYSTEM + ((PLACE SECRET STAIRS) + (GOING U) + & =A --> ( =A) + ( |That isn't a bat pole, ROBIN. You can only come down.|))) + + (SYSTEM + ((PLACE STAIRS DEBRIS) + ( (WASAT STAIRS DEBRIS)) + --> ( |You are on wreckage of the stairs.|) + ( |To the south is the main hall, north is a small opening.|))) + +(SYSTEM + ((PLACE STAIRS DEBRIS) + & =A (GOING S) + & =B --> ( =A) + ( =B) + (WASAT STAIRS DEBRIS) + (PLACE MAIN HALL))) + +(SYSTEM + ((PLACE STAIRS DEBRIS) + & =A (GOING N) + & =B --> ( =A) + ( =B) + (WASAT STAIRS DEBRIS) + (PLACE BACK HALL))) + +(SYSTEM + ((PLACE BACK HALL) + (PLACE BACK HALL) + ( (WASAT BACK HALL)) + --> + ( |This is the back hall. It connects the kitchen and|) + ( |dining room. The kitchen is east and the dining room is west.|))) + +(system +((PLACE back hall) (stairs are collapsed) --> +( |To the south is the wreckage of the stairs.|))) + +(SYSTEM + ((PLACE BACK HALL) + & =A (going E) + & =B --> (WASAT BACK HALL) + ( =A) + ( =B) + (PLACE KITCHEN))) + +(SYSTEM + ((PLACE BACK HALL) + & =A (GOING W) + & =B --> (WASAT BACK HALL) + ( =A) + ( =B) + (PLACE DINING ROOM))) + +(SYSTEM + ((PLACE BACK HALL) + & =A (STAIRS ARE COLLAPSED) (GOING S) + & =B --> (WASAT BACK HALL) + ( =A) + ( =B) + (PLACE STAIRS DEBRIS))) + +(SYSTEM + ((PLACE KITCHEN) + (PLACE KITCHEN) + ( (WASAT KITCHEN)) + --> ( |You are in a old kitchen. All the windows are|) + ( |boarded up. The only exit is west.|) + ( | |) + ( |There is a refrigerator in the corner.|) + ( |A ventilation duct is open over the refrigerator.|))) + +(SYSTEM + ((PLACE KITCHEN) + & =A (GOING W) + & =B --> ( =A) + ( =B) + (WASAT KITCHEN) + (PLACE BACK HALL))) + +(SYSTEM + ((PLACE KITCHEN) + (INPUT EXIT) + & =A --> ( =A) + (GOING W) (WENT W))) + +(SYSTEM + ((PLACE KITCHEN) + (RDOOR closed) + --> ( |The refrigirator door is closed.|))) + +(SYSTEM + ((PLACE KITCHEN) + (RDOOR opened) + --> ( |The door of the ice box is open.|))) + +(SYSTEM + ((PLACE KITCHEN) + (RDOOR closed) + & =A (INPUT OPEN ! =X) + & =B --> ( =A) + ( =B) + (RDOOR opened))) + +(SYSTEM +((PLACE kitchen) + (rdoor opened) & =A (INPUT close ! =X) & =B +--> ( =A) ( =B) (rdoor closed))) + + +(SYSTEM + ((PLACE KITCHEN) + (RDOOR opened) + (cube frig) + --> ( |There is a small white cube in the refrigirator.|))) + +(SYSTEM + ((PLACE KITCHEN) + (RDOOR opened) + (cube frig) + & =A (INPUT GET CUBE) + & =B --> ( =A) + ( =B) + ( |You have a cube.|) + (HOLDS CUBE))) + +(SYSTEM +((PLACE kitchen) (going u) & =A --> ( =A) (ontop FRIG))) + +(SYSTEM +((PLACE kitchen) (ontop FRIG) --> ( |You are ontop the refrigirator.|) +( |Going down will put you on the floor, going south will put you in the duct.|))) + +(SYSTEM +((PLACE kitchen) (INPUT mount) & =A --> ( =A) (ontop FRIG))) + +(SYSTEM +((PLACE kitchen) & =A (ontop FRIG) & =C +(GOING S) (GOING s) & =B --> ( =A) ( =B) +( =C) (wasat kitchen) (PLACE ductf2))) + +(SYSTEM + ((PLACE DINING ROOM) + (PLACE DINING ROOM) + ( (WASAT DINING ROOM)) + --> + ( |You are in a large dining room. The ceiling is very high.|) + ( |The hall is east.|))) + +(SYSTEM + ((PLACE DINING ROOM) + & =A (GOING E) + & =B --> ( =A) + ( =B) + (WASAT DINING ROOM) + (PLACE BACK HALL))) + +(SYSTEM + ((PLACE UPPER HALL) (PLACE UPPer HALL) + ( (WASAT UPPER HALL)) + --> ( |You are at the upper hall. You can see down the|) + ( |first steps of some stairs. A circular staircase|) + ( |continues up.|) + ( | |) + ( |There is a dark room to the south,|) + ( |a hall to the west, a stone wall to the east,|) + ( |and another room to the north.|))) + +(SYSTEM + ((PLACE UPPER HALL) + (STAIRS ARE COLLAPSED) + (GOING D) + & =A --> ( =A) + ( |The stairs are collapsed.|))) + +(SYSTEM + ((PLACE UPPER HALL) + & =A (STAIRS ARE WHOLE) + (GOING D) + & =B --> ( =A) + ( =B) + (WASAT UPPER HALL) + (PLACE STAIRS))) + +(SYSTEM + ((PLACE UPPER HALL) + & =A (GOING S) + & =B --> ( =A) + ( =B) + (WASAT UPPER HALL) + (PLACE DARK ROOM))) + +(SYSTEM + ((PLACE UPPER HALL) + & =A (GOING W) + & =B --> ( =A) + ( =B) + (WASAT UPPER HALL) + (PLACE LONG HALL))) + +(SYSTEM + ((PLACE UPPER HALL) + & =A (GOING N) + & =B --> ( =A) + ( =B) + (WASAT UPPER HALL) + (PLACE dull room))) + +(SYSTEM + ((PLACE UPPER HALL) + & =A (GOING E) + & =B (SECRET PANEL OPEN) + --> ( =A) + ( =B) + (WASAT UPPER HALL) + (PLACE SECRET ROOM))) + +(SYSTEM + ((PLACE UPPER HALL) + SECRET-PANEL-CLOSED & =B + (INPUT ( move pull GET) BRICK) + & =A --> ( =A) + ( =B) + ( |The brick moves, but can't be removed from the wall.|) + ( |A secret panel in the wall opens!|) + ( |There is a room ahead.|) + (SECRET PANEL OPEN))) + +(SYSTEM + ((PLACE UPPER HALL) + (INPUT CLOSE WALL) + & =A (SECRET PANEL OPEN) + & =B --> ( =A) + ( =B) + ( |The wall closes.|))) + +(SYSTEM + ((PLACE UPPER HALL) + & =A (GOING U) + & =B --> ( =A) + ( =B) + (WASAT UPPER HALL) + (PLACE LABORATORY))) + +(SYSTEM + ((PLACE UPPER HALL) + (SOUND IS ON) + --> + ( |You hear clanking and screams coming from the hall.|))) + + (SYSTEM + ((PLACE LABORATORY) + (PLACE LABORATORY) + ( (WASAT LABORATORY)) + --> + ( |You are in the Laboratory. The most notable feature is a huge |) + ( |slab in the middle of the room. There is a large |) + ( |lever switch. The stairs are the only obvious exit. The ceiling|) + ( |is a glass dome painted black, much too high to reach.|))) + +(SYSTEM + ((PLACE LABORATORY) + & =A (GOING D) + & =B --> (WASAT LABORATORY) + ( =A) + ( =B) + (PLACE UPPER HALL))) + +(SYSTEM + ((PLACE LABORATORY) + & =A (GOING W) + & =B (WALL IS DOWN) + --> ( =A) + ( =B) + (WASAT LABORATORY) + (PLACE BAR))) + +(SYSTEM + ((PLACE LABORATORY) + (WALL IS DOWN) + --> + ( |The west wall has the shape of a running figure in it.|))) + +(SYSTEM + ((PLACE LABORATORY) + (INPUT =B LEVER) + & =A --> ( =A) + (MONSTER LIVE))) + +(SYSTEM + ((PLACE LABORATORY) + (INPUT =B SWITCH) + & =A --> ( =A) + (INPUT =X lever))) + +(SYSTEM +((PLACE laboratory) +(INPUT =x lever) & =A (lever thrown) --> ( =A) +( |The lever is stuck.|))) + +(SYSTEM + ((PLACE LABORATORY) + (MONSTER LIVE) + & =A (IN MONSTER LABORATORY) + ( (LEVER THROWN)) + + --> ( =A) + ( |The lights dim. A massive door on the east wall|) + ( |opens revealing a bank of computers, generators, and misc.|) + ( |electronic gear. The generators start to scream.|) + ( |The lights dim more. Suddenly sparks start to fly from the|) + ( |equipment. The body on the table starts to jerk around.|) + ( | |) + ( |As suddenly as it started, the generators turn off, the|) + ( |wall closes. And everything returns to normal.....|) + ( |Then the body rises, removes its sheet and it is a monster.|) + ( | |) + ( |The monster approaches you and says 'Trick or Treat'|) (LEVER THROWN))) + +(SYSTEM + ((PLACE LABORATORY) + (IN MONSTER LABORATORY) + ( (LEVER THROWN)) + --> + ( |There is the shape of a body on the slab, covered with a sheet.|))) + +(SYSTEM + ((PLACE LABORATORY) + (IN MONSTER LABORATORY) + & =B (HOLDS CANDY) + & =C (LEVER THROWN) + (INPUT GIVE CANDY ! =X) + & =A --> ( =C) + ( =A) + ( =B) + ( |The monster is pleased.| + |He eats the candy, walks through the west wall|) + ( |and disappears.|) + (WALL IS DOWN))) + +(SYSTEM + ((PLACE LABORATORY) + (IN MONSTER LABORATORY) + & =A (LEVER THROWN) + (INPUT =X MONSTER) + & =Z --> ( =A) + ( =Z) + ( |The monster is frightened and holds his breath until he turns|) + ( |blue. He then disappears.|))) + +(SYSTEM + ((PLACE LABORATORY) + (LEVER THROWN) + --> + ( |The lever has been thrown, and is stuck in that position.|))) + +(SYSTEM + ((PLACE LABORATORY) + (HOLDS FOOTBALL) + & =A (INPUT KICK FOOTBALL ! =p) + & =B --> ( =A) + ( =B) + ( |The football goes crashing through the glass dome.|) + (IN FOOTBALL LAWN ISIDE 7 4) + (DOME IS BROKEN))) + +(SYSTEM + ((PLACE LABORATORY) + (HOLDS FOOTBALL) & =A + (ROPE TIED FOOTBALL) & =C + (INPUT KICK FOOTBALL ! =p) & =B --> + ( =A) + ( =B) + ( =C) + ( |Kicking the football tears the rope off of it.|) + ( |The football goes crashing through the glass dome.|) + (ROPE UNTIED) + (IN FOOTBALL LAWN ISIDE 7 4) + (DOME IS BROKEN))) + +(SYSTEM + ((PLACE LABORATORY) + (IN DRACULA LABORATORY) + & =A (DOME IS BROKEN) + --> ( =A) + ( |The bat flies through the hole in the dome and escapes.|))) + +(SYSTEM + ((PLACE LABORATORY) + (IN DRACULA LABORATORY) + --> + ( |There is a bat flying around in the dome, too high to reach.|))) + +(System +((PLACE LABORATORY) (IN DRACULA LABORATORY) (INPUT GET DRACULA) & =A --> + ( =A) + ( |I said the bat was too high to reach, even on a stool.|))) + +(SYSTEM +((PLACE LABORATORY) (IN DRACULA LABORATORY) +(INPUT GET BAT) & =A --> ( =A) +( |The bat is much too high for you to get.|))) + +(SYSTEM + ((PLACE LABORATORY) + (IN DRACULA LABORATORY) + & =A (DOME IS BROKEN) + (MORNING IS HERE) + --> ( =A) + (IN RING LABORATORY) + ( |The sun's rays cause the bat to shrivel. Something falls to the floor.|))) + +(system +((in dracula laboratory) & =A +(dome is broken) +(morning is here) --> ( =A) +(in ring laboratory))) + +(SYSTEM + ((PLACE LABORATORY) + (IN MONSTER LABORATORY) + (LEVER THROWN) + (WASAT LABORATORY) + --> + ( |The monster is drooling on himself, saying 'Trick or Treat'|))) + +(SYSTEM + ((PLACE LABORATORY) + (IN MONSTER LABORATORY) + (LEVER THROWN) + (INPUT GIVE ! =X) + & =A --> ( =A) + ( |The monster doesn't like | ( ! =X) |. |) + ( |He is getting very angry.|))) + +(SYSTEM +((PLACE LABORATORY) +(IN MONSTER LABORATORY) +(LEVER THROWN) +(INPUT GIVE MONSTER ! =X) & =A --> ( =A) (INPUT GIVE ! =X))) + +(SYSTEM +((PLACE LABORATORY) +(IN MONSTER LABORATORY) +(LEVER THROWN) +(INPUT GIVE =X TO MONSTER) & =A --> ( =A) +(INPUT GIVE =X))) + +(SYSTEM + ((PLACE LABORATORY) + (IN MONSTER LABORATORY) + (LEVER THROWN) + (INPUT THROW ! =X) + & =A --> ( =A) + (INPUT GIVE ! =X))) + +(SYSTEM + ((PLACE LABORATORY) + (DOME IS BROKEN) + (MORNING IS HERE) + --> ( |Light shows throught the hole.|))) + +(system +((PLACE laboratory) (in matches laboratory) (morning is here) --> +( |Even in the sun light the matches don't dry.|) +( |Even the laboratory is damp and musty.|))) + +(system +((PLACE laboratory) (INPUT dry matches) & =A --> +( =A) ( |The laboratory is very damp.|))) + +(SYSTEM + ((PLACE LABORATORY) + (DOME IS BROKEN) + ( (MORNING IS HERE)) + --> ( |You can see the moon through the dome.|))) + +(SYSTEM + ((PLACE LABORATORY) + (IN MONSTER LABORATORY) + & =A (HOLDS CUBE) + & =B (LEVER THROWN) + (INPUT GIVE CUBE) + & =C --> ( =A) + ( =B) + ( =C) + ( |The monster eats the cube. He then starts saying 'ohhh, ahhhh'.|) + ( |'Out of sight man.' Then he jumps straight up through the dome.|) + (DOME IS BROKEN))) + +(SYSTEM + ((PLACE BAR) + (PLACE BAR) + ( (WASAT BAR)) + --> + ( |You are in a bar. There isn't any booze.|))) + +(SYSTEM + ((PLACE BAR) + & =A (GOING E) + & =B --> ( =A) + ( =B) + (WASAT BAR) + (PLACE LABORATORY))) + +(SYSTEM + ((PLACE WINE RACKS ! =X) + --> + ( |You are in rows of wine racks that stretch out of sight in all directions.|))) + +(SYSTEM +((PLACE wine racks (e ! =e) (n ! =n)) & =A +(going e) & =B --> +( =A) ( =B) (PLACE wine racks (e e ! =e) (n ! =n)))) + +(SYSTEM +((PLACE wine racks (e ! =E) (n ! =N)) & =A (going n) & =B --> + ( =A) ( =B) (PLACE wine racks (e ! =E) (N N ! =N)))) + +(SYSTEM +((PLACE wine racks (e e ! =e) =n) & =A (going w) & =B --> + ( =A) ( =B) (PLACE wine racks (e ! =E) =N)) ) + +(SYSTEM +((PLACE wine racks =E (N N ! =N)) & =A (going s) & =b --> + ( =A) ( =B) (PLACE wine racks =E (N ! =N)))) + +(SYSTEM +((PLACE wine racks (e) (n)) ( (wasat winec)) --> +(wasat winec) ( |You've lost track of where you came from.|))) + +(SYSTEM +((PLACE wine racks (e) (n)) (wast winec) --> +( |Retracing your steps doesn't help in here.|))) + +(SYSTEM +((PLACE wine racks (e e e e) (n n n n)) --> + ( |There is a trap door on the floor, stuck open.|) + ( |Written on it is 'Only way out, Cantor'|))) + +(SYSTEM +((PLACE wine racks (e e e e) (n n n n)) & =A (going d) & =b --> + ( =A) ( =B) (Place cheese room))) + +(SYSTEM + ((PLACE WINE RACKS ! =X) + (INPUT GET WINE) + & =A --> ( =A) + ( |Have't you noticed? There isn't any wine in the racks.|))) + +(SYSTEM +((PLACE wine racks ! =x) (Input DOVETAIL) & =A --> ( =A) +( |Good idea, go with that thought!|))) + +(SYSTEM +((PLACE wine racks =E (n n n n n n n n n n n)) ( NORTHPOLE) --> +NORTHPOLE +( |Heh, where are you going, the north pole?|))) + +(SYSTEM +((PLACE wine racks =E (n n n n n n n n n n n n)) ( FOREVER) --> +FOREVER +( |You know, it is possible this thing goes on forever.|))) + +(SYSTEM +((PLACE wine racks (e e e e e e e e e e e e e) =n) --> +( |Look, the wine racks are infinitely long, think up a smart way to search!|))) + +(SYSTEM +((PLACE wine racks (e e) (n n)) --> ( |Scrawled on a rack is 'Cantor was here'.|))) + +(SYSTEM +((PLACE wine racks =N =E) (INPUT climb ! =X) & =A --> +( =A) ( |You can't climb the wine racks.|))) + +(SYSTEM +((INPUT push ! =X) & =A (PLACE wine racks ! =Y) --> +( =A) ( |The wine racks don't move.|))) + +(SYSTEM + ((PLACE CHEESE ROOM) + (PLACE CHEESE ROOM) + ( (WASAT CHEESE ROOM)) + --> + ( |This is the cheese room. The only opening is a trap door|) + ( |above, too high to reach. The walls are made of cheese.|))) + +(SYSTEM + ((PLACE CHEESE ROOM) + & =A (WALLS ARE EATEN) + (GOING W) + & =B --> ( =A) + ( =B) + (WASAT CHEESE ROOM) + (PLACE TORTURE CHAMBER))) + +(SYSTEM + ((PLACE CHEESE ROOM) + (WALLS ARE EATEN) + --> + ( |There is a hole in the west wall, with teeth marks around the edges.|))) + +(SYSTEM + ((PLACE CHEESE ROOM) + ( (WALLS ARE EATEN)) + (INPUT EAT WALL ! =o) + & =A --> ( =A) + ( |I really prefer my cheese in smaller pieces,|) +( |but we can give it a try. CHOMP CHOMP..|) + (WALLS ARE EATEN))) + +(SYSTEM + ((PLACE CHEESE ROOM) + ( (WALLS ARE EATEN)) + (INPUT EAT WEST WALL ! =o) + & =A --> ( =A) + ( |It would be nice to have some wine,|) +( |but sometimes you have to rough it. CHOMP! CHOMP!|) + (WALLS ARE EATEN))) + +(SYSTEM + ((PLACE CHEESE ROOM) + ( (WALLS ARE EATEN)) + (INPUT EAT WALLS ! =o) + & =A --> ( =A) + ( |I really liked the west one.|) + (WALLS ARE EATEN))) + +(SYSTEM + ((PLACE CHEESE ROOM) + (IN GHOST CHEESE ROOM) + (INPUT ! =X) + & =A --> ( =A) + ( ( GHOST-ATN) ( ! =X)))) + +(SYSTEM + ((PLACE CHEESE ROOM) + (IN GHOST CHEESE ROOM) + (INPUT ( QUIT STOP)) + & =A --> ( =A) + ( |You shouldn't give up so easily.|) + ( |I think the ghost was really scared of you.|) HALT)) + +(SYSTEM + ((PLACE CHEESE ROOM) + (IN GHOST CHEESE ROOM) + --> ( |There is a ghost in the room.|) + ( |Its nose is pink, I believe it has been drinking too much.|))) + +(SYSTEM + ((PLACE CHEESE ROOM) + (IN GHOST CHEESE ROOM) + & =A (INPUT BOO ! =X) + & =Y --> ( =A) + ( =Y) + ( |The ghost is scared to death and disappears.|))) + +(SYSTEM +((PLACE CHEESE ROOM) (IN GHOST CHEESE ROOM) +(INPUT say boo ! =x) & =A --> ( =A) (Input boo) ( |BOO!|))) + +(SYSTEM + ((PLACE CHEESE ROOM) + (IN GHOST CHEESE ROOM) + (INPUT =X GHOST ! =Y) + & =A --> ( =A) + ( ( GHOST-ATN) ( =X) |it.|))) + +(SYSTEM + ((PLACE CHEESE ROOM) + (IN GHOST CHEESE ROOM) + (INPUT SCARE GHOST) + & =Y --> ( =Y) + ( |What do you say to scare a Ghost?|))) + +(SYSTEM + ((PLACE TORTURE CHAMBER) + (PLACE TORTURE CHAMBER) + --> ( |You are in the torture chamber.|) + ( |A steel door slammed shut when you entered.|) + ( |There are no other doors or windows.|))) + +(SYSTEM + ((PLACE TORTURE CHAMBER) + DAMSEL-TIED-UP + (likes ! =X) + --> ( |There is a good looking| ( ! =X) |entrapped.|))) + +(system +((PLACE TORTURE CHAMBER) + DAMSEL-FREE + (LIKES ! =X) +--> ( |There is a sexy looking| ( ! =x) |in here with you.|))) + +(SYSTEM + ((PLACE TORTURE CHAMBER) + (LIKES ! =Y) + DAMSEL-TIED-UP & =A + (INPUT ( RESCUE UNTIE SAVE FREE RELEASE) ! =P) & =C --> + ( =A) + ( =C) + DAMSEL-FREE + (IN ROPE TORTURE CHAMBER) + ( |The| ( ! =Y) |is free, and gives you a kiss.|))) + +(SYSTEM +((PLACE TORTURE CHAMBER) + (INPUT RELEASE ! =Y) & =A --> + ( =A) + ( |I don't see an entrapped| ( ! =Y) |around here.|))) + +(SYSTEM + ((PLACE TORTURE CHAMBER) + (LIKES ! =X) + DAMSEL-TIED-UP & =A + (INPUT FUCK ! =O) & =B --> + ( =A) + ( =B) + ( YOU BRUTE! |That was a big mistake.|) + ( |The| ( ! =X) |is not as defenseless as you think,|) + ( |and suddenly you're missing your genitalia, and your life.|) + DIE)) + +(SYSTEM + ((PLACE TORTURE CHAMBER) + (LIKES ! =Y) + DAMSEL-FREE + (INPUT GET ! =Y) + & =A --> ( =A) + ( |You can't get the| ( ! =Y) | But you get a wink when you try.|))) + +(SYSTEM + ((PLACE TORTURE CHAMBER) + (LIKES ! =Y) + DAMSEL-TIED-UP + (INPUT GET ! =Y) & =A --> + ( =A) + ( |The| ( ! =Y) |is all tied up right now.|))) + +(SYSTEM +((PLACE torture chamber) + (LIKES ! =X) + DAMSEL-FREE + (INPUT give cube ! =Z) & =A + (HOLDS CUBE) & =b +--> ( =A) ( =B) +( |The| ( ! =X) |has a great trip.|) +( |You wish you had eaten the cube.|) +( |The| ( ! =X) |starts taking off your clothes.|))) + + +(SYSTEM + ((PLACE TORTURE CHAMBER) + (INPUT FUCK ! =z) & =B + (TIME IS =TIME) + DAMSEL-FREE & =A + (LIKES ! =X) --> + ( =A) + ( =B) + ( |The| ( ! =X) |likes you. You make love, talk a little,|) + ( |smoke a cigarette, take a nap, make love, talk,|) + ( |make love, take a nap, make love, etc.|) + ( | |) + ( |You get a gift and then you make love, talk, etc.|) + ( | |) + ( |Finally the| ( ! =X) |tells you good bye and turns to smoke and|) + ( |disappears through the cold air return duct, overhead.|) + (IN MATCHES TORTURE CHAMBER) + (CANCERTIME IS ( =TIME 480)) + (HOLDS FOOTBALL))) + + +(SYSTEM + ((PLACE TORTURE CHAMBER) + (INPUT FOLLOW ! =X) + & =A --> ( =A) + (GOING U) (WENT U))) + +(SYSTEM + ((PLACE TORTURE CHAMBER) + (WEARS WETSUIT) + (LIKES ! =X) + (TIME IS =TIME) + DAMSEL-FREE + (INPUT FUCK ! =Y) & =A --> ( =A) + ( |The| ( ! =X) |laughs at your approaches.|) + ( |You are confused until you realize you still have on your|) + ( |wetsuit. HINT: TAKE IT OFF!!!|))) + +(SYSTEM + ((PLACE TORTURE CHAMBER) + DAMSEL-FREE + (INPUT KISS ! =X) & =A ( (scored damsel)) --> + ( =A) + (scored damsel) + ( |You score! Go for it!|))) + +(SYSTEM + ((PLACE TORTURE CHAMBER) + DAMSEL-TIED-UP + (INPUT KISS ! =X) & =A --> + ( =A) + ( |Your friend isn't very interested.|))) + +(SYSTEM +((SCORED DAMSEL) + (INPUT kiss ! =X) & =A + DAMSEL-FREE --> ( =a) + ( |You scored once trying this, but it looks like |) + ( |some more intimate action (MIA) would be effective.|))) + +(SYSTEM +((PLACE TORTURE CHAMBER) + DAMSEL-FREE + (INPUT MIA) & =A --> + ( =A) ( |Could you be a little more explicit?|))) + +(SYSTEM +((PLACE TORTURE CHAMBER) +DAMSEL-FREE +(INPUT GIVE ( MASSAGE BACKRUB HEAD)) & =A +--> ( =A) +( |'Ummmmm, I like that very much'|) +( |'Why don't we try something you'll like too.'|))) + +(SYSTEM +((PLACE TORTURE CHAMBER) +DAMSEL-TIED-UP +(INPUT GIVE ( MASSAGE BACKRUB HEAD)) & =A +--> ( =A) +( |I think your friend would like to be untied first.|))) + +(SYSTEM + ((PLACE TORTURE CHAMBER) + (INPUT TORTURE ! =X) & =A --> + ( =a) + ( |You're a nasty one. I won't put up with any S & M, bye!|) + HALT)) + (SYSTEM + ((PLACE DARK ROOM) + (Place dark room) + ( (WASAT DARK ROOM)) + --> + ( |You have entered a room without lights. From the hall|) + ( |light you can see that there are no windows.|) + ( | |) + ( |In the middle of the room is a large casket.|) + ( |The only exit is north, to the hall.|))) + +(SYSTEM + ((PLACE DARK ROOM) + & =A (GOING N) + & =B --> ( =A) + ( =B) + (WASAT DARK ROOM) + (PLACE UPPER HALL))) + +(SYSTEM + ((PLACE DARK ROOM) + (CASKET closed) + --> ( |The casket is closed.|))) + +(SYSTEM + ((PLACE DARK ROOM) + (CASKET opened) + --> ( |The casket is open.|))) + +(SYSTEM + ((PLACE DARK ROOM) + (CASKET closed) + & =A (INPUT OPEN ! =U) + & =B (DRACULA IS ASLEEP) + & =C --> ( =A) + ( =B) + ( =C) + (CASKET opened) + ( |When you open the casket you notice that a well dressed man|) + ( |with pale skin is inside. He appears dead. |) + ( | |) + ( |There is a huge diamond ring on his left hand.|) + ( | |) + ( |Suddenly his eyes blink open, you notice the irises are red.|) + ( |It is Dracula. Oops.|) + (DRACULA IS AWAKE))) + +(SYSTEM +((PLACE DARK ROOM) (DRACULA IS AWAKE) (IN DRACULA DARK ROOM) --> +( | |) +( |Dracula has left his casket and is approaching you.|))) + +(SYSTEM +((PLACE DARK ROOM) + CUT + (CASKET opened) & =A + (DRACULA IS AWAKE) (in Dracula dark room) +--> ( =a) +(INPUT scare dracula) +(CASKET closed) + ( |Dracula sees the cut on your hand and Snarls!|) + ( |You continue to stare into his eyes, and you can't move!|) + ( |Closer and closer he comes.|))) + +(SYSTEM + ((PLACE DARK ROOM) + (CASKET closed) + & =A (INPUT OPEN CASKET) + & =B --> ( =A) + ( =B) + (CASKET opened))) + +(SYSTEM + ((PLACE DARK ROOM) + (CASKET opened) + & =A (INPUT CLOSE CASKET) + & =B --> ( =A) + ( =B) + (CASKET closed))) + +(SYSTEM +((PLACE DARK ROOM) +(IN DRACULA DARK ROOM) + (DRACULA IS AWAKE) + (INPUT KILL DRACULA ! =X) + (INPUT KILL DRACULA ! =X) + & =A --> ( =A) + ( |Look turkey breath, this guy isn't the jolly green giant.|) + ( |You'll never kill him in this room.|))) + +(SYSTEM +((PLACE dark room) (in dracula dark room) (dracula is awake) +(INPUT give cube) & =A --> ( =A) +( |Dracula doesn't have a sweet tooth, although he does have a blood tooth!|))) + +(SYSTEM + ((PLACE DARK ROOM) + (IN DRACULA DARK ROOM) + (CASKET =D) & =C + (DRACULA IS AWAKE) & =B + (INPUT =X DRACULA) & =A + --> +( =A) + ( =B) + ( =C) + (Casket closed) + ( |Dracula grabs you around the neck, sinks his teeth in, and ...|) + DIE + (dracula is asleep))) + +(SYSTEM + ((PLACE DARK ROOM) + (IN DRACULA DARK ROOM) + (DRACULA IS AWAKE) + (INPUT =X DRACULA) & =A + (wears ! =Z) & =B + --> +( =A) ( =B) + ( |Dracula attacks you!|) + ( |He overpowers you and rips off your suit.|) + ( |You feel his teeth sink in and you hear him mutter, |) + ( |'You just can't find vir...'|) + DIE)) + +(SYSTEM + ((PLACE DARK ROOM) & =X + (DRACULA IS AWAKE) & =W + (IN DRACULA DARK ROOM) + (CASKET opened) & =Y + (GOING N) & =Z --> + ( =W) + ( =X) + ( =Y) + ( =Z) + (WASAT DARK ROOM) + (PLACE UPPER HALL) + ( |Dracula stays in the dark room.|) + (DRACULA IS ASLEEP) + (CASKET closed))) + +(SYSTEM + ((CANDLESTICKS ARE CROSSED) + (IN DRACULA DARK ROOM) + & =A (DRACULA IS AWAKE) + (PLACE DARK ROOM) + --> ( =A) + (IN DRACULA LABORATORY) + ( |Dracula sees the cross and becomes frightened. He turns into|) + ( |a bat and flys toward the highest point he can find.|))) + +(SYSTEM +((PLACE LABORATORY) + (IN DRACULA LABORATORY) + ( (CANDLESTICKS ARE CROSSED)) --> + ( |The bat flies down and lands in front of you.|) + ( | |) + ( |Poof!|) + ( | |) + ( |Dracula now stands in front of you and snarls.|) + ( |He takes a step forward and grabs your neck.|) + ( |You have no will of your own and you relax as you feel|) + ( |his fangs sink into your jugular.|) + DIE)) + +(SYSTEM +((PLACE dark room) (INPUT give blood) & =a --> +( =A) ( |I'm sure dracula will be glad to accept the donation.|) +(INPUT tickle dracula))) + +(SYSTEM +((PLACE dark room) (INPUT get ring) & =A --> ( =A) +( |Dracula won't give it to you.|))) + +(SYSTEM + ((PLACE dull room) + (Place dull room) + ( (WASAT dull room)) + --> ( |You have entered a non-descript room.|) + ( |There is a closet to the west. A door exits to the south.|) + ( |There are no other windows or doors.|))) + +(SYSTEM + ((PLACE dull room) + Closet-closed + --> ( |The closet door is closed.|))) + + +(SYSTEM + ((PLACE dull room) + & =A (GOING S) + & =B --> ( =A) + ( =B) + (WASAT dull room) + (PLACE UPPER HALL))) + +(SYSTEM + ((PLACE dull room) + (INPUT OPEN ! =X) & =Y + CLOSET-CLOSED & =A + --> ( =A) ( =Y) + ( |Opening closet.|) + CLOSET-opened)) + +(SYSTEM + ((PLACE dull room) + CLOSET-opened + & =A (INPUT CLOSE ! =X) + & =B --> ( =A) + CLOSET-CLOSED + ( |Thud.|) + ( =B))) + +(SYSTEM + ((PLACE dull room) + CLOSET-opened + --> + ( |The closet is open. It is too far to see in, you'll have to|) + ( |enter it. |))) + +(SYSTEM + ((PLACE dull room) + & =A (GOING W) + & =B CLOSET-opened + --> ( =A) + ( =B) + (WASAT dull room) + (PLACE SMALL CLOSET))) + +(SYSTEM + ((PLACE dull room) + (INPUT ENTER ! =X) & =A --> + (GOING W) + (WENT W) + ( =A))) + +(SYSTEM + ((PLACE SMALL CLOSET) & =B + (GOING E) & =A + CLOSET-opened --> + ( =A) + ( =B) + (WASAT SMALL CLOSET) + (PLACE dull room))) + +(SYSTEM + ((PLACE SMALL CLOSET) + (PLACE small closet) + ( (WASAT SMALL CLOSET)) + (NAME =P ! =X) + --> + ( |This is a tiny closet. Against the wall is a skeleton.|) + ( |Scrawled on the wall, next to the skeleton is:|) + ( | |) + ( |Dear Bas,|) + ( |So the mystery man finally decides to come home.|) + ( |Well you're a little late.|) + ( |I was never able to resurrect your mother, |) + ( |but I saw in the paper that you have a beautiful|) + ( |redheaded wife, and a lovely child. I only hope|) + ( |she hasn't inherited our disease.|) + ( |I finally succumbed to the illness when I was unable|) + ( |to take care of the crop.|) + ( |Good luck,|) + ( | Dad|) + ( | |) + ( |To the south is a ventilation duct.|) + ( |To the east is a room.|))) + +(SYSTEM + ((PLACE SMALL CLOSET) + (INPUT =X SKELETON) + & =A --> ( =A) + ( |Come on now, let your father rest in peace.|))) + +(SYSTEM + ((PLACE SMALL CLOSET) + (INPUT GET DAD) + & =A --> ( =A) + ( |This is the skeleton's final resting place.|))) + +(SYSTEM +((PLACE small closet) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ducte0) (wasat small closet))) + +(SYSTEM + ((PLACE SECRET ROOM) + (PLACE SECRET ROOM) + ( (WASAT SECRET ROOM)) + --> ( |You are in the secret room.|) + ( |You can go out past the wall, or there is a fireman's pole |) + ( |that goes down.|))) + +(SYSTEM + ((PLACE SECRET ROOM) + & =A (GOING D) + & =B --> ( =A) + ( =B) + (WASAT SECRET ROOM) + (PLACE SECRET STAIRS))) + +(SYSTEM + ((PLACE SECRET ROOM) + & =A (GOING W) + & =B (SECRET PANEL OPEN) + --> ( =A) + ( =B) + (WASAT SECRET ROOM) + (PLACE UPPER HALL))) + +(SYSTEM + ((PLACE SECRET ROOM) + (SECRET PANEL OPEN) + & =C (INPUT CLOSE ! =X) + & =B --> ( =B) + ( =C) + ( |The wall closes and locks.|))) + +(SYSTEM + ((PLACE LONG HALL) + ( (WASAT LONG HALL)) + --> ( |This hall runs east-west.|))) + +(SYSTEM + ((PLACE LONG HALL) + & =A (GOING E) + & =B --> ( =A) + ( =B) + (WASAT LONG HALL) + (PLACE UPPER HALL))) + +(SYSTEM + ((PLACE LONG HALL) + & =A (GOING W) + & =B --> ( =A) + ( =B) + (WASAT LONG HALL) + (PLACE DEAD END))) + +(SYSTEM + ((PLACE LONG HALL) + (SOUND IS ON) + --> + ( |The noise is very loud, it sounds like someone is being flogged with chains!|))) + +(SYSTEM + ((PLACE DEAD END) + ( (WASAT DEAD END)) + --> + ( |You are at a dead end.|) + ( | |) + ( |A wire can be seen along the wall. It is just visible above the carpet.|))) + +(SYSTEM + ((PLACE DEAD END) + & =A (GOING E) + & =B --> ( =A) + ( =B) + (WASAT DEAD END) + (PLACE LONG HALL))) + +(SYSTEM + ((PLACE DEAD END) + (SOUND IS ON) + (INPUT GET WIRE) + & =A --> ( =A) + ( |You can't get it, but you can see it above the carpet.|))) + +(SYSTEM + ((PLACE DEAD END) + (INPUT FOLLOW WIRE) + & =A --> ( |The wire goes east.|) + ( =A))) + +(SYSTEM + ((PLACE DEAD END) + (SOUND IS ON) + --> + ( |I can hardly hear myself think.|) + ( |You now recognize the noise as being an ALICE COOPER GREATEST HITS  +ALBUM.|))) + +(SYSTEM + ((PLACE WINE CELLAR) + (PLACE WINE CELLAR) + ( (WASAT WINE CELLAR)) + --> ( |You are in the wine cellar entrance.|) + ( |A staircase leads up, to the south are racks for wine bottles.|))) + +(SYSTEM + ((PLACE WINE CELLAR) + & =A (GOING U) + & =B --> ( =A) + ( =B) + (WASAT WINE CELLAR) + (PLACE SECRET STAIRS))) + +(SYSTEM + ((PLACE WINE CELLAR) + & =A (GOING S) + & =B --> ( =A) + ( =B) + (WASAT WINE CELLAR) + (PLACE WINE RACKS (E) (N)))) + +(SYSTEM + ((PLACE WINE CELLAR) + (INPUT GET WINE) + & =A --> ( =A) + ( |That reminds me, there isn't any wine in sight.|))) + + +(SYSTEM + ((PLACE MAIN HALL) + (STAIRS ARE COLLAPSED) + --> ( |There is rubble from the stairs to the north.|))) + +(SYSTEM + ((PLACE MAIN HALL) + (STAIRS ARE WHOLE) + --> ( |There are stairs that lead up.|))) + +(SYSTEM + ((PLACE DARK HALL) + --> ( |There is a safe on the wall.|))) + +(SYSTEM + ((PLACE DARK HALL) + (INPUT GET SAFE ! =X) + & =A --> ( =A) + ( |The safe is embedded in the wall.|))) + +(SYSTEM + ((PLACE DARK HALL) + (INPUT OPEN ! =X) + & =A (SAFE closed) + --> ( =A) + ( |It is locked. It is a combination lock.|) + ( |To open it you should tell me some numbers, all on the same line.|) + ( |eg. '10 - 10 - 10'|))) + +(SYSTEM + ((PLACE DARK HALL) + (SAFE opened) + (INPUT REACH ! =X) + & =B ( (scored money))--> ( =B) + ( |You just got the money in the safe.|) + (HOLDS MONEY))) + +(SYSTEM +((PLACE dark hall) +(scored money) (INPUT reach ! =X) & =A --> ( =A) +( |You are a greedy SOB. No more for you.|))) + +(SYSTEM + ((PLACE DARK HALL) + (SAFE opened) + & =B (INPUT CLOSE ! =X) + & =C --> (SAFE closed) + ( =B) + ( =C) + ( |The safe closes.|))) + +(SYSTEM + ((PLACE DARK HALL) + (SAFE closed) + & =A (INPUT 6 - 21 - 82) + & =B --> ( =A) + ( =B) + (SAFE opened) + ( |You sure have a mind for numbers!|))) + +(SYSTEM + ((PLACE DARK HALL) + (SAFE closed) + & =A (INPUT 6-21-82) + & =B --> ( =A) + ( =B) + (SAFE opened) + ( |You sure have a mind for numbers!|))) + +(SYSTEM + ((PLACE DARK HALL) + (SAFE opened) + --> ( |The safe is open.|) +( |You'll have to reach in to get anything.|))) + +(SYSTEM +((PLACE dark hall) (INPUT =x - =y - =z) & =A --> +( =A) +( |Well, I'll try it.|) ( =X) ( =Y) ( =Z) +( |That didn't work.|) +( | The safe must be a new version.|))) + +(system +((PLACE dark hall) (INPUT 10 - 10 - 10) & =A --> +( =A) +( |That wasn't very original, and it didn't work either.|))) + +(SYSTEM + ((INPUT FOLLOW WIRE) + & =A (PLACE LONG HALL) + --> ( =A) + ( |The wire goes east.|))) + +(SYSTEM + ((INPUT FOLLOW WIRE) + & =A (PLACE UPPER HALL) + --> ( =A) + ( |The wire goes behind a brick in the stone wall.|))) + +(SYSTEM + ((INPUT FOLLOW WIRE) + & =A (PLACE SECRET ROOM) + --> ( =A) + ( |The wire goes through the hole, down.|))) + +(SYSTEM + ((INPUT FOLLOW WIRE) + & =A (PLACE SECRET STAIRS) + --> ( =A) + ( |The wire goes out under the west wall.|))) + +(SYSTEM + ((INPUT FOLLOW WIRE) + & =A (PLACE LIBRARY) + --> ( =A) + ( |The wire goes west.|))) + +(SYSTEM + ((INPUT FOLLOW WIRE) + & =A (PLACE MAIN HALL) + --> ( =A) + ( |The wire goes into the dark hall.|))) + +(SYSTEM + ((INPUT FOLLOW WIRE) + & =A (PLACE DARK HALL) + --> ( =A) + ( |The wire goes west.|))) + +(SYSTEM + ((INPUT FOLLOW WIRE) + & =A (PLACE SMELLY ROOM) + ( (SCORED STEREO)) + --> ( =A) + ( |The wire goes behind some wood panel that opens.|) + (IN STEREO SMELLY ROOM))) + +(SYSTEM + ((INPUT ( PULL BREAK RIP) WIRE) + & =A (SOUND IS ON) + & =B --> ( |The wire SNAPS!|) ( |'Silence!'|) + ( =A) + ( =B))) + +(SYSTEM + ((INPUT =x homer) (INPUT =X HOMER) & =A --> + ( =A) (INPUT =X BUST))) + +(SYSTEM + ((PLACE LIBRARY) + (STACKS WERE OPEN) + (INPUT CONTEMPLATE BUST) + & =A --> ( =A) + ( |You get divine inspiration. God says I never met a|) + ( |ghost that wasn't chicken.|))) + +(SYSTEM + ((PLACE LIBRARY) + (INPUT CONTEMPLATE BUST) + & =A --> ( =A) + ( |While wasting your time contemplating + Homer, you notice he is off center.|))) + +(SYSTEM + ((PLACE LIBRARY) + (INPUT HIT BUST) + & =A --> ( =A) + (scored homers) + ( |It's going, going, ... gone. You just hit a Homer.|))) + +(SYSTEM +((PLACE library) (scored homers) (Input hit bust) & =A (score =q)--> +( =A) ( |Don't press your luck! What do you think this is, a baseball game?|))) + +(SYSTEM + ((INPUT GET BOOKS) & =A --> ( =A) (INPUT GET BOOK))) + + +(SYSTEM + ((PLACE DINING ROOM) + --> ( |There is beautiful unicorn head on the wall, horn and all.|))) + +(SYSTEM + ((PLACE DINING ROOM) + (INPUT GET UNICORN ! =X) + & =A ( (ONTOP STOOL)) + --> ( =A) + ( |Unicorn is too high to reach.|))) + +(SYSTEM + ((PLACE DINING ROOM) + (INPUT GET UNICORN) + & =A (ONTOP STOOL) + --> + ( =A) + ( |The unicorn head is stuck to the wall. It is a beautiful specimen though.|))) + +(SYSTEM + ((PLACE DINING ROOM) (ONTOP STOOL) + (INPUT get HORN) + (INPUT get HORN) + & =A ( (HOLDS HORN)) + --> ( =A) + (HOLDS HORN) + ( |When you get| + | the horn, it comes off and another one appears in its place.|))) + (SYSTEM +((PLACE back hall) (elevator broke) (INPUT press ! =X) +(INPUT press ! =X) & =A --> ( =A) +( |The elevator is broken.|))) + +(SYSTEM +((PLACE elevator) (elevator broke) (INPUT press ! =X) +(Input press ! =X) & =A --> ( =A) +( |The elevator is broken, nothing happens.|))) + + (SYSTEM +((PLACE back hall) --> ( |There is a button on the north wall.|))) + +(SYSTEM +((PLACE back hall) (INPUT press ! =Y) & =A (elevator closed) & =b +--> ( =A) ( =B) (elevator opened))) + +(SYSTEM +((PLACE back hall) (elevator closed) --> +( |There is a closed elevator to the north.|))) + +(SYSTEM +((PLACE back hall) (elevator opened) --> +( |The elevator doors are open.|))) + +(SYSTEM +((PLACE back hall) (elevator opened) (INPUT press ! =X) +& =A --> ( =A) ( |Nothing happens. The doors stay open.|))) + +(SYSTEM +((PLACE back hall) & =A (elevator opened) (elevator at =u) & =c +(GOING n) & =b --> ( =A) ( =B) +(WASAT back hall) (PLACE elevator) (elevator at H) +( =C))) + +(SYSTEM +((PLACE back hall) +(INPUT enter ! =w) & =A --> ( =A) (GOING n) (WENT N))) + +(SYSTEM +((PLACE back hall) (elevator closed) +(GOING N) & =A --> ( =A) +( |Ouch!! You bumped you nose on the elevator doors!|))) + +(SYSTEM +((PLACE back hall) (elevator IS stopped) +--> ( |The elevator is stopped between floors.|) +( |Above the elevator compartment is some strange machinery.|) +( |In order to see more clearly, you should climb on.|))) + +(SYSTEM +((PLACE back hall) & =A (elevator IS stopped) +(INPUT climb ! =X) & =B --> ( =A) ( =B) +(WASAT back hall) (PLACE top of elevator) +( |BZM would be proud.|))) + +(SYSTEM +((PLACE top of elevator) & =A (going d) & =B --> ( =A) ( =B) +(wasat top of elevator) (PLACE back hall))) + +(SYSTEM +((PLACE back hall) (elevator is stopped) (INPUT climb ! =X) & =B +(holds =Y) --> ( =B) ( |The opening is to small for you to fit carrying| ( =Y)))) + + +(SYSTEM +((PLACE top of elevator) (PLACE top of elevator) ( (WASAT top of +elevator)) --> ( +|You are atop the elevator. The machinery is of alien creation.|) +( |On the side of it is a small decal.|) +( |The decal reads 'afihYwn Matter Transmission, Inc'|) +( |There are two buttons on the machine, one says NORMAL.|) +( |The other says WAY OUT.|))) + +(SYSTEM +((PLACE top of elevator) (INPUT press normal) & =A +--> ( =A) ( |The elevator shaft starts to shake.|) +( |The machine starts to change color. Steam spews out!!|) +( |The light goes out on the NORMAL button.|) +( |The shaking stops. (I think you broke it)|) +(elevator broke))) + +(SYSTEM +((PLACE top of elevator) (INPUT press way out) & =b +--> ( =B) (orc out) +WAYOUT)) + +(system +((orc out) (orc out) & =B (orc ! =Z) & =A --> ( =A) ( =B) +(orced ! =Z))) + +(system +((orc out) & =A --> ( =A))) + +(SYSTEM +((elevator at p) & =A WAYOUT & =b (PLACE elevator) & =C --> +( =A) ( =B) ( =C) +(elevator at h) +transfer +(PLACE lawn iside 5 3) ( POOF!!!))) + +(system +((elevator at p) WAYOUT (PLACE elevator) (holds =X) --> +( |You suddenly feel very ill. Your body seems to be dematerializing.|) +( |You can't hold on to the stuff you were carrying.|) (INPUT drop all))) + +(SYSTEM +((PLACE top of elevator) (INPUT press ! =X) & =A (elevator broke) +--> ( =A) ( |Nothing happens, you did break it.|))) + +(SYSTEM +((PLACE top of elevator) WAYOUT --> ( |The WAY OUT light is lit.|))) + +(SYSTEM +((PLACE top of elvator) ( WAYOUT) --> +( |The Normal light is lit.|))) + +(SYSTEM +(transfer (in =x elevator) & =A --> +( |Poof!|) ( =A) (In =X lawn iside 5 4))) + +(system +(transfer (in =x elevator) (rope tied =X) & =A --> +( =A) ( |Poof! The rope around the| ( =X) +|is burned off.|))) + +(SYSTEM +(transfer (in rope elevator) & =A --> +( |The rope burns and disappears as it hits the outside air.|) +( =A))) + +(system +(transfer (in rope elevator) (rope tied =X) & =A --> +( =A))) + +(SYSTEM +((PLACE elevator) (PLACE elevator) ( (WASAT elevator)) +--> ( |You are in the elevator.|) +( |There are a bunch of buttons on the wall.|) +( |They are labeled: P, H, B, HALT, OPEN DOOR.|) +( |Scrawled on a wall is 'Homer kisses dead goats'|) +( |and 'Homer turns my head'|) +( |On the floor it says, 'L__t g_e_ _ere!'|))) + + +(SYSTEM +((PLACE elevator) (elevator at h) --> +( |The H is lit.|))) + +(SYSTEM +((PLACE elevator) (elevator at b) --> +( |The B is lit.|))) + +(SYSTEM +((PLACE elevator) (elevator at p) --> +( |The P is lit.|))) + +(SYSTEM +((PLACE elevator) & =B (elevator at h) +(elevator opened) +(GOING s) & =A --> ( =A) ( =B) +(WASAT elevator) (PLACE back hall))) + +(SYSTEM +((PLACE elevator) (INPUT push ! =X) & =A +--> ( =A) (INPUT press ! =X))) + +(SYSTEM +((PLACE elevator) (elevator at =X) & =A (INPUT press ( H B P) & =y) +& =b --> ( =A) ( =b) (elevator going =y))) + +(SYSTEM +((PLACE elevator) (elevator at =x) +(INPUT press halt) & =A --> ( =A) +( |The elevator is not moving turkey.|))) + +(SYSTEM +((PLACE elevator) (elevator at =X) (elevator opened) +(INPUT press open door) & =a --> ( =A) +( |The elevator door is already open.|))) + +(SYSTEM +((PLACE elevator) (elevator opened) & =A +(elevator going =Y) --> ( =A) +(elevator closed) ( |The elevator doors close. BOOM!|))) + +(SYSTEM +((PLACE elevator) (elevator closed) (INPUT then push open) & =A +(elevator going =X) --> ( =A) +( |The doors won't open while the elevator is moving.|))) + +(SYSTEM +((PLACE elevator) (elevator closed) +(elevator going =X) & =A (INPUT then push halt) & =B --> +( =A) ( =B) +(elevator at H) (elevator is stopped) +( |The elevator bounces to a halt. SCREEEECH!|))) + +(SYSTEM +((PLACE elevator) (elevator closed) +(elevator going =X) & =A (INPUT then press halt) & =B --> +( =A) ( =B) +(elevator at H) (elevator is stopped) +( |The elevator bounces to a halt. SCREEEECH!|))) + +(SYSTEM +((PLACE elevator) (elevator closed) & =A +(elevator IS stopped) (INPUT press open ! =Z) & =B +--> ( =A) ( =B) (elevator opened) +( |You are between floors.|) +( |You can see out through the top half of the elevator.|))) + +(SYSTEM +((PLACE elevator) (elevator opened) +(elevator at H) & =B +(elevator IS stopped) & =A (INPUT press ( H B P) & =Y) & =C +--> ( =A) ( =B) ( =C) (elevator closed) +( |The doors squeek close.|) (elevator going + =Y))) + +(SYSTEM +((PLACE elevator) & =A (elevator opened) +(elevator IS stopped) (INPUT climb ! =X) & =A --> +( =A) (GOING s) (WENT S))) + +(SYSTEM +((PLACE elevator) (elevator closed) & =A (elevator going =y) & =B + --> ( =B) ( =A) ( |The elevator shakes and starts to move down.|) +( |You feel like you are in free fall.|) +( |You hit a bump, and start to slow down.|) +(elevator opened) (elevator at =Y) +( |You made it. The elevator has stopped.|) +( |The doors open.|))) + +(SYSTEM +((PLACE elevator) (elevator at B) --> + +( |You can smell salt air, but your view of the outside|) +( |is obscured.|))) + +(SYSTEM +((PLACE elevator) & =A (elevator at B) (GOING s) & =V +(elevator opened) & =b +--> ( =A) ( =v) ( =B) +(WASAT elevator) +(elevator closed) +( |The elevator doors close. Swish...|) (PLACE Bathysphere))) + +(SYSTEM +((PLACE elevator) & =A (elevator at P) +--> ( |The doors opened to reveal a brick wall.|) +( |There is writing saying 'UNDER CONSTRUCTION'|))) + +(SYSTEM +((PLACE elevator) (INPUT press =Y) & =A +--> ( =A) ( |There is no button labeled| =Y))) + (SYSTEM +((PLACE torture chamber) (grill closed) (INPUT enter ! =X) & =A --> +( =A) ( |There is a grill over the ventilation duct.|))) + +(SYSTEM +((PLACE torture chamber) (grill closed) & =B (INPUT get grill) & =A --> +( =A) ( =B) (grill open) +( +|The hinges of the grill keep it on the wall, but it swings open.|))) + +(SYSTEM +((PLACE torture chamber) (grill closed) & =A (INPUT open ! =) & =B --> +( =A) ( =B) (grill open) +( |The grill swings away, leaving enough space for you to enter.|))) + +(SYSTEM +((PLACE torture chamber) (grill closed) (INPUT remove grill) & =A --> +( =A) (Input get grill))) + +(SYSTEM +((PLACE torture chamber) (going u) & =A --> ( =A) +(INPUT enter))) + +(SYSTEM +((PLACE torture chamber) (INPUT climb ! =X) & =A --> +( =a) (INPUT enter))) + +(SYSTEM +((PLACE torture chamber) (INPUT jump) & =A --> ( =A) (INPUT enter))) + +(SYSTEM +((PLACE torture chamber) & =A (grill open) (INPUT enter) & =b --> +( =A) ( =B) +(PLACE duct))) + +(SYSTEM +((PLACE torture chamber) (grill open) (INPUT close ! =X) & =A --> +( =A) +( |The grill has become stuck in the open position.|))) + +(SYSTEM +((PLACE duct) (PLACE duct) --> ( |You're in the ventilation system.|))) + +(SYSTEM +((PLACE duct) & =A (going d) & =B (grill open) --> ( =A) ( =B) +(PLACE torture chamber))) + +(SYSTEM +((PLACE duct) (INPUT open ! =r) & =A --> ( =A) ( +|The grill mesh is too fine for you to fit your fingers through to open|) +( |the latch that holds the grill closed.|))) + +(SYSTEM +((PLACE duct) (going d) & =A (grill closed) --> ( =A) +( |The grill over the duct is closed and you can't reach the|) +( |latch from inside the duct.|))) + +(SYSTEM +((PLACE duct) & =A (going d) & =B (grill open) --> ( =A) + ( =B) +( |The grill over the duct opens as you tumble out.|) +(PLACE torture chamber))) + +(SYSTEM +((PLACE duct) (INPUT close ! =X) & =B --> ( =B) +( |The grill seems to be stuck open.|))) + +(SYSTEM +((PLACE duct) --> ( |You can see down into the torture chamber.|) +( |The ventilation duct goes off to the west into darkness.|))) + +(SYSTEM +((PLACE duct) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductz0))) + +(SYSTEM +((PLACE ductz0) --> ( |You are in an east-west shaft.|))) + +(SYSTEM +((PLACE ductz0) & =A (going e) & =B --> ( =A) ( =B) +(PLACE duct))) + +(SYSTEM +((PLACE ductz0) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductA10))) + +(SYSTEM +((PLACE ductA10) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ductA10) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductA20))) + +(SYSTEM +((PLACE ductA10) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductz0))) + +(SYSTEM +((PLACE ductA10) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductB30))) + +(SYSTEM +((PLACE ductA20) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ductA20) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductA10))) + +(SYSTEM +((PLACE ductA20) & =A (going w) & =B --> ( =a) ( =B) +(PLACE ductA30))) + +(SYSTEM +((PLACE ductA20) & =A (going n) & =B --> ( =a) ( =B) +(PLACE ductC10))) + +(SYSTEM +((PLACE ductA30) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ducta30) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ducta20))) + +(SYSTEM +((PLACE ducta30) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductb10))) + +(SYSTEM +((PLACE ducta30) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductD0))) + +(SYSTEM +((PLACE ductb10) --> ( |The duct work goes east, north, and south.|))) + +(SYSTEM +((PLACE ductb10) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ducta30))) + +(SYSTEM +((PLACE ductb10) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductc10))) + +(SYSTEM +((PLACE ductb10) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductb20))) + +(SYSTEM +((PLACE ductb20) --> ( |The duct work goes east, north, and south.|))) + +(SYSTEM +((PLACE ductb20) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ductb10))) + +(SYSTEM +((PLACE ductb20) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ducta40))) + +(SYSTEM +((PLACE ductb20) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ducte0))) + +(SYSTEM +((PLACE ducta40) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ducta40) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductb20))) + +(SYSTEM +((PLACE ducta40) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductc21))) + +(SYSTEM +((PLACE ducta40) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductf0))) + +(SYSTEM +((PLACE ductc10) --> ( |The duct work goes up, down, west and south.|))) + +(SYSTEM +((PLACE ductc10) & =A (going w) & =b --> ( =A) ( =B) +(PLACE ductb10))) + +(SYSTEM +((PLACE ductc10) & =a (going s) & =B --> ( =A) ( =B) +(PLACE ducta20))) + +(SYSTEM +((PLACE ductc10) & =A (going d) & =B --> ( =A) ( =B) +(PLACE ductc12))) + +(SYSTEM +((PLACE ductc10) & =A (going u) & =B --> ( =A) ( =B) +(PLACE ductc11))) + +(SYSTEM +((PLACE ductb30) --> ( |The duct work goes east, north, and south.|))) + +(SYSTEM +((PLACE ductb30) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductc20))) + +(SYSTEM +((PLACE ductb30) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ducta10))) + +(SYSTEM +((PLACE ductb30) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductg0))) + +(SYSTEM +((PLACE ductd0) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ducta30))) + +(SYSTEM +((PLACE ductd0) --> ( |DEAD END!|))) + +(SYSTEM +((PLACE ducte0) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ductb20))) + +(SYSTEM +((PLACE ducte0) --> ( |You are in a north-south shaft.|))) + +(SYSTEM +((PLACE ducte0) & =A (going n) & =B --> ( =A) ( =B) +( |You tumble out of the ventilation system.|) +(PLACE small closet))) + +(SYSTEM +((PLACE ductf0) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ducta40)) ) + +(SYSTEM +((PLACE ductf0) --> ( |DEAD END|))) + +(SYSTEM +((PLACE ductg0) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductb30))) + +(SYSTEM +((PLACE ductg0) --> ( |DEAD END|))) + +(SYSTEM +((PLACE ductc20) --> ( |The duct work goes up, down, west and south.|))) + +(SYSTEM +((PLACE ductc20) & =A (going u) & =B --> ( =A) ( =B) +(PLACE ductc21))) + +(SYSTEM +((PLACE ductc20) & =A (going d) & =B --> ( =A) ( =B) +(PLACE ductc22))) + +(SYSTEM +((PLACE ductc20) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ducta42))) + +(SYSTEM +((PLACE ductc20) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ductb30))) + +(SYSTEM +((PLACE ductA11) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ductA11) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductA21))) + +(SYSTEM +((PLACE ductA11) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductZ1))) + +(SYSTEM +((PLACE ductA11) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductB31))) + +(SYSTEM +((PLACE ductA21) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ductA21) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductA11))) + +(SYSTEM +((PLACE ductA21) & =A (going w) & =B --> ( =a) ( =B) +(PLACE ductA31))) + +(SYSTEM +((PLACE ductA21) & =A (going n) & =B --> ( =a) ( =B) +(PLACE ductC11))) + +(SYSTEM +((PLACE ductA31) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ducta31) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ducta21))) + +(SYSTEM +((PLACE ducta31) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductb11))) + +(SYSTEM +((PLACE ducta31) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductD1))) + +(SYSTEM +((PLACE ductb11) --> ( |The duct work goes east, north, and south.|))) + +(SYSTEM +((PLACE ductb11) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ducta31))) + +(SYSTEM +((PLACE ductb11) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductc11))) + +(SYSTEM +((PLACE ductb11) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductb21))) + +(SYSTEM +((PLACE ductb21) --> ( |The duct work goes east, north, and south.|))) + +(SYSTEM +((PLACE ductb21) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ductb11))) + +(SYSTEM +((PLACE ductb21) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ducta41))) + +(SYSTEM +((PLACE ductb21) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ducte1))) + +(SYSTEM +((PLACE ducta41) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ducta41) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductb21))) + +(SYSTEM +((PLACE ducta41) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductc22))) + +(SYSTEM +((PLACE ducta41) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductf1))) + +(SYSTEM +((PLACE ductc11) --> ( |The duct work goes up, down, west and south.|))) + +(SYSTEM +((PLACE ductc11) & =A (going w) & =b --> ( =A) ( =B) +(PLACE ductb11))) + +(SYSTEM +((PLACE ductc11) & =a (going s) & =B --> ( =A) ( =B) +(PLACE ducta21))) + +(SYSTEM +((PLACE ductc11) & =A (going d) & =B --> ( =A) ( =B) +(PLACE ductc10))) + +(SYSTEM +((PLACE ductc11) & =A (going u) & =B --> ( =A) ( =B) +(PLACE ductc12))) + +(SYSTEM +((PLACE ductb31) --> ( |The duct work goes east, north and south.|))) + +(SYSTEM +((PLACE ductb31) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductc21))) + +(SYSTEM +((PLACE ductb31) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ducta11))) + +(SYSTEM +((PLACE ductb31) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductg1))) + +(SYSTEM +((PLACE ductd1) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ducta31))) + +(SYSTEM +((PLACE ductd1) --> ( |DEAD END|))) + +(SYSTEM +((PLACE ducte1) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ductb21))) + +(SYSTEM +((PLACE ducte1) --> ( |DEAD END|))) + +(SYSTEM +((PLACE ductf1) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ducta41)) ) + +(SYSTEM +((PLACE ductf1) --> ( |DEAD END|))) + +(SYSTEM +((PLACE ductg1) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductb31))) + +(SYSTEM +((PLACE ductg1) --> ( |DEAD END|))) + +(SYSTEM +((PLACE ductz1) --> ( |DEAD END|))) + +(SYSTEM +((PLACE ductz1) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ducta11))) + +(SYSTEM +((PLACE ductc21) --> ( |The duct work goes up, down, west and south.|))) + +(SYSTEM +((PLACE ductc21) & =A (going u) & =B --> ( =A) ( =B) +(PLACE ductc22))) + +(SYSTEM +((PLACE ductc21) & =A (going d) & =B --> ( =A) ( =B) +(PLACE ductc20))) + +(SYSTEM +((PLACE ductc21) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ducta40))) + +(SYSTEM +((PLACE ductc21) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ductb31))) + +(SYSTEM +((PLACE ductA12) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ductA12) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductA22))) + +(SYSTEM +((PLACE ductA12) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductZ2))) + + +(SYSTEM +((PLACE ductA12) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductB32))) + +(SYSTEM +((PLACE ductA22) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ductA22) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductA12))) + +(SYSTEM +((PLACE ductA22) & =A (going w) & =B --> ( =a) ( =B) +(PLACE ductA32))) + +(SYSTEM +((PLACE ductA22) & =A (going n) & =B --> ( =a) ( =B) +(PLACE ductC12))) + +(SYSTEM +((PLACE ductA32) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ducta32) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ducta22))) + +(SYSTEM +((PLACE ducta32) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductb12))) + +(SYSTEM +((PLACE ducta32) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductD2))) + +(SYSTEM +((PLACE ductb12) --> ( |The duct work goes east, north, and south.|))) + +(SYSTEM +((PLACE ductb12) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ducta32))) + +(SYSTEM +((PLACE ductb12) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductc12))) + +(SYSTEM +((PLACE ductb12) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductb22))) + +(SYSTEM +((PLACE ductb22) --> ( |The duct work goes east, north, and south.|))) + +(SYSTEM +((PLACE ductb22) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ductb12))) + +(SYSTEM +((PLACE ductb22) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ducta42))) + +(SYSTEM +((PLACE ductb22) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ducte2))) + +(SYSTEM +((PLACE ducta42) --> ( |The duct work goes east, north, and west.|))) + +(SYSTEM +((PLACE ducta42) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductb22))) + +(SYSTEM +((PLACE ducta42) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductc20))) + +(SYSTEM +((PLACE ducta42) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductf2))) + +(SYSTEM +((PLACE ductc12) --> ( |The duct work goes up, down, west and south.|))) + +(SYSTEM +((PLACE ductc12) & =A (going w) & =b --> ( =A) ( =B) +(PLACE ductb12))) + +(SYSTEM +((PLACE ductc12) & =a (going s) & =B --> ( =A) ( =B) +(PLACE ducta22))) + +(SYSTEM +((PLACE ductc12) & =A (going d) & =B --> ( =A) ( =B) +(PLACE ductc11))) + +(SYSTEM +((PLACE ductc12) & =A (going u) & =B --> ( =A) ( =B) +(PLACE ductc10))) + +(SYSTEM +((PLACE ductb32) --> ( |The duct work goes east, north, and south.|))) + +(SYSTEM +((PLACE ductb32) & =A (going n) & =B --> ( =A) ( =B) +(PLACE ductc22))) + +(SYSTEM +((PLACE ductb32) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ducta12))) + +(SYSTEM +((PLACE ductb32) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ductg2))) + +(SYSTEM +((PLACE ductd2) & =A (going e) & =B --> ( =A) ( =B) +(PLACE ducta32))) + +(SYSTEM +((PLACE ductd2) --> ( |DEAD END|))) + +(SYSTEM +((PLACE ducte2) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ductb22))) + +(SYSTEM +((PLACE ducte2) --> ( |DEAD END|))) + +(SYSTEM +((PLACE ductf2) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ducta42))) + +(SYSTEM +((PLACE ductf2) --> ( |You are in a north-south shaft.|))) + +(SYSTEM +((Place ductf2) & =A (going n) & =B --> ( =A) ( =B) +( |You tumble out of the ventilation system.|) +(PLACE kitchen) (ontop FRIG) )) + +(SYSTEM +((PLACE ductg2) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ductb32))) + +(SYSTEM +((PLACE ductg2) --> ( |DEAD END|))) + +(SYSTEM +((PLACE ductz2) --> ( |DEAD END|))) + +(SYSTEM +((PLACE ductz2) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ducta12))) + + +(SYSTEM +((PLACE ductc22) --> ( |The duct work goes up, down, west and south.|))) + +(SYSTEM +((PLACE ductc22) & =A (going u) & =B --> ( =A) ( =B) +(PLACE ductc20))) + +(SYSTEM +((PLACE ductc22) & =A (going d) & =B --> ( =A) ( =B) +(PLACE ductc21))) + +(SYSTEM +((PLACE ductc22) & =A (going w) & =B --> ( =A) ( =B) +(PLACE ducta41))) + +(SYSTEM +((PLACE ductc22) & =A (going s) & =B --> ( =A) ( =B) +(PLACE ductb32))) + + (SYSTEM +((enter =z) (time is =Z) (time is =Z) (PLACE ! =X) --> +( |You hear a truck pull into the yard.|))) + +(SYSTEM +((return =X) (time is =X) (time =X) --> ( |You hear a truck drive off.|))) + +(SYSTEM +((holds corkscrew) ( (scored screw)) (score =Q) & =A --> +( =A) (scored screw) (score (<+> 15 =Q)))) + +(SYSTEM +((holds horn) (score =Y) & =A ( (scored horn)) --> +( =A) (score (<+> =y 15)) (scored horn))) + +(SYSTEM +((holds gold) (score =Y) & =A ( (scored gold)) --> +( =A) (score (<+> =y 15)) (scored gold))) + +(SYSTEM +((holds football) (score =Y) & =A ( (scored football)) --> +( =A) (score (<+> =y 15)) (scored football))) + +(SYSTEM +((holds stereo) (score =Y) & =A ( (scored stereo)) --> +( =A) (score (<+> =y 15)) (scored stereo))) + +(SYSTEM +((holds ring) (score =Y) & =A ( (scored ring)) --> +( =A) (score (<+> =y 15)) (scored ring))) + +(SYSTEM +((holds candlesticks) (score =Y) & =A ( (scored candlesticks)) --> +( =A) (score (<+> =y 15)) (scored candlesticks))) + +(SYSTEM +((holds marijuana) (score =Y) & =A ( (scored marijuana)) --> +( =A) (score (<+> =y 15)) (scored marijuana))) + +(SYSTEM +((holds cube) (score =Y) & =A ( (scored cube)) --> +( =A) (score (<+> =y 15)) (scored cube))) + +(SYSTEM +((holds money) (score =Y) & =A ( (scored money)) --> +( =A) (score (<+> =y 15)) (scored money))) + +(SYSTEM +((holds chair) (score =Y) & =A ( (scored chair)) --> +( =A) (score (<+> =y 15)) (scored chair))) diff --git a/src/haunt/haunto.mps b/src/haunt/haunto.mps new file mode 100644 index 000000000..a5a85f0dc --- /dev/null +++ b/src/haunt/haunto.mps @@ -0,0 +1,2136 @@ +(system +(XYZZY & =A --> ( =A) ( |This is HAUNT. Version 4.6|) +( |See NEWS for news.|) +( |Have you played before?[yes]|) +(FIRST ()) ( | |) READ)) + +(system +((first ! =X) & =A --> + ( =A) (first n) ( |I assume that was NO!|))) + +(system +((first) & =A --> ( =A) +(PLACE bus stop) READ)) + +(system +((first y) & =A --> ( =A) (first))) + +(system +((first yes) & =a --> ( =A) (first))) + +(system +((first no) & =A --> ( =A) (first n))) + +(system +((first n) & =A --> ( =A) (first) +( |Welcome novice. You are playing on one of the world's largest production|) +( |systems. The purpose of this game is to find|) +( |treasure in a haunted house and then escape from the house.|) +( | |) +( |The program will give descriptions of locations and accept|) +( |commands to perform actions.|) +( |Give it directives on what to do with simple 1-5 word commands|) +( |Its knowledge of English is limited but imaginative.|) +( |The directions are north, south, east, west,|) +( |up and down. Directions can be one letter (n,s,e,w,u,d).|) +( |Forward, back, left and right also work.|) +( |To string commands together use 'then'. (eg. west then s)|) +( |It will describe things to you, and a phrase enclosed in ' ' |) +( |is something it hears.|) +( | |) +( |Special commands: INVEN tells you what you hold.|) +( | SCORE gives your current score. |) +( | STOP ends the adventure. |) +( | LOOK describes your current position.|) +( | NEWS describes new features.|) +( | |) +( |*******************************************************************|) +( |You get 15 points for finding a treasure and 5 points for|) +( |getting it to the lawn outside the house. You get an extra|) +( |bonus of 20 points for getting your body off the estate.|) +( |The maximum number of points is 440|) +( |Good luck, you'll need it. Ask for help if you want.|) +( |*******************************************************************|) +( |Copyright (C) 1979, 1980, 1981, 1982 John Laird|) +( |*******************************************************************|) +( | |) +( |On with the adventure!!!|) +( | |) +( | |) +( | |) +( | |) +( | |) +( | |) +( | |) +( | |) +( | |) +( | |) + ( |Along time ago, a young couple was picnicing near the woods|) +( |on the outskirts of town. They were celebrating the birth|) +( |of their first child. Unfortunately, a crazed moose inhabited that|) +( |area and attacked them. The child and husband were|) +( |unharmed, but the wife was gored to death by the moose.|) +( | |) +( |After the funeral, the man bought the land where the incident occurred|) +( |and constructed a large mansion: CHEZ MOOSE. He filled it with|) +( |the treasures of his family and claimed that his wife's|) +( |soul was still in the area. He vowed to remain in the|) +( |mansion until he had returned her soul to human flesh.|) +( |He tried to bridge the gap between life and death to reclaim her.|) +( |Some say he was insane with grief, but others claimed that the madness was|) +( |in his blood, and his wife's death brought it to the surface.|) +( |After he entered the house, he never returned, and was declared dead |) +( |seven years later. Several people have entered the mansion|) +( |looking for him but none of them have ever returned.|) +( |There were rumors that he and his wife now haunt the house.|) +( | |) +( |That would be the end of the story except that the house|) +( |still stands and is filled with priceless treasures.|) +( |The house and all its contents are willed to his only descendant.|) +( |Oh yes, I forgot to tell you, the day the mother was killed,|) +( |the child was stolen by Gypsies.|) +( |The Will claims that only the descendant will know|) +( |how to avoid going crazy and committing suicide|) +( |while spending a night in the mansion.|) +( |An obscure hereditary disease, Orkhisnoires sakioannes,|) +( |is supposed to play some part in this.|) +( | |) +( |So if your heritage is in doubt, you may be the descendant that|) +( |can claim the treasure in the mansion.|) +( |Many people, claiming to be descendants have died trying...|) +( | or at least never returned.|) +( | |) +( |The terms of the Will say you get to keep any treasure|) +( |you get to the lawn, but of course you must also get off the premises alive.|) +( |Because the house is haunted it must be destroyed, and nobody|) +( |would be crazy enough to try and recover the rest of the treasure.|) +( |If you do get out, the government has agreed to|) +( |buy the land and destroy the house.|) +( | |) +( |If you are insane enough to try, your adventure starts at a bus stop.|) +( |Remember, type STOP to end the adventure.|) +( | |))) + +(system + (START & =A --> ( =A) (SCORE 0) (WENT N) (WENT S) (WENT W) + (WENT E) + (IN CANDLESTICKS DINING ROOM) + (IN GHOST CHEESE ROOM) + (IN CANDY FOYER) + (IN JADE BACKROOM) + (IN SOAP BATHROOM) + (IN MATTRESS BEDROOM) + (IN CHEST OCEAN 2 2 1) + (IN MARIJUANA SECRET ROOM) + (IN BOTTLE BAR) + (IN PAINTING SMELLY ROOM) + (IN CHAIR MAIN HALL) + (IN STOOL BAR) + (IN GOLD SMALL CLOSET) + + (IN DRACULA DARK ROOM) + (IN MONSTER LABORATORY) + (IN COINS BATHYSPHERE) + (IN CORKSCREW WINE CELLAR) + (IN WETSUIT CLOSET) + (IN SPEARGUN BATHYSPHERE) + (IN DIAMONDS CAVE) + (MORAY EEL IS ALIVE) + (SEAMONSTER IS ALIVE) + (OCTOPUS IS ALIVE) + (ELEVATOR AT H) + (CASKET CLOSED) + (GRILL CLOSED) + (ELEVATOR CLOSED) + (LARGE-DOOR CLOSED) + (SAFE CLOSED) + (RDOOR CLOSED) + (WDOOR CLOSED) + CLOSET-OPENED + SECRET-PANEL-CLOSED + (WATER IS OUT) + (CUBE FRIG) + (BTIME /22/:14) + (GRAVE UNDUG) + (HOLDS TOKENS) + (ON ORCHID LAWN ISIDE 3 7) + (SPEARGUN IS LOADED) + (ROPE NOOSE) + (HOLDS WATCH) + (INSIDE TURPENTINE BOTTLE) + (PAINTING IS COVERED) + (FOYER IS VIRGIN) + (TIME IS /22/:00) + (SOUND IS ON) + (STAIRS ARE WHOLE) + (DAMSEL AROUND) + (DRACULA IS ASLEEP) + DAMSEL-TIED-UP)) + +(system +(ODIE ODIE (HOLDS =x) & =A --> ( =A) (IN =X lawn iside 5 3))) + +(system +(ODIE ODIE ODIE DIED --> +( |Well, you're one more that didn't get the treasure and live.|) +HALT)) + +(system +(ODIE & =b (PLACE ! =x) & =A (score =Q) & =C --> ( =B) +( =C) (PLACE lawn oside 2 2) ( =A) (score (<-> =Q 20)) +DIED ( |Hmm... you went and got yourself killed.|) +( |But before the last neuron in your brain was destroyed, a|) +( |10th level Bus driver came by and conjured up a Lazurus spell!!!|))) + (system +((PLACE bus stop) (PLACE bus stop) --> +( |We are at an intersection of two streets going n-s and e-w.|) +( |There is a bus stop here.|) +( |To the west a bus is pulling away from the next bus stop.|))) + +(system +((PLACE bus stop) (going =z) & =A (TIME is =x) (BTIME =y) & =B --> +( =A) ( =B) ( (PLACE bus stop)) (BTIME ( =x 16)))) + + +(system +((PLACE bus stop) (time is =X) (time is =x) (BTIME =x) --> +bus-stopped)) + +(system +((Place bus stop) bus-stopped --> ( |A bus has stopped in front of us.|))) + +(system +((INPUT wait ! =x) & =A --> ( |La dee da.|) ( =A))) + +(system +((PLACE bus stop) (INPUT wait ! =X) & =A --> ( =A) + bus-stopped ( |Yawn!|))) + +(system +((PLACE bus stop) (INPUT mount ! =y) & =a --> ( =A) +(INPUT enter bus))) + +(system +((INPUT board ! =X) & =A --> ( =A) +(INPUT enter bus))) + +(system +((PLACE bus stop) bus-stopped & =C (INPUT enter ! =X) & =A (holds tokens) & =b --> +( =A) ( =b) ( =C) (holds token) ride-bus)) + +(system +((PLACE bus stop) (INPUT take ride ! =X) & =A --> ( =A) (INPUT enter bus))) + +(system +((PLACE bus stop) bus-stopped & =c (INPUT enter ! =x) & =a (holds token) & =b --> +( =A) ( =B) ( =C) ride-bus)) + +(system +((PLACE bus stop) bus-stopped (INPUT enter ! =x) & =A --> ( =A) +( |You don't have any tokens. You sit on the corner and starve to death.|) +HALT)) + +(system +((PLACE bus stop) bus-stopped (INPUT enter ! =X) & =A (in token bus stop) +--> ( =A) ( |The bus doors remain closed.|))) + +(system +((PLACE bus stop) bus-stopped (INPUT enter ! =X) & =A (in tokens bus stop) +--> ( =A ) + ( |You stumble over some tokens and bang your head on the bus.|))) + + +(system +((PLACE bus stop) & =A ride-bus & =B --> +( =A) ( =B) +(PLACE a bus) (WASAT a bus) +( |As you find your seat, you notice the bus is empty.|) +( |There isn't even a driver. But before you can change your mind,|) +( |the bus starts up and drives away from the intersection.|) +( |Va Vooooom!|) +( |Looking out the window you see many intersections flash by.|) +( | |) +( |After a while the intersections get farther apart.|) +( |The bus is now in the outskirts of town.|) +( |The bus comes up to an old mansion with a high gate surrounding it and stops.|) +( |A voice comes over the speaker: 'ALL OUT, END OF THE LINE.'|))) + +(system +((PLACE a bus) ( (WASAT a bus)) --> ( | |) +( |You are in a bus. There isn't a driver and the exit doors are open.|))) + +(system +((PLACE a bus) (INPUT get off ! =X) & =A --> ( =A) (INPUT exit))) + +(system +((PLACE a bus) (INPUT leave ! =X) & =A --> ( =A) (INPUT exit))) + +(system +((PLACE a bus) (INPUT depart ! =X) & =A --> ( =A) (INPUT exit))) + +(system +((PLACE a bus) & =A (INPUT exit ! =X) & =B --> ( =A) ( =B) +(PLACE lawn oside 5 2) +( |The bus drives off as you get off.|))) + +(system +((PLACE a bus) (INPUT get out ! =X) & =A --> ( =A) (INPUT exit))) + +(system +((PLACE bus stop) (INPUT ( Chase follow catch) bus ! =X) & =A --> ( =A) +( |I'm assuming that means GO WEST.|) (going w) (went w))) + +(system +((PLACE bus stop) (time is /22/:26) --> +( |Hint: patience is a virtue.|))) + +(system +((PLACE a bus) (INPUT hijack bus ! =) & =A --> ( =A) +( |Sorry, this bus doesn't go to Cuba, that's another line.|))) + +(system +((PLACE a bus) (INPUT = driver) & =A --> ( =A) +( |There isn't a driver on this bus.|))) + +(system +((PLACE a bus) (INPUT drive bus ! =X) & =A --> ( =A) +( |I'm sorry but you don't have a chauffeur's license.|))) + +(system +((PLACE a bus) (INPUT = bus) & =A --> ( =A) +( |Give up and get off the bus.|))) + +(system +((PLACE bus stop) (INPUT hail bus) & =a --> ( =A) +( |The bus does not stop for you.|))) + +(system +((PLACE lawn =side ( 0) & =C =D) & =A (going e) & =b --> + ( =A) ( =B) (PLACE lawn =side (<+> 1 =C) =D))) + +(system +((PLACE lawn =side =e ( 0) & =N) & =A (going n) & =B --> + ( =A) ( =B) (PLACE lawn =side =E (<+> 1 =N)))) + +(system +((PLACE lawn =side =E ( 1) & =N) & =A (going s) & =B --> + ( =A) ( =B) (PLACE lawn =side =E (<-> =N 1)))) + +(system +((PLACE lawn =side ( 1) & =E =N) & =A (going w) & =B --> + ( =A) ( =B) (PLACE lawn =side (<-> =E 1) =N))) + +(system +((PLACE lawn oside 1 =N) (going w) & =B --> +( =B) ( |The woods is too dense to penetrate.|))) + +(SYSTEM +((PLACE lawn oside 1 1) & =A (going w) & =B --> +( =a) ( =B) (PLACE BUS STOP))) + +(system +((place lawn oside 1 1) (going n) & =b --> +( =b) ( |The woods to the north is too dense to penetrate.|))) + +(SYSTEM +((PLACE lawn oside 8 1) & =A (going e) & =B --> +( =a) ( =B) (PLACE BUS STOP))) + +(system +((PLACE lawn oside 8 =N) (going e) & =B --> +( =B) ( |You are unable to penetrate into the woods.|))) + +(system +((PLACE lawn oside =e 1) (going s) & =B --> +( =B) ( |The forest can not be penetrated.|))) + +(system +((PLACE lawn oside =e 8) (going n) & =B --> +( =B) ( |Penetration into the forest is impossible|))) + +(system +((PLACE lawn oside ( 2) 2) (going n) & =A --> +( =A) ( |The wall prevents passage to the north.|))) + +(system +((PLACE lawn iside ( 1) 2) (going s) & =A --> +( =A) ( |The wall won't let you go south.|))) + +(system +((PLACE lawn oside ( 2) 8) (going s) & =A +--> ( =A) ( |The wall is in the way.|))) + +(system +((PLACE lawn iside ( 1) 8) (going n) & =A +--> ( =A) ( |Hey, the wall is north.|))) + +(system +((PLACE lawn oside ( 2) 8) +( (PLACE lawn oside 8 8)) --> +( |You're on the north border of a wall, on the outside.|))) + +(system +((PLACE lawn iside ( 1) 8) --> +( |You're on the inside of the north border of a wall.|))) + +(system +((PLACE lawn oside ( 2) 2) --> +( |To the north is the wall that surrounds CHEZ MOOSE.|) +( |To the south is a road.|))) + +(system +((PLACE lawn iside ( 1) 2) --> +( |A wall is to the south.|))) + +(system +((PLACE lawn oside 2 ( 2)) --> +( |To the west is a thick forest, and to the east is a wall.|))) + +(system +((PLACE lawn oside 8 ( 2)) +( (PLACE lawn oside 8 8)) --> +( |To the east is a dark forest, and to the west is a high wall.|))) + +(system +((PLACE lawn iside 8 ( 1)) --> +( |To the east is a wall.|))) + +(system +((PLACE lawn iside 2 ( 1)) --> +( |To the west is a wall.|))) + +(system +((PLACE lawn iside 2 ( 1)) (going w) & =A --> ( =A) +( |The wall blocks your way.|))) + +(system +((PLACE lawn oside 2 ( 2)) (going e) & =A --> +( =A) ( |Ahh, there is the big wall in the way.|))) + +(system +((PLACE lawn oside 8 ( 2)) (going w) & =A --> +( =A) ( |The wall is in the way.|))) + +(system +((PLACE lawn iside 8 ( 1)) (going e) & =A +--> ( =A) ( |The wall is in the way.|))) + +(system +((PLACE lawn iside 4 4) --> ( |You are at the sw corner of the house.|))) + + +(system +((PLACE lawn iside 6 4) --> +( |You are at the se corner of the house.|))) + +(system +((PLACE lawn iside 4 5) --> +( |You are on the west side of the house.|))) + +(system +((PLACE lawn iside 4 6) --> +( |This is the north-west corner of the house.|))) + +(system +((PLACE lawn iside 5 6) --> +( |This is the north side of the house.|))) + +(system +((PLACE lawn iside 6 6) --> +( |This is the north east corner of the mansion.|))) + +(system +((PLACE lawn iside 6 5) --> +( |This is the east side of the house.|))) + +(system +((PLACE lawn iside 6 5) (going w) & =A --> +( =A) ( |The house is in the way.|))) + +(system +((PLACE lawn iside 4 5) (going e) & =A --> +( =A) ( |The house is in the way.|))) + +(system +((PLACE lawn iside 5 4) (going n) & =A --> +( =A) ( |The house is in the way.|))) + +(system +((PLACE lawn iside 5 6) (going s) & =A --> +( =A) ( |The house is in the way.|))) + +(system +((PLACE lawn oside =e 1) --> + ( |You are on the road, to the south is a forest.|))) + +(system +((PLACE lawn oside 1 ( 2)) --> ( |You are in a forest.|))) + +(system +((PLACE lawn iside 3 3) --> lawns)) + +(system +((PLACE lawn iside 4 3) --> lawns)) + +(system +((PLACE lawn iside 6 3) --> lawns)) + +(system +((PLACE lawn iside 7 3) --> lawns)) + +(system +((PLACE lawn iside 7 4) --> lawns)) + +(system +((PLACE lawn iside 7 7) --> lawns)) + +(system +((PLACE lawn iside 6 7) --> lawns)) + +(system +((PLACE lawn iside 5 7) --> lawns)) + +(system +((PLACE lawn iside 4 7) --> lawns)) + +(system +((PLACE lawn iside 3 6) --> lawns)) + +(system +((PLACE lawn iside 3 7) --> ( +|This looks like an old garden, but the land is all dried and hard.|))) + +(system +((on bathwater lawn iside 3 7) (on orchid lawn iside 3 7) & =A +--> ( =A) ( |The ground shakes...|) +( |An orchid sprouts from the ground.|) +(in orchid lawn iside 3 7))) + +(system +((on water lawn iside 3 7) (in orchid lawn iside 3 7) +(on bathwater lawn iside 3 7) & =B --> ( =B) +( |The orchid shinks and disappears underground.|))) + +(system +((on water lawn iside 3 7) (on orchid lawn iside 3 7) +--> ( |Nothing happens. That must be strange water.|))) + +(system +((on water lawn iside 3 7) & = A (inside bathwater bottle) +(PLACE bathroom) +--> ( =A))) + +(system +((on seawater lawn iside 3 7) (on orchid lawn iside 3 7) & =A +--> ( |I think you killed what ever was planted.|))) + +(system +((on bathwater ! =X) & =a (on water ! =X) & =b +--> ( =A) ( =B) ( |The two types of water evaporate.|))) + +(system +((PLACE lawn iside 3 5) --> lawns)) + +(system +((PLACE lawn iside 3 4) --> lawns)) + +(system +(lawns & =A --> ( =A) ( |You're on the lawn of the mansion.|))) + +(system +((PLACE lawn iside 5 3) --> ( |You're on the front walk.|))) + +(system +((PLACE lawn iside 5 2) --> +( |You're at the front gate, which can't be opened.|))) + +(system +((PLACE lawn =side 5 2) (INPUT climb ! =X) & =A --> +( =A) ( |Nice try, but the upper part of the gate is electrified!|) +( |I suggest you try somewhere else.|))) + +(system +((PLACE lawn oside 5 2) --> +( |To the north is a gate in a wall.|) +( |Further north a huge mansion looms.|) +( | |) +( |Lights from inside illuminate the surrounding estate.|) +( |The gate is inoperable, and you won't be able to open it.|))) + + +(system +((PLACE lawn iside 8 6) +(going w) & =A --> ( =A) ( |The garage is in the way.|))) + +(system +((PLACE lawn iside 8 6) --> +( |There is a garage to the west.|))) + +(system +((PLACE lawn iside 7 7) --> +( |There is a garage to the south.|))) + +(system +((PLACE lawn iside 7 7) (going s) & =A --> +( =A)( |The garage is in the way.|))) + +(system +((PLACE lawn iside 6 6) --> +( |There is a garage to the east.|))) + + +(system +((PLACE lawn iside 6 6) (going e) & =A --> +( =A) ( |The garage is in the way.|))) + +(system +((PLACE lawn iside 7 5) --> +( |The entrance to a garage is to the north.|) +( |You are on the drive way.|) +( |The drive has a gate in the wall to the east.|))) + +(system +((PLACE lawn iside 7 6) --> +( |You are in an old garage. It opens to the south.|))) + +(system +((PLACE lawn iside 7 6) (going n) & =A --> +( =A) ( |There is a wall in the way.|))) + +(system +((PLACE lawn iside 7 6) (going e) & =A --> +( =a) ( |There is a wall in the way.|))) + +(system +((PLACE lawn iside 7 6) (going w) & =A --> +( =A) ( |There is a wall in the way.|))) + +(system +((PLACE lawn oside 8 8) & =A +(going s) & =B --> ( =A) ( =B) (PLACE lawn oside 8 7))) + +(system +((PLACE lawn oside 8 8) & =A +(going w) & =b --> ( =A) ( =B) +(PLACE lawn oside 7 8))) + +(system +((PLACE lawn oside 2 8) & =A +(going e) & =B --> ( =A) ( =B) +(PLACE lawn oside 3 8))) + +(system +((PLACE lawn oside 8 2) & =A (going n) & =B +--> ( =A) ( =B) (PLACE lawn oside 8 3))) + +(system +((PLACE lawn oside 2 2) --> ( |This is the sw corner of the wall.|))) + +(system +((PLACE lawn oside 8 2) --> +( |This is the se corner of the wall. You can go n, s, e or w.|))) + +(system +((PLACE lawn oside 8 8) --> +( |This is the ne corner of the wall.|))) + +(system +((PLACE lawn oside 2 8) --> +( |This is the nw corner of the wall.|))) + + + +(system +((PLACE lawn =side ! =n) (Input ( scale climb) ! =Z) & =A --> ( =A) +( |The wall is too slick to climb up. You can't get a grip.|))) + +(system +((PLACE lawn =side ! =n) +(INPUT ( burrow tunnel dig) ! =x) & =A --> ( =A) +( |The ground is too hard to dig here.|))) + +(system +((PLACE lawn =side ! =N) (Holds =X) (INPUT THROW =x AT WALL) & =A --> ( =A) +( |The| ( =x) |bounces off the wall.|) (INPUT drop =X))) + +(system +((PLACE lawn =side ! =n) (Input jump wall) & =A --> ( =A) +( |You aren't the HULK or Dwight Stones.|))) + +(system +((PLACE lawn =side ! =n) (Input jump wall) & =A (name Dwight Stones) +--> ( =A) ( |You approach the wall. Up, up you go.|) +( |SPLAT!!! You hit the wall right at 8". That would|) +( |be a new world's record. Too bad the wall is ten feet tall.|))) + +(system +((PLACE lawn =side ! =n) (Input jump wall) & =A + (name the Hulk) --> ( =A) +( |Ha! You aren't the Hulk, you're just a little green|) +( |from the bus ride.|))) + +(system +((PLACE lawn =side ! =n) (Input jump over wall) & =A --> ( =A) +( |You watched Superman too many times!!|))) + +(system +((PLACE lawn ! =X) (INPUT throw =y over ! =Z) & =A --> +( =A) ( |The wall is too high for you to throw anything over it.|))) + +(system +((INPUT let me in) & =A --> ( =A) +( |I'm afraid you aren't getting anyone's attention.|))) + +(system +((INPUT open gate) & =A --> ( =A) ( |The gate can't be opened by you.|))) + +(system +((notreasure) (in ! =x) & =A --> ( =A))) + +(system +((PLACE lawn iside 5 6) --> +( |There is ivy on the walls of the house.|))) + +(system +((PLACE lawn iside 5 6) (INPUT get ivy) & =A --> +( =A) ( |The ivy is stuck to the wall.|))) + +(system +((PLACE lawn iside 5 6) & =B (INPUT ( u up climb scale) ! =z) & =A --> +( =A) ( =B) +( |The ivy allows you to get a grip. You climb up the wall.|) +( |The ivy starts to thin out and you haven't found anywhere to stop.|) +( |To the right you spy a balcony. Using your great skill as a|) +( |world class haunted house climber, you JRST over to the balcony.|) +(PLACE balcony))) + +(system +((PLACE balcony) (PLACE balcony) ( (wasat balcony)) +--> ( |You are on the balcony. The doors to the inside|) +( |are missing leaving a large doorway to the inside.|))) + +(system +((PLACE balcony) (going u) & =a --> ( =A) ( |You can't climb any higher.|))) + +(system +((PLACE balcony) (INPUT climb up ! =X) & =A --> ( =A) +(going u) (went u))) + +(system +((PLACE balcony) (INPUT climb) & =A --> ( =A) ( |Climb up or climb down?|))) + +(system +((PLACE balcony) (INPUT climb down) & =A --> ( =A) +( |I warned you that the ivy gave out up here!|) +( |When you tried to leap over to get a grip, you missed!!!!|) +( |Down you go|) +( | o|) +( | o|) +( | o|) +( | o.|) +( |Your foot gets caught in some ivy near the bottom and you land|) +( |on your head. |) ODIE)) + +(system +((PLACE balcony) (going d) & =A --> ( =A) +( |Is that climb down or jump?|))) + +(system +((PLACE balcony) (INPUT jump ! =D) & =b --> +( |Paratrooper training comes in helpful sometimes.|) +( |Unfortunately you never had it. You break your neck when you hit.|) +( =B) ODIE)) + +(system +((PLACE balcony) (INPUT jump ! =D) & =B (holds mattress) --> +ODIE ( |You flip over in mid-air and land on your back! 'CRUNCH'|) + ( =b))) + +(system +((PLACE balcony) & =a (INPUT jump ! =D) & =B (in mattress lawn ! =X) --> +( =A) ( =B) (PLACE lawn iside 5 6) +( |Luckily you land on the mattress.|))) + +(system +((PLACE balcony) (holds mattress) & =A (INPUT drop mattress ! =X) & =b +--> ( =A) ( =B) (in mattress lawn iside 5 6) +( |The mattress floats to the ground.|))) + +(system +((PLACE balcony) (INPUT throw mattress ! =x) & =A --> ( =A) +(INPUT drop mattress))) + +(system +((PLACE balcony) (INPUT enter ! =X) & =A --> (going s) (WENT S) + ( =A))) + +(system +((PLACE balcony) & =A (going s) & =b --> ( =A) +( =B) (wasat balcony) +(PLACE bedroom))) + +(system +((PLACE bedroom) (PLACE bedroom)( (wasat bedroom)) --> +( |You are in what looks like the master bedroom of the mansion.|) +( |A large doorway opens to the balcony to the north.|) +( |To the east is a opening to the bathroom.|) +( |The main doorway to the rest of the house is boarded up and impassable.|))) + +(system +((PLACE bedroom) (INPUT enter ! =X) & =A --> + ( =A) (going e) (WENT E))) + +(system +((PLACE bedroom) (INPUT exit ! =X) & =a --> ( =A) (going n) (WENT N))) + +(system +((PLACE bedroom) (holds mattress) (going e) & =A --> ( =A) +( |The mattress won't fit through the door.|))) + +(system +((PLACE bedroom) (holds mattress) (going n) --> +( |The mattress just clears the door.|))) + +(system +((PLACE bedroom) & =A (going n) & =b --> ( =a) +( =B) (wasat bedroom) (PLACE balcony))) + +(system +((PLACE bedroom) & =A (going e) & =B --> ( =A) +( =B) (wasat bedroom) (PLACE bathroom))) + +(system +((PLACE bedroom) (sound is on) --> ( |Some noise can be heard through the boarded up door.|))) + +(system +((PLACE bedroom) (in mattress bedroom) --> +( |There is a king-size bed in the middle of the room.|))) + +(system +((PLACE bedroom) ( (in mattress bedroom)) --> +( |There is the frame and springs of a king-size bed in the room.|))) + +(system +((PLACE bedroom) (INPUT get bed) & =A --> ( =A) ( +|All you can get is the mattress, the rest is too heavy.|) +(INPUT get mattress))) + +(system +((PLACE ! =X) (in mattress ! =X) & =A +(INPUT cut mattress ! =Y) & =B +--> ( =A) ( =B) +( |The mattress is poorly made and you rip it to shreds.|) +( |In fact it is in a million pieces that float away.|))) + +(system +((INPUT cut mattress) & =A (holds mattress) & =B --> +( =A) ( =B) +( |The mattress falls to pieces in your hands and they all float away.|))) + +(system +((INPUT ( chop rip tear) ! =Y) & =A --> ( =A) +(INPUT cut ! =Y))) + +(system +((PLACE bedroom) (INPUT look under bed) & =A --> ( =A) +( |'Ahhh Chooo!' There is dust under the bed.|))) + +(system +((PLACE bedroom) (INPUT =x under bed) & =A --> ( =A) +( |The bed is too low to go under.|))) + +(system +((PLACE bedroom) (INPUT mount bed) & =A --> ( =A) +(ontop bed) ( |You are on the bed.|))) + +(system +((PLACE bedroom) (ontop bed) (in mattress bedroom) (INPUT jump ! =X) & =A +( (mirror broke)) --> ( =A) ( |You bounce up and hit the mirror. It shatters into many small pieces.|) (mirror broke))) + +(system +((INPUT bounce ! =X) & =A --> ( =A) (INPUT jump))) + +(system +((PLACE bedroom) (ontop =) (INPUT jump ! =X) & =A --> +( =A) ( |Without the mattress on you don't get any cheap thrills.|))) + +(system +((PLACE bedroom) (ontop =Q) (INPUT get mirror) & =A --> ( =A) ( +|The mirror is still out of reach.|))) + +(system +((PLACE bedroom) (INPUT get mirror) & =A --> ( =A) +( |The mirror is much too high to reach.|))) + +(system +((PLACE bedroom) ( (mirror broke)) --> ( |There is a mirror on the ceiling above the bed.|))) + +(system +((PLACE bedroom) (mirror broke) (INPUT get mirror ! =X) & =A --> +( =A) CUT ( |The glass is too sharp to carry, you cut yourself. 'Ouch!'|))) + +(system +((PLACE bedroom) (mirror broke) (ontop bed) (INPUT get mirror ! =X) & =A +--> ( =A) CUT +( |The glass cuts you when you try to pick it up.|))) + +(system +((PLACE bedroom) (mirror broke) (INPUT get glass ! =X) & =A --> +( =A) CUT ( |'Ouch!' The glass cuts you, you can't carry it.|))) + +(system +((PLACE bedroom) (mirror broke) --> ( |There is glass from a broken mirror on the floor.|))) + +(system +((PLACE bedroom) (ontop bed) (INPUT sleep ! =X) & =A --> +( |Snooze... + . + . + . + . + . + ... snort. Ah that was refreshing, but useless, you're still ugly.|) +( =A))) + +(system +((PLACE bedroom) (INPUT get in bed) & =A --> +( =A) (INPUT mount bed))) + +(system +((PLACE bedroom) (INPUT sit on bed) & =A --> ( =A) +(INPUT mount bed))) + +(system +((INPUT sleep ! =X) & =A --> ( =A) ( |Let's wait until we are on a bed.|))) + +(system +((PLACE ! =X) ( (PLACE bedroom)) (in mattress ! =X) --> +( |There is a king-size mattress here.|))) + +(system +((PLACE bathroom) (PLACE bathroom) ( (wasat bathroom)) --> +( |You are in the master bathroom.|) +( |The exciting features around are the bathtub and the toilet.|))) + +(system +((PLACE bathroom) & =A (going w) & =B --> ( =A) +( =B) (wasat bathroom) (PLACE bedroom))) + +(system +((PLACE bathroom) (Input Urinate ! =X) & =A --> ( =A) ( |That was a relief!|))) + +(system +((PLACE bathroom) (INPUT urinate ! =X) (likes prince) --> (siton toilet))) + +(system +((INPUT urinate into bottle ! =X) & =A --> ( =A) +( |The adventure has frighten you so much that your|) +( |urethra won't relax|) +( |and you are unable to even expel a drop.|))) + +(system +((INPUT get urine ! =X) & =A --> ( =A) +(INPUT urinate into bottle))) + +(system +((INPUT urinate in bottle ! =X) & =A --> ( =A) +(INPUT urinate into bottle))) + +(system +((PLACE bathroom) (INPUT shit ! =X) & =A --> ( =A) (siton toilet) +( |Too bad there isn't any tissue!|))) + +(system +((INPUT piss ! =X) & =A --> ( =A) (INPUT urinate ! =X))) + +(system +((INPUT take a leak ! =X) & =A --> ( =A) (INPUT urinate ! =X))) + +(system +((PLACE bathroom) (INPUT take a crap) & =A --> ( =A) (INPUT shit))) + +(system +((PLACE bathroom) (INPUT mount toilet) & =A --> ( =A) +( |Sitting on a toilet is lots of fun!!|) (siton toilet))) + +(system +((PLACE bathroom) (INPUT sit on toilet) & =A --> ( =A) +(siton toilet) ( |Duly sat.|))) + +(system +((PLACE bathroom) (INPUT flush ! =XX) & =S --> ( =S) +ODIE ( |When you flush the toilet it spins around, knocking you off your feet!|) +( |You crack your head on the bathtub and die!!!|))) + +(system +((PLACE bathroom) (going w) (siton =x) & =A --> ( =A))) + +(system +((PLACE bathroom) & =A (siton toilet) (INPUT flush ! =X) & =c +--> ( =A) ( =C) (wasat bathroom) +(PLACE backroom))) + +(system +((PLACE bathroom) (get toilet) & =A --> ( =A) ( |Give me a break! The toilet stays here!|))) + +(system +((PLACE bathroom) (get bathtub) & =A --> ( |The bathtub doesn't move.|) ( =A))) + +(system +((PLACE bathroom) (INPUT ( enter mount) bathtub) & =A --> (siton bathtub) ( =A) +( |Ok.|))) + +(system +((PLACE bathroom) (INPUT sit in bathtub) & =A --> (siton bathrub) +( =A) ( |Ok.|))) + +(system +((PLACE bathroom) (INPUT turn on water) & =A --> ( =A) +WATER-ON)) + +(system +((PLACE bathroom) WATER-ON --> ( |The water is on in the bathtub.|))) + +(system +((PLACE bathroom) (INPUT turn off water) & =A --> ( =A) +( |The water is already off.|))) + +(system +((PLACE bathroom) WATER-ON & =A (INPUT turn off water) & =b --> +( =A) ( =B) ( |The water is turned off.|) +( |All the water drains out.|))) + +(system +((Place bathroom) (INPUT turn on shower) & =A --> ( =A) +( |There isn't a shower head, just a bathtub.|))) + +(system +((PLACE bathroom) (INPUT take shower) & =A --> ( =A) +( |I thought I said there was only a BATHTUB!|))) + +(system +((PLACE bathroom) (INPUT take bath) & =A --> ( =A) WASH)) + +(system +((PLACE bathroom) (INPUT wash ! =A) & =B --> ( =B) WASH)) + +(system +((Place Bathroom) WASH ( WATER-ON) --> + ( |Well, I must turn on the water.|) WATER-ON)) + +(system +((PLACE bathroom) WASH ( (siton bathtub)) --> +( |Let's get in the bathtub.|) +(siton bathtub))) + +(system +((PLACE bathroom) WASH ( (holds soap)) --> +( |Hmmm... now where was that soap.|) (INPUT get soap))) + +(system +((PLACE bathroom) WASH & =B (holds soap) & =a (siton bathtub) WATER-ON --> +( =A) ( =B) +( |Luckily we don't worry about clothes in this adventure!|) +( |The water is nice and warm. Too bad I don't have a rubber duckie!|) +( |Well let's use the soap to get clean.|) +( |There is so much dirt here it takes alot of soap.|) +( |As the soap wears away, we are left with a GEM!!!.|) +(holds gem))) + +(system +(WASH & =A --> ( =A) +( |Ahh, can't wash without any soap and water.|))) + +(system +((holds soap) (siton bathtub) WATER-ON --> + ( |As long as we're here, we might as well wash.|) WASH)) + +(system +((PLACE bathroom) (holds soap) & =B (INPUT drop soap in bathtub) & =A + WATER-ON --> ( =A) ( =B) +( |The soap dissolves and a gem remains!|) (in gem bathroom))) + +(system +((holds soap) & =B (PLACE bathroom) WATER-ON (INPUT drop soap in water) & =A --> ( =A) +( |The soap dissolves in the water!!|) (in gem bathroom) +( =a) ( =B))) + +(system +((siton bathtub) (wears =X) & =A --> ( =A) +( |If we're getting in the bathtub I'm going to take off the| +( =X) |.|))) + +(system +((PLACE bathroom) (INPUT lather ! =X) & =A --> ( =A) (INPUT wash))) + +(system +((PLACE bathroom) (INPUT drop soap in water) & =A --> ( =A) +(INPUT wash))) + +(system +((PLACE bathroom) (INPUT drop soap in bathtub) & =A --> ( =A) +(INPUT wash) ( |Let's jump in after it and take a bath.|))) + +(system +((PLACE bathroom) (INPUT drink water) & =A --> ( =A) +( |Gross! I'm not that thirsty!|))) + + +(system +((INPUT urinate ! =X) (INPUT urinate ! =X) (wears =X) --> (INPUT take off =X) +( |Well, I think it is best to undress a little first.|))) + +(system +((PLACE bathroom) (INPUT shit ! =Z) (wears =X) --> (INPUT take off =X) +( |I'll take off the suit first.|))) + +(system +((INPUT pee ! =X) & =A --> ( =A) (INPUT urinate ! =X))) + +(system +((PLACE bathroom) (INPUT =x DRAIN) & =A --> ( =A) +( |The drain is open, even shoving the bed down it won't close it|))) + +(system +((PLACE bathroom) (INPUT plug ! =X) & =A --> ( =A) +( |You can't plug it.|))) + +(system +((PLACE bathroom) (INPUT =x plug ! =Y) & =A --> ( =A) +( |I see no plug here.|))) + +(system +((PLACE bathroom) WATER-ON (INPUT splash ! =X) & =A +--> ( =A) ( |Hey, watch it! No splashing around here.|))) + +(system +((PLACE bathroom) (siton bathtub) & =A WATER-ON (INPUT drown ! =X) & =B +--> ( =A) ( =B) ODIE ( |Adventure a little to tough for you eh?|) +( |Well you did look a little blue, especially after you held your head under|) +( |for ten minutes!|))) + +(system +((PLACE backroom) (PLACE backroom) ( (wasat backroom)) --> +( |The toilet and the wall have swivled around 180 degrees.|) +( |You are now in a backroom.|) +( |I assume this was for when grand-dad wanted to ... in private.|) +( |There are no doors or windows. Just the toilet.|))) + +(system +((PLACE backroom) & =A (INPUT flush ! =X) & =B --> +( =A) ( =B) (wasat backroom) +(PLACE bathroom) ( |Around you go again.|))) + +(system +((PLACE backroom) (INPUT urinate ! =X) & =A --> ( =A) +( |Your bladder is empty.|))) + +(system +((PLACE backroom) (INPUT shit ! =z) & =A --> ( =A) +( |Plop!|))) + +(system +((PLACE backroom) (INPUT stand ! =X) & =A --> ( =A) +( |There isn't enough room to stand.|))) + +(system +((PLACE backroom) (Input get up) & =A --> ( =A) +( |I see no up here. Ha ha, only kidding. There isn't room to stand in here.|))) + (system +((PLACE lawn iside 8 5)(PLACE lawn iside 8 5) --> +( |You are on the driveway. The gate to the outside|) +( |is to the east, but is locked electronically.|))) + +(system +((PLACE lawn iside 8 5) (going e) & =A --> +( =A) ( |The gate is locked, and you can't open it.|))) + +(system +((PLACE lawn oside 8 5) --> +( |There is a gate in the wall that spans the|) +( |driveway that leads into the inner grounds of the mansion.|) +( |By the left hand side of the gate is a 'Jack-in-the-box'|) +( | speaker with a button.|))) + +(system +((PLACE lawn oside 8 5) (INPUT press ! =X) & =A + ( (wasat gate)) +--> ( =a) ( |'ZZZZZZZ CracKLe ZZZZZZZZZ'|) (one) +(wasat gate))) + +(system +((PLACE lawn oside 8 5) (INPUT press ! =x) & =A +(one) & =B --> ( =A) ( =B) ( |'ZZZZZZZZ, snort snort ZZZZZZZ'|) (two))) + +(system +((PLACE lawn oside 8 5) (INPUT press ! =X) & =A + (two) & =B --> ( =A) ( =B) (three) +( |'Meep, ZZzz, Go AWAY!! Leave me alone!, ZZZT'|))) + +(system +((PLACE lawn oside 8 5) (INPUT press ! =X) & =A +(three) & =B --> ( =A) ( =B) +( |'Alright, alright. Stop pressing that damn buzzer!'|) +( |'There is a microphone there so I can hear anything you say.'|) +( |'How did you get here, on that stupid bus?'|) +(INPUT con four ()))) + +(system +((INPUT con =y ! =x) & =A --> ( =A) +( |'Answer the question!'|) +(INPUT con =y ()))) + +(system +((PLACE lawn oside 8 5) & =b (INPUT con =y go ! =x) & =A --> ( =A) +( =B) ( |'Well, if you don't like it here, maybe you'll like the bus stop'|) +(PLACE bus stop))) + +(system +((INPUT con =y e) & =A --> ( =a) (INPUT con =y go))) + +(system +((INPUT con =y s) & =A --> ( =A) (INPUT con =y go))) + +(system +((INPUT con =y y) & =A --> ( =A) (INPUT con =y yes))) + +(system +((INPUT con =y certainly) & =A --> ( =A) (Input con =y yes))) + +(system +((INPUT con =y of course) & =a --> ( =A) (INPUT con =y yes))) + +(system +((INPUT con =y definately) & =a --> ( =A) (INPUT con =y yes))) + +(system +((INPUT con =y n) & =A --> ( =A) (INPUT con =y no))) + +(system +((INPUT con =y maybe) & =A --> ( =A) +( |'Answer yes or no'|) (INPUT con =Y ()))) + +(system +((INPUT con =y) & =A --> ( =A) +( |'Speak up I didn't hear you.'|) (INPUT con =Y ()))) + +(system +((PLACE lawn oside 8 5) & =B (INPUT con =y press ! =X) & =A --> +(wasat gate) +( =A) ( =B) +( |'That's it!! You've pressed my buzzer once too often.'|) +( |'I guess you must love that bus stop.'|) (PLACE bus stop))) + +(system +((PLACE lawn oside 8 5) (wasat gate) +(INPUT press ! =X) & =A --> ( |'So it's you again, I think I'll go back to sleep and think about|) +( |whether to talk to you.'|) (tryagain) ( =A))) + +(system +((PLACE lawn oside 8 5) (wasat gate) (INPUT press ! =X) & =A +(tryagain) & =b --> ( =A) ( =B) +( |'Alright, I'll let you in if you answer three questions.'|) +( |'First, what is your name?'|) (name ()) +findsex)) + +(system +((PLACE lawn oside 8 5) (INPUT hello ! =X) & =A +--> ( =A) ( |'ZZzzzzz'|))) + +(system +((PLACE lawn oside 8 5) & =B (INPUT con four no) & =A --> (wasat gate) +( =A) ( =B) (Place bus stop) +( |'Well this time you will.'|))) + +(system +((INPUT con four yes) & =A --> ( =A) +( |'I thought so. Mumble. I suppose you think you can survive|) +( |in Chez Moose for a night without going crazy and find mucho treasure?'|) +(INPUT con five ()))) + +(system +((INPUT con five no) & =A --> ( =A) (NOTREASURE) +( |'Then I guess you won't be disappointed when you don't find any treasure.'|) +(INPUT con five yes))) + +(system +((INPUT con five yes) & =A --> ( =A) ( +|'So I guess you want to come in the gate, don't you?'|) +(INPUT con six ()))) + +(system +((INPUT con six no) & =A (PLACE ! =y) & =B --> ( =A) +( =B) (wasat gate) ( +|'Then leave me alone, you turkey. Good night!! Enjoy the bus stop.'|) +(PLACE bus stop))) + +(system +((INPUT con six yes) & =A --> ( =A) +( |'In order for you to enter you must first answer three questions!'|) +( |'First, what is your name?'|) +(name ()) findsex)) + +(system +((name =x st |.| john) findsex & =A --> ( =A) +( |'Oh, so you're one of my descendants. Come in.'|) +( |'You don't have to answer any more questions.'|) +( |'Good luck in your quest. Maybe you'll do better than your father.'|) +(likes redhead) (answer correct))) + +(system +((name =x st john) & =A --> ( =A) (name =X st |.| john))) + +(system +(findsex & =A (likes ! =X) --> ( =A) +( |'Second, what is your quest?'|) (quest ()))) + +(system +((quest ! =X) & =A --> ( =A) +( |'I always wanted to do that. I hope you don't go insane trying.'|) +( | |) (eight ()))) + +(system +((quest Holy Grail ) & =A --> ( =A) +( |'Well, I can assure you that you won't find it here.'|) +( |'But you're welcome to try, if you don't go insane first.'|) + ( | |) (eight ()))) + +(system +((quest ( GOLD MONEY JEWELS treasure)) & =A --> +( =A) (eight ()) +( |'There's lots of that around, all you have to do is find it.'|) +( | |))) + +(system +((quest phd ! =X) & =A --> ( =A) (eight ()) +( |'Sorry, I can't perform miracles.'|) +( | |))) + +(system +((quest To find ! =X) & =A --> ( =A) (quest ! =X))) + +(system +((quest ( a stanford cmu my the) ! =X) & =A + --> ( =A) (quest ! =X))) + +(system +((quest ( mom ma mother dad father)) & =A --> ( =A) (eight ()) +( |'That brings tears to my eyes. Sniffle.'|) +( | |))) + +(system +((quest ( love romance sex)) & =A (likes ! =X) --> +( =A) (eight ()) +( |'I think there will be a| ( ! =X) |dying to meet you.'|) +( | |))) + +(system +((quest moose) & =a --> ( =A) (eight ()) +( |'I guarantee that one will run into you.'|) +( | |))) + +(system +(findsex & =A --> ( =A) +( |'Second, which sex (male, female, ...) interests you sexually'|) +(sex ()))) + +(system +((wants ! =x) & =A --> ( =A) (LIKES ! =X) (eight ()))) + +(system +((Answer correct) & =B (PLACE lawn oside 8 5) & =A +--> ( =A) ( =B) +( |The gate opens. You rush in and then it closes behind you.|) +( |Out of the speaker you hear, 'Now you are in, but will you ever get out?'|) +(PLACE lawn iside 8 5))) + +(system +((holds token) & =A (PLACE lawn iside 8 5) --> ( =A) +( | |) +( |'I'll take that gold token you've got there.'|) +( |'CHOMP! Yep these old teeth left a mark in it.'|) +( |'Maybe next time you'll be smart enough to test it yourself.'|) +( | |))) + +(system +(ATETOKEN & =A (Wants ! =X) & =B --> ( =A) ( =B) +( |'POOF!'|) (Place lawn iside 8 5) (likes ! =X))) + +(system +(ATETOKEN & =A (Likes ! =X) findsex & =B +--> ( =A) ( =B) +( |'POOF!'|) (Place lawn iside 8 5) )) + +(system +((NAME =X St |.| John) findsex & =B ATETOKEN & =A +--> ( =A) ( =B) +(likes redhead) ( |'POOF!'|) (PLACE lawn iside 8 5))) + +(system +((INPUT ( Bite Chew eat taste gum) token) & =A +(holds tokens) & =B (PLACE ! =X) & =C --> +( =A) ( =B) ( =C) +ATETOKEN +( |The token disolves in your mouth.|) +( |Your mind fills with a question you MUST answer.|) +( |'What is your name?'|) (name ()) findsex)) + +(system +((INPUT ( Bite Chew eat taste gum) tokens) & =A +(holds tokens) & =B (PLACE ! =X) & =C --> +( =A) ( =B) ( =C) +ATETOKEN +( |The tokens disolve in your mouth.|) +( |Your mind fills with a question you MUST answer.|) +( |'What is your name?'|) (name ()) findsex)) + +(system +((INPUT =x tokens) & =A +--> ( =A) (INPUT =x token))) + +(system +((PLACE ! =X) (in tokens ! =X) (INPUT get token) (INPUT get token) & =A --> +( =A) (INput get tokens))) + +(system +((INPUT drop token) (INPUT drop token) & =A +(holds tokens) --> ( =A) (INPUT drop tokens))) + +(system +((INPUT ( Bite chew eat taste gum) token) (holds token) & =A +--> ( =A) (holds tokens))) + +(system +((INPUT get microphone) & =A (PLACE lawn oside ! =Y) & =b +--> ( =A) ( =B) +( |'I heard that! There is no way you gonna find that microphone at the bus stop.'|) (PLACE bus stop))) + +(system +((INPUT find microphone) & =A --> (INPUT get microphone) ( =A))) + +(system +((INPUT get speaker) & =A --> ( =A) ( |'Hey, leave the speaker alone!'|) (three))) + +(system +((eight =a) & =B (user-an ! =x) & =C (my-an ! =x) & =d --> +( =B) ( =C) ( =D) ( |Correct!!|) +(answer correct))) + +(system +((eight =A) & =B (user-an ! =x) & =C (my-an ! /#x) & =D +(PLACE lawn ! =y) & =E --> ( =E) +( =B) ( =C) ( =D) ( +|Wrong!! Buzzzzz. Don't come back til you know the answer!|) +(wasat gate)(PLACE bus stop))) + +(system +((likes ! =x) & =A (likes ! /#x) & =B (PLACE ! =Y) & =C (eight =Q) & =D +--> ( =d) +( =A) ( =B) ( =C) +(PLACE bus stop) ( |Wrong!! Make up your mind!|))) + +(system +((name ! =X) & =A (name ! /#x) & =B (PLACE ! =Y) & =C findsex & =D +--> ( =D) +( =A) ( =B) ( =C) +(PLACE bus stop) ( |Wrong!! Make up your mind!|))) + +(system +((eight 1) --> ( |'What is your favorite color?'|) +(my-an blue) (user-an ()))) + +(system +((eight 2) --> ( |'What U.S. University has the largest number of living alumni?'|) +(my-an MICHIGAN) (user-an ()))) + +(system +((eight 3) --> +( |'What is the number of hairs in a bristle dartboard, in millions: 1, 2, ...?'|) +(my-an 16) (user-an ()))) + +(system +((eight 4) --> ( |'What shipping lines owned the Titanic?'|) +(my-an White STAR) (user-an ()))) + +(system +((eight 0) --> ( |'What was the first production system with more than 1500 productions?'|) +(user-an haunt) (my-an ()))) + +(system +((eight 5) --> ( |'What will permanently rob Superman of his powers?'|) +(my-an gold kryptonite) (user-an ()))) + +(system +((eight 6) --> +( |'What is the full name (first middle and last) of the first test-tube baby?'|) +(my-an louise joy brown) (user-an ()))) + +(system +((eight 8) --> +( |'What is the capital of Assyria?'|) +(my-an Nineveh) (user-an ()))) + +(system +((eight 7) --> ( |'What is the air speed (in mph) of an unladen swallow?'|) +(my-an 95) (user-an ()))) + +(system +((eight 7) & =b (my-an 95) & =c (user-an is that ! =x) & =A (PLACE lawn ! = ) +--> +( =a) ( =b) ( =c) (answer correct) +( |'Hmm.. let me see. I used to know that.'|) +( |'Mumble ... Oops, darn, I hit the wrong switch!'|))) + +(system +((eight 7) & =b (my-an 95) & =c (user-an European or ! =x) & =A +(PLACE lawn ! = ) --> +( =a) ( =b) ( =c) (answer correct) +( |'Hmm.. let me see. I used to know that.'|) +( |'Mumble ... Oops, darn, I hit the wrong switch!'|))) + +(system +((eight 7) & =b (my-an 95) & =c (user-an African or ! =x) & =A +(PLACE lawn ! = ) --> +( =a) ( =b) ( =c) (answer correct) +( |'Hmm.. let me see. I used to know that.'|) +( |'Mumble ... Oops, darn, I hit the wrong switch!'|))) + +(system +((eight 7) & =b (my-an 95) & =c (user-an DO ! =x) & =A +(PLACE lawn ! = ) --> +( =a) ( =b) ( =c) (answer correct) +( |'Hmm.. let me see. I used to know that.'|) +( |'Mumble ... Oops, darn, I hit the wrong switch!'|))) + +(system +((eight 7) & =b (my-an 95) & =c (user-an What ! =x) & =A +(PLACE lawn ! = ) --> +( =a) ( =b) ( =c) (answer correct) +( |'Hmm.. let me see. I used to know that.'|) +( |'Mumble ... Oops, darn, I hit the wrong switch!'|))) + + (system + ((PLACE LAWN ISIDE 5 4) + (INPUT OUVRE ! =Z) + & =C (LARGE-DOOR CLOSED) + & =B (LIKES ! =F) + --> ( =C) + ( =B) + (LARGE-DOOR opened) + ( |The door creaks open.|) + ( |A voice from within says: 'Welcome,| ( ! =F) |lover.'|))) + +(system +((PLACE lawn iside 5 4) (INPUT ouvre ! =Z) & =A +(large-door opened) --> ( =A) ( |The door stays open.|))) + +(system + ((PLACE LAWN ISIDE 5 4) + (GOING N) + & =A --> + ( =A) + ( |The door is closed, you bump your nose!|))) + +(system + ((PLACE LAWN ISIDE 5 4) + & =B (GOING N) + & =A (LARGE-DOOR opened) + --> (PLACE FOYER) + ( =A) + ( =B))) + +(system +((PLACE lawn iside 5 4) (going n) & =A +(large-door opened) (holds mattress) --> ( =A) +( |The mattress won't fit throught the door.|))) + +(system +((PLACE lawn iside 5 4) (going n) + (large-door opened) (holds cube) & =B +--> ( =B) (in cube lawn iside 5 4) + ( |You stumble over the threshold and drop the cube outside.|))) + +(system +((PLACE lawn iside 5 4) (going n) (large-door opened) (holds marijuana) +& =A --> ( =A) +( |The dope slips from your hand.|) +(in marijuana lawn iside 5 4))) + +(system + ((PLACE LAWN ISIDE 5 4) + (INPUT ENTER ! =X) + & =A --> ( =A) + (GOING N) (WENT N))) + +(system + ((PLACE LAWN ISIDE 5 4) (PLACE LAWN ISIDE 5 4) + --> + ( |You are outside a large door in the front of an old mansion.|))) + +(system + ((PLACE LAWN ISIDE 5 4) + (INPUT KNOCK ! =X) + & =A --> ( =A) ( |'Knock! Knock!'|) + (INPUT OUVRE ! =X))) + +(system + ((PLACE LAWN ISIDE 5 4) + (INPUT RING ! =X) + & =A --> ( =A) + ( |Ding dong!!|) + (INPUT OUVRE))) + +(system +((INPUT ring ! =X) & =A --> ( =A) ( |I see no bell here.|))) + +(system + ((PLACE LAWN ISIDE 5 4) + (INPUT OPEN ! =X) + & =A (LARGE-DOOR CLOSED) + --> ( =A) + ( |Didn't your mother teach you any manners?|) + ( |You shouldn't open someones door without their permission!|))) + +(system + ((PLACE LAWN ISIDE 5 4) + (LARGE-DOOR opened) + & =B (INPUT CLOSE ! =X) + & =A --> ( =A) + ( =B) + (LARGE-DOOR CLOSED) + ( |The door closes.|))) + +(system + ((PLACE LAWN ISIDE 5 4) + (SOUND IS ON) + --> ( |Muffled sounds can be heard inside.|))) + + (system +((PLACE lawn iside 8 8) (grave undug) +--> ( |There is a fresh grave here.|))) + +(system +((PLACE lawn iside 8 8) (grave undug) & =A +(INPUT dig ! =X) & =B --> ( =A) ( =B) +(grave dug) ( |Luckily, the dirt is soft.|))) + +(system +((PLACE lawn iside 8 8) (grave dug) +--> ( |There is a open grave.|))) + +(system +((PLACE lawn iside 8 8) (grave dug) +& =A (INPUT dig ! =x) & =B --> ( =A) ( =B) +(grave deep))) + +(system +((PLACE lawn iside 8 8) (grave deep) +--> ( |There is a large pipe that goes through the grave.|) +( |There is a lever on the pipe labelled 'Emergency Release.'|))) + +(system +((PLACE lawn iside 8 8) +(INPUT =x dirt ! =Y) & =A --> ( =A) +( |Hmmm.. I didn't understand that. I can only dig holes and fill in holes.|))) + +(system +((PLACE lawn iside 8 8) +(INPUT get dirt) & =A --> ( =A) +( |Sorry, that won't wash. I can only dig holes and fill in holes.|) +( |You can't get the dirt.|))) + +(system +((PLACE lawn iside 8 8) (INPUT +pull lever) & =A (grave deep) (time is =X) ( (fixed)) +( (grave oil)) --> ( =A) +( |Ummph!|) +(grave oil)(oil ( =x 30)))) + +(system +((PLACE lawn iside 8 8) (grave oil) +--> ( |There is oil seeping out of the pipe.|))) + +(system +((INPUT turn lever) & =A --> ( =A) (INPUT pull lever))) + +(system +((INPUT throw lever) & =A --> ( =A) (Input pull lever))) + +(system +((INPUT get lever) & =A --> ( =A) (INPUT pull lever))) + +(system +((INPUT =x lever) & =A --> ( =A) ( |I don't understand the word| ( =x) |as a verb for lever.|))) + +(system +((INPUT push lever) & =A --> (INPUT pull lever) ( =A))) + +(system +((INPUT close lever) & =A --> ( =A) (INPUT pull lever))) + +(system +((grave oil) (INPUT pull lever) & =A --> ( =A) ( +|The lever won't close, a special tool is needed! +The oil continues to seep out.|))) + +(system +((PLACE lawn iside 8 8) +(INPUT =x oil) & =a --> +( =A) ( |The oil is too slippery to do anything with it.|))) + +(system +((PLACE lawn iside 8 8) +(INPUT refill) & =A (walk =x) (grave =y) --> ( =A) +( |You are unable to affect the driver's digging.|))) + +(system +((PLACE lawn iside 8 8) +(INPUT refill) & =A (fixit =x) (grave =y) --> ( =A) +( |You are unable to affect the driver's work.|))) + +(system +((PLACE lawn iside 8 8) +(INPUT refill) & =A (grave oil) (grave deep) & =b --> +( =A) ( =b) (grave dug) ( |The oil still seeps out.|))) + +(system +((PLACE lawn iside 8 8) (grave deep) & =A +(INPUT refill) & =B --> ( =A) ( =B) +(grave dug))) + +(system +((PLACE lawn iside 8 8) (grave dug) & =A +(INPUT refill) & =B --> ( =A) ( =B) +(grave undug))) + +(system +((INPUT oil ! =x) & =A (PLACE lawn iside 8 8) +--> ( =A) ( |The oil is too slippery to use.|))) + +(system +((INPUT fill in ! =X) & =A --> ( =A) (INPUT refill))) + +(system +((INPUT fillin ! =X) & =A --> ( =A) (Input refill))) + +(system +((INPUT cover ! =x) & =A --> ( =A) (Input refill))) + +(system +((INPUT shovel ! =X) & =A --> ( =A) (INPUT dig))) + +(system +((INPUT scoop ! =X) & =A --> ( =A) (Input dig))) + +(system +((INPUT dig ! =X) & =A (PLACE lawn iside 8 8) +--> ( =A) ( |The ground is too hard to dig anymore.|))) + +(system +((INPUT refill ! =X) & =A (PLACE lawn iside 8 8) +--> ( =A) ( |The grave is filled.|))) + +(system +((grave dug) ( (got bone)) +--> (got bone) (in bone lawn iside 8 8))) + +(system +((fixed) (PLACE lawn iside 8 8) --> +( |The oil is not seeping out, the lever has been fixed but can not be pulled.|))) + +(system +((fixed) (PLACE lawn iside 8 8) (INPUT pull ! =X) & =A +--> ( =A) ( |The lever won't budge.|))) + (system +((sex male) & =A --> ( =A) ( |'I assume that is a human male.'|) + (MALE))) + +(system +((sex ( men m man)) & =A --> ( =A) (male))) + +(system +((sex little boy) & =A --> ( =A) (male) ( |'Hmm, so you go for the cute action.'|))) + +(system +((sex ( woman women f girl girls female)) & =A --> ( =A) (female))) + +(system +((sex girl) & =A --> ( =A) (female) ( |'Can't handle a woman!'|))) + +(system +((sex boy) & =A --> ( =A) (male) ( |'Can't handle a man I guess.'|))) + +(system +((sex cunt) & =A --> ( =A) (female) ( |'I assume that is French for female.'|))) + +(system +((sex) & =A --> ( =A) (wants eunuch) ( |'Well, I assume you are asexual, you poor dear.'|))) + +(system +((sex yes) & =A --> ( =A) ( |'Cute, but seriously ....'|) +findsex)) + +(system +((sex ( neither no none)) & =A --> ( =A) (sex))) + + +(system +((sex both) & =A --> ( =A) ( |'A little AC-DC huh? OK, but for this adventure pick one.'|) findsex)) + +(system +((name dracula) findsex --> (likes damsel) ( |'You won't drink my blood.'|))) + +(system +((sex moose) & =A --> ( =A) (wants moose) + ( |'Hmm, so you like a mate with a good rack.'|))) + +(system +((sex sheep) & =A --> ( =a) (wants sheep) +( |'They might be nice to cuddle up to on a winter's night,|) +( | but I've never found them to be good conversationalists.'|))) + +(system +((sex dead ! =X) & =A --> ( =A) (wants dead ! =X) +( |'So you're a NECRO.'|))) + +(system +((female) & =A --> ( =A) (wants damsel))) + +(system +((male) & =A --> ( =A) (wants prince))) + +(system +((sex me) & =X (name ! =Y) --> ( =x) (wants ! =Y) +( |'In this game you might even get to play with yourself.'|))) + +(system +((sex myself) & =X --> ( =X) (sex me))) + +(system +((name skins) --> ( |'Hey Dave'|))) + +(system +((name hook) --> ( |'Go for it Jon'|))) + +(system +((sex ! =X) & =A --> ( =A) (WANTS ! =X) +( |'Your mother would faint if she knew that.'|))) + +(system +((name ( +adam al alan allan allen albert alex alfred andrew andy arnold art +arthur basil ben benjamin bert bill billy bob bobby brian bruce burt +carl cecil charles charlie chris chuck craig dan danny david dave dean +dick don donald douglas doug drew dwight ed edward elliot ernie frank +fred gary gene george gerry glen gordon gregory greg gus guy hal hank +harold harry harvey henry howard hugh jack james jay jeff jerry jim joe +john jon joseph kenneth ken kirk larry leroy lester lou louis lyle mack +mark marvin matt mathew max michael mickey mike miles mitchell mitch +morris nat nathaniel ned nick paul pete peter phil philip phillip ralph +raoul ray raymond richard rich rick rob robert robin rodney roger ross +roy russell rusty sam samuel sandy scott steve steven stuart ted thomas +tim timothy tod tom tommy tommie tony victor vincent wally walter will +william Hook skins bzm predeep anoop pedro satish hans +) ! =X) +findsex --> +(likes damsel))) + +(system +((name ( +abby +amy anita ann anne annie april audrey babs barbara becky bess beth +betsy betty bonnie brenda bridget bunny candy carol carole karol carrie +cathy kathy cheryl christine cindy claudine cleopatra connie cynthia +dawn debby deborah denise diana diane dolly dinah donna doris dorothy +dotty dot edith elaine elizabeth emily eunice eve gail +gloria heather helen jackie jacqueline jan jane janet janice jean +jennifer jenny jessica jessie jill joan jody josephine joy joyce judith +judy julie karen kate katherine kathy kay kitty laura laverne linda +liza lisa lois loretta lucille lynn lynne mable mae maggie marcia marge +margaret marie marilyn marjorie mary maud may meg melissa michelle +mildred mindy molly monica nancy pamela pam pat patricia patty paula +pauline peggy penny rachel rebecca roberta rosie roxanne ruth sally +sandra sandy sarah sharon sheila sherry sheryl shirley sylvia stephanie +sue susan suzanne trudy vicky violet virginia vivian wanda wendy + ) ! =X) +findsex --> (likes prince))) + + (system +((PLACE lawn iside 8 5) (enter =X) --> +( |You see a truck outside at the gate.|))) + +(system +((PLACE lawn iside ( 6) 5) (enter =X) +(time is =X)(time is =X) (time is =X) (input ! =z) --> +( |The gates open and the truck enters. The gate closes before you can escape.|) +( |The truck says 'Oil line fixit' on the side.|) +( |The truck pulls in and parks on the drive.|) +( |The driver gets out and heads north east.|))) + +(system +((enter =x) (enter =x) (enter =X) (time is =X) (time is =X) (time is =X) +( (PLACE lawn iside ( 6) 5)) (input ! =z) --> +( |You hear a truck pull into the driveway and stop.|))) + +(system +((walk =X) (PLACE lawn iside 8 8) --> +( |The driver is digging to get a better angle on the pipe.|))) + +(system +((fixit =X) (PLACE lawn iside 8 8) --> +( |The driver is fixing the pipe.|))) + +(system +((fixit =x) (time is =X) (time is =X) (PLACE lawn iside 8 8) (input ! =z) --> +( |The driver is finished with the work, and heads back to the truck.|))) + +(system +((return =x) (return =X) (time is =X) (time is =X) (input ! =z) +(PLACE lawn iside ( 6) 5) --> +( |The man gets in the truck and backs out as the gate opens.|) +( |You are unable to escape as it leaves.|))) + +(system +((INPUT =X driver ! =Y) & =A --> ( =A) +( |You are unable to contact or make contact with the driver.|) +( |It is as if he doesn't know you are there.|))) + +(system +((INPUT get truck) (INPUT get truck) & =A --> +( =A) ( |The truck is a little heavy to get.|))) + +(system +((PLACE lawn iside 7 5) (in truck lawn iside 7 5) --> +( |There is a panel truck here.|))) + +(system +((PLACE lawn iside 7 5) (in truck lawn iside 7 5) (INPUT mount truck) & =A --> +( =A) ( |The truck is too tall to climb up on.|))) + +(system +((PLACE lawn iside 7 5) (in truck lawn iside 7 5) (INPUT open ! =Y) & =A --> +( =A) ( |The front doors are locked, but you were able to open the back.|) +(truck open))) + +(system +((inside truck)(in truck lawn iside 7 5) (INPUT open ! =Y) & =A --> +( |The back doors are now open.|) +( =A) (truck open))) + +(system +((PLACE lawn iside 7 5) (in truck lawn iside 7 5) (INPUT ( mount enter) ! =Y) & =A --> +( =A) ( |None of the doors are open.|))) + +(system +((in truck lawn iside 7 5) (truck open) & =B (INPUT close ! =Y) & =A +--> ( =A) ( =B) ( |Ok.|))) + +(system +((PLACE lawn iside 7 5) & =B (in truck lawn iside 7 5) +(truck open) (INPUT ( mount enter) ! =h) & =A +--> ( =B) ( =A) (inside truck) + ( |You are in the back of the truck.|))) + +(system +((inside truck) (INPUT look ! =X) & =A --> ( =A) +( |You are inside the panel truck. It is empty.|))) + +(system +((in truck lawn iside 7 5) (truck open) (inside truck) & =B +(return =y) (return =Y) (time is =Y) (time is =Y) (input ! =z) --> +( |As the truck starts up, it accelerates so fast that you fall out the back.|) + ( =B) (PLACE Lawn iside 7 5))) + +(system +((in truck lawn iside 7 5) (inside truck) & =b (return =y) & =a +(return =Y) (time is =Y) (time is =Y) (input ! =z) --> +( =a) ( =b) +( |VaVoom! The truck has started up.|) +( |Bump bump! You feel yourself being driven out of the yard.|) +(going out))) + +(system +((PLACE lawn iside 7 5) (in truck lawn iside 7 5) (truck open) (INPUT ( mount enter) ! =R) & =A +(holds =Y) --> ( =A) +( |The| ( =Y) |won't fit through the door!|))) + +(system +((going out) & =B --> ( =B) +( |As you drive by the gate you hear from the speaker:|) +( |'Good job son!'|) +( ||) +( |The truck drives on for a while then stops.|) +( |Your open the truck door and find that you are outside the walls.|) +( |You've escaped!|) +( ||) +( |In the distance you here the trumpeting of a bull moose.|) +( ||) +( |James Watt is here with a check for $10,000,000 to buy the land|) +( |for the Department of the Interior.|) +( |He assures you that the government will not sell the land, but admits|) +( |that he may allow some leasing of mineral rights. You have the option|) +( |of selling it and making big bucks, or you can donate, with the|) +( |restriction that it be perserved in its current state.|) +( |What is your choice? Sell, or donate?|) +(Selldonate ()))) + +(system +((Selldonate sell) & =a (score =x) & =b --> ( =a) ( =b) +( |Hmm. I don't think your father would have approved.|) +( |Oh my god! Out of the forest a moose comes charging at you.|) +( |He is coming right at you. You can't escape. |) +( |ARGHH! He gored you, but missed James Watt.|) +( |You're dead, what a bummer after what you have been through.|) +(input stop) +(score (<-> =x 20)))) + +(system +((selldonate =x) & =a --> ( =a) +( |Make up your mind, Sell or donate.|) +(selldonate ()))) + +(system +((selldonate donate) & =a (score =x) & =b --> ( =a) ( =b) +( |James Watt accuses you of being a reactionary idiot.|) +( |He stomps off, mumbling, 'Those strip miners are going|) +( |to be real disappointed', and walks right through a pile of moose turds.|) +( |I think you made the right decision.|) +(gone) (score (<+> =X 20)))) + +(system +((gone) --> (INPUT stop))) + +(system +((gone) & =A (score =X) & =B (in cube lawn ! =Y) --> +( =A) ( =B) (score (<-> =X 50)) +(INPUT stop) ( |The police bust into the yard of the house to collect|) +( |your treasure for you.|) +( |Unfortunately they find the sugar cube with the LSD in it.|) +( |You are arrested and thrown in jail for 50 years!!!!!|) +( |What a loser!|))) + +(system +((gone) & =A (score =X) & =B (in marijuana lawn ! =Y) --> +( =A) ( =B) (score (<-> =X 20)) +(INPUT stop) +( |The police bust into the yard of the house to collect your treasure for you.|) +( |They find the marijuana!! Luckily you are in the state of confusion|) +( |and you get a $5 fine, but lose the $300 worth of pot.|) +( |Oh well, maybe next time you'll enjoy it first.|))) + +(system +((inside truck) & =A (INPUT get out) & =B (truck open) --> +( =B) ( =A) (PLACE lawn iside 7 5))) + + (system +((holds jade) (score =Y) & =A ( (scored jade)) --> +( =A) (score (<+> =y 15)) (scored jade))) + +(system +((holds bone) (score =Y) & =A ( (scored bone)) --> +( =A) (score (<+> =y 15)) (scored bone))) + +(system +((holds gem) (score =Y) & =A ( (scored gem)) --> +( =A) (score (<+> =y 15)) (scored gem))) + + +(system +((in corkscrew lawn ! =X) --> + (yscored corkscrew))) + +(system +((in diamonds lawn ! =X) --> + (yscored diamond))) + +(system +((in jade lawn ! =X) --> + (yscored jade))) + +(system +((in bone lawn ! =X) --> + (yscored bone))) + +(system +((in gem lawn ! =X) --> + (yscored gem))) + +(system +((in chest lawn ! =X) --> + (yscored chest))) + +(system +((in horn lawn ! =X) --> + (yscored horn))) + +(system +((in gold lawn ! =X) --> + (yscored gold))) + +(system +((in football lawn ! =X) --> + (yscored football))) + +(system +((in stereo lawn ! =X) --> + (yscored stereo))) + +(system +((in ring lawn ! =X) --> + (yscored ring))) + +(system +((in candlesticks lawn ! =X) --> + (yscored candlesticks))) + +(system +((in marijuana lawn ! =X) --> + (yscored marijuana))) + +(system +((in cube lawn ! =X) --> + (yscored cube))) + +(system +((in conch lawn ! =x) --> + (yscored conch))) + +(system +((in money lawn ! =X) --> + (yscored money))) + +(system +((in painting lawn ! =X) --> + (yscored painting))) + +(system +((in bottle lawn ! =X) (inside water bottle) + --> (yscored bottle))) + +(system +((in pearls lawn ! =X) --> + (yscored pearls))) + +(system +((in chair lawn ! =X) --> + (yscored chair))) + +(system +((in coins lawn ! =X) --> + (Yscored coins))) + +(system +((yscored =X) & =A (xscore =X) (score =z) --> ( =A))) + +(system +((yscored =X) & =A (score =y) & =B --> ( =A) ( =B) +(score (<+> 5 =Y)) (xscore =X))) + +(system +((INPUT pour ! =X) (holds bottle) (PLACE ! =Y) (xscore yth) & =A +(score =z) & =b --> ( =A) ( =B) +(score (<-> =z 5)))) + +(system +((PLACE foyer) (xscore =X) & =A (holds =X) (score =Y) & =B --> +( =A) ( =B) (score (<-> =y 5)))) diff --git a/src/haunt/hauntp.mps b/src/haunt/hauntp.mps new file mode 100644 index 000000000..689dccfe2 --- /dev/null +++ b/src/haunt/hauntp.mps @@ -0,0 +1,2026 @@ + +(SYSTEM + (READ (TIME IS =X) + & =A --> ( =A) + ( | |) (INPUT ()) + (TIME IS ( =X 2)) READ)) + +(SYSTEM + ((INPUT ! =X) + & =A --> ( =A) + ( ( =X)))) + +(SYSTEM + ((INPUT =A =X) + & =B (PLACE ! =Y) + (IN =X ! /#Y) + --> ( =B) + ( |The| ( =X) |is not here.|))) + +(SYSTEM +((INPUT news) & =A --> ( =A) +( |Version 4.6, 6-21-82|) +( |As always, a few more bugs have been fixed.|) +( |Send gripes to John.Laird@CMUA.|) +( |Or John Laird, Computer Science Department, Carnegie-Mellon University|) +( | Pittsburgh, Pa. 15213|) +( |The max score is 440.|) +( |Copyright (C) 1979,1980,1981,1982 John E. Laird|))) + +(SYSTEM + ((INPUT XSTAT) & =A --> ( =A) ())) + +(SYSTEM + ((PLACE ! =X) + (WASAT ! =X) + --> ( |You are in| ( ! =X) |.|))) + +(SYSTEM + ((INPUT) + & =A --> ( =A) + ( ( NO-INPUT-ATN)))) + +(SYSTEM + ((INPUT =X =Y ON) & =A --> (INPUT =X ON =Y) ( =A))) + +(SYSTEM + ((INPUT =X =Y OFF) & =A --> (INPUT =X OFF =Y) ( =A))) + +(SYSTEM + ((PLACE ! =X) & =A (INPUT GAMMA ! =Y) & =B --> + ( =A) + ( =B) + (PLACE ! =Y))) + +(SYSTEM + ((INPUT =X THE ! =Y) & =A --> ( =A) (INPUT =X ! =Y))) + +(SYSTEM + ((INPUT =X =Y THE ! =Z) + & =A --> ( =A) + (INPUT =X =Y ! =Z))) + +(SYSTEM + ((INPUT =X A ! =Y) & =A --> ( =A) (INPUT =X ! =Y))) + +(SYSTEM + ((INPUT =X THEN ! =Y) + (Input =X THEN ! =Y) + (INPUT =X THEN ! =Y) & =Z (TIME IS =Q) --> + ( =Z) + (INPUT =X) + (TIME IS =Q) + (INPUT THEN ! =Y))) + +(SYSTEM + ((INPUT =X =Y THEN ! =Z) + (INPUT =X =Y THEN ! =Z) + (INPUT =X =Y THEN ! =Z) + & =Q (TIME IS =W) --> + ( =Q) + (INPUT =X =Y) + (TIME IS =W) + (INPUT THEN ! =Z))) + +(SYSTEM + ((INPUT =X =Y THEN =W IT ! =Z) + (INPUT =X =Y THEN =W IT ! =Z) + (INPUT =X =Y THEN =W IT ! =Z) & =Q + (TIME IS =T) --> + ( =Q) + (INPUT =X =Y) + (TIME IS =T) + (INPUT THEN =W =Y ! =Z))) + +(SYSTEM + ((INPUT =X =Y =N THEN ! =Z) + (INPUT =X =Y =N THEN ! =Z) + ( (INPUT =X then =N THEN ! =Z)) + & =Q (TIME IS =W) --> + ( =Q) + (INPUT =X =Y =N) + (TIME IS =W) + (INPUT THEN ! =Z))) + +(SYSTEM + ((INPUT THEN ! =Z) + (INPUT THEN ! =Z) + (INPUT THEN ! =Z) + (INPUT THEN ! =Z) & =A + (TIME IS =Y) & =B --> ( =B) ( =A) + (INPUT ! =Z) (time is ( =Y 2)))) + +(SYSTEM + ((INPUT =X it ! =W) (INPUT =X IT ! =W) & =A (HOLDS =Y) + --> ( =A) + (INPUT =X =Y ! =W))) + +(SYSTEM +((PLACE ! =Z) + (INPUT =X IT ! =W) + (INPUT =X it ! =W) + & =A (IN =Y ! =Z) + --> ( =A) + (INPUT =X =Y ! =W))) + +(SYSTEM +((INPUT N) & =A --> ( =A) (GOING N) (WENT N))) + +(SYSTEM +((INPUT S) & =A --> ( =A) (GOING S) (WENT S))) + +(SYSTEM +((INPUT E) & =A --> ( =A) (GOING E) (WENT E))) + +(SYSTEM +((INPUT W) & =A --> ( =A) (GOING W) (WENT W))) + +(SYSTEM +((INPUT U) & =A --> ( =A) (GOING U) (WENT U))) + +(SYSTEM +((INPUT D) & =A --> ( =A) (GOING D) (WENT D))) + +(SYSTEM + ((INPUT ( OUT LEAVE) ! =X) & =A --> (INPUT EXIT ! =X) ( =A))) + +(SYSTEM + ((INPUT get in ! =X) & =A --> ( =A) (INPUT enter ! =X))) + +(SYSTEM + ((INPUT ( WALKIN IN INSIDE) ! =X) & =A --> ( =A) (INPUT ENTER ! =X))) + +(SYSTEM + ((INPUT GO ! =X) & =A --> ( =A) (INPUT ! =X))) + +(SYSTEM +((INPUT WEST) & =A --> ( =A) (GOING W) (WENT W))) + +(SYSTEM +((INPUT EAST) & =A --> ( =A) (GOING E) (WENT E))) + +(SYSTEM +((INPUT NORTH) & =A --> ( =A) (GOING N) (WENT N))) + +(SYSTEM +((INPUT SOUTH) & =A --> ( =A) (GOING S) (WENT S))) + +(SYSTEM +((INPUT UP) & =A --> ( =A) (GOING U) (WENT U))) + +(SYSTEM +((INPUT DOWN) & =A --> ( =A) (GOING D) (WENT D))) + +(SYSTEM +((GOING N) --> NOWAY)) + +(SYSTEM +((GOING S) --> NOWAY)) + +(SYSTEM +((GOING W) --> NOWAY)) + +(SYSTEM +((GOING E) --> NOWAY)) + +(SYSTEM +((GOING D) & =A --> ( =A) ( |You can't go down from here.|))) + +(SYSTEM +((GOING U) & =A --> ( =A) ( |There is nothing to go up on.|))) + +(SYSTEM + (NOWAY + & =A (GOING =N) + & =C --> ( ( BAD-DIRECTION-ATN)) + ( =C) + ( =A))) + +(SYSTEM + ((WENT W) (INPUT RIGHT) & =B --> (GOING N) (WENT N) ( =B))) + +(SYSTEM + ((WENT W) (INPUT FORWARD) & =B --> (GOING W) (WENT W) ( =B))) + +(SYSTEM + ((WENT S) (INPUT LEFT) & =B --> (GOING E) (WENT E) ( =B))) + +(SYSTEM + ((WENT E) (INPUT LEFT) & =B --> (GOING N) (WENT N) ( =B))) + +(SYSTEM + ((WENT E) (INPUT RIGHT) & =B --> (GOING S) (WENT S) ( =B))) + +(SYSTEM + ((WENT E) (INPUT FORWARD) & =B --> (GOING E) (WENT E) ( =B))) + +(SYSTEM + ((WENT E) (INPUT BACK) & =B --> (GOING W) (WENT W) ( =B))) + +(SYSTEM + ((WENT S) (INPUT RIGHT) & =B --> (GOING W) (WENT W) ( =B))) + +(SYSTEM + ((WENT S) (INPUT FORWARD) & =B --> (GOING S) (WENT S) ( =B))) + +(SYSTEM + ((WENT S) (INPUT BACK) & =B --> (GOING N) (WENT N) ( =B))) + +(SYSTEM + ((WENT N) (INPUT LEFT) & =B --> (GOING W) (WENT W) ( =B))) + +(SYSTEM + ((WENT N) (INPUT RIGHT) & =B --> (GOING E) (WENT E) ( =B))) + +(SYSTEM + ((WENT N) (INPUT FORWARD) & =B --> (GOING N) (WENT N) ( =B))) + +(SYSTEM + ((WENT N) (INPUT BACK) & =B --> (GOING S) (WENT S) ( =B))) + +(SYSTEM + ((WENT W) (INPUT LEFT) & =B --> (GOING S) (WENT S) ( =B))) + +(SYSTEM + ((WENT U) (INPUT FORWARD) & =B --> (GOING U) (WENT U) ( =B))) + +(SYSTEM + ((WENT D) (INPUT FORWARD) & =B --> (GOING D) (WENT D) ( =B))) + +(SYSTEM + ((WENT U) (INPUT BACK) & =B --> (GOING D) (WENT D) ( =B))) + +(SYSTEM + ((WENT D) (INPUT BACK) & =B --> (GOING U) (WENT U) ( =B))) + +(SYSTEM + ((WENT W) (INPUT BACK) & =B --> (GOING E) (WENT E) ( =B))) + +(SYSTEM + ((INPUT AHEAD) & =A --> ( =A) (INPUT FORWARD))) + +(SYSTEM + ((INPUT DIRECTION ! =X) + & =A (WENT =Y) + --> ( =A) + ( |You are facing | =Y))) + +(SYSTEM + ((INPUT EXIT ! =X) & =A --> ( =A) (INPUT BACK))) + +(SYSTEM + ((INPUT ENTER ! =X) + & =A --> ( =A) + ( |I don't know how to enter| ( ! =X)|.|))) + +(SYSTEM +((INPUT GO) & =A --> (INPUT FORWARD) ( =A))) + +(SYSTEM + ((INPUT get all) (PLACE ! =x) (in =n ! =X) --> + ( =A) (INPUT get =n))) + +(SYSTEM + ((INPUT get all) & =A --> ( =A) ( |OK, all done.|))) + +(SYSTEM + ((INPUT GET =P ! =x) + & =A (HOLDS =P) + --> ( =A) + ( |You already have| ( =P)) + (HOLDS =P))) + +(SYSTEM + ((INPUT GET =P ! =X) + & =A --> ( =A) + ( |I don't know how to get| ( =P)))) + +(SYSTEM + ((INPUT GET =n ! =X) + & =A (PLACE ! =p) + (IN =n ! =p) + & =B --> ( =A) + ( =B) + (HOLDS =n) + ( ( HAVE-ATN) ( =n) |.|))) + +(SYSTEM + ((INPUT get monster) & =A + (PLACE laboratory) + (IN monster laboratory) --> + ( =A) + ( |That would be a big mistake.|))) + +(SYSTEM +((INPUT get cecil) & =A (PLACE ! =X) (in cecil ! =X) --> ( =A) +( |Cecil is a free spirit. He doesn't come with you.|))) + +(SYSTEM + ((INPUT ( pull pickup grab pry lift take carry) ! =X) & =A --> + ( =A) (INPUT GET ! =X))) + +(SYSTEM + ((INPUT PICK UP ! =X) & =A --> (INPUT GET ! =X) ( =A))) + +(SYSTEM +((INPUT drop all) & =A --> ( =A) ( |All dropped.|))) + +(SYSTEM +((INPUT drop all) (PLACE ! =p) (HOLDS =n) --> + (INPUT drop =n))) + +(SYSTEM + ((INPUT DROP =X) + & =B (PLACE ! =Y) + (HOLDS =X) + & =A --> ( =B) + ( =A) + (IN =X ! =Y))) + +(SYSTEM + ((INPUT RELEASE =X) & =A --> ( =A) (INPUT DROP =X))) + +(SYSTEM + ((INPUT DISCARD =X) & =A --> ( =A) (INPUT DROP =X))) + +(SYSTEM + ((INPUT DROP =X) + & =A --> ( =A) + ( |You don't have| ( =X)))) + +(SYSTEM + ((INPUT PUT DOWN =X) & =A --> ( =A) (INPUT DROP =X))) + +(SYSTEM + ((INPUT TAKE OFF ! =X) + & =A --> ( =A) + (INPUT REMOVE ! =X))) + +(system + ((input who is bzm ! =x) & =a --> + ( =a) ( |A famous graduate of CMU CSD|))) + +(SYSTEM + ((INPUT INVEN) (HOLDS =P) --> ( ( =P)))) + +(SYSTEM +((INPUT INVEN) & =A --> ( =A))) + +(SYSTEM + ((INPUT INVEN) + (INPUT INVEN) + --> ( |You have the following/:|))) + +(SYSTEM + ((INPUT INVENTORY) & =A --> ( =A) (INPUT INVEN))) + +(SYSTEM + ((INPUT INVEN) + (HOLDS =P) + (INSIDE =C =P) + --> ( ( =C)))) + +(SYSTEM +((INPUT INVEN) (INPUT INVEN) & =A ( (HOLDS ! =X)) --> ( =A) +( |You're empty handed.|))) + +(SYSTEM +((INPUT run ! =X) & =A --> ( =A) + ( |I'm going as fast as I can.|))) + +(SYSTEM +((INPUT run =X) & =A --> ( =A) (INPUT =X) + ( |I can't go any faster.|))) + +(SYSTEM +((INPUT listen) & =A --> ( =A) ( |Silence!|))) + +(system +((INPUT listen) & =A (sound is on) --> ( =A) +( (sound is on)))) + +(system +((PLACE stairs) (sound is on) --> ( |The sound is coming from above you.|))) + + +(SYSTEM +((INPUT whistle) & =A --> ( =A) ( +|What, without an accompanying orchestra?|))) + +(SYSTEM +((INPUT hum) & =A --> ( =A) ( +|Hum de dum de dum, hum hum dum dum de dum.|))) + +(SYSTEM +((INPUT sing ! =k) & =A --> ( =A) ( |In-A-Gadda-Da-Vida Baby, don't you know that I love you.|))) + +(SYSTEM +((INPUT mumble) & =A --> ( =A) ( ( MUM-ATN)))) + +(SYSTEM + ((INPUT STOP) --> ( |The party's over.|) HALT)) + +(SYSTEM + ((INPUT quit) --> ( |See you later.|) HALT)) + +(SYSTEM + ((INPUT halt) --> ( |Bye now.|) HALT)) + +(SYSTEM +(DIE DIE ( DIED)(HOLDS =x) & =A --> ( =A) (IN =X closet))) + +(SYSTEM +(DIE DIE (INPUT ! =X) & =A --> ( =A))) + +(SYSTEM +(DIE DIE DIED --> HALT)) + +(SYSTEM +(DIE & =b (PLACE ! =x) & =A (score =Q) & =C --> ( =B) +( =C) (PLACE foyer) ( =A) (score (<-> =Q 20)) +DIED ( |Well, looks like you're dead.|) +( |But before the last neuron in your brain was destroyed, a|) +( |10th level Cleric came by and waved his hand.|))) + +(SYSTEM + ((INPUT ( examine describe) ! =X) & =A --> + ( =A) (INPUT LOOK ! =X))) + +(SYSTEM + ((INPUT LOOK ! =X) + & =A (PLACE ! =Y) + --> ( (WASAT ! =Y)) + ( =A) +( (PLACE ! =Y)))) + +(SYSTEM + ((INPUT KILL ! =X) + & =A --> ( =A) + ( |With what? Your bare hands?|))) + +(SYSTEM + ((PLACE ! =z) (In =x ! =z) (INPUT KILL =X WITH ! =Y) & =A --> + ( =A) ( |Even with that you can't kill it.|))) + +(SYSTEM + ((INPUT throw football ! =X) & =A --> + ( =A) ( |You don't have a football Dummy!|))) + +(SYSTEM + ((INPUT THROW ! =X) + & =A --> ( =A) + ( |I don't throw anything but a regulation NFL football.|))) + +(SYSTEM +((INPUT throw up) & =A --> ( =a) ( |I don't have the stomach for that.|))) + +(SYSTEM + ((INPUT CUT ! =X) + & =A --> ( =A) + ( |There is nothing to cut with.|))) + +(system + ((INPUT cut =x with =Y) & =A +--> ( =A) ( |The| ( =Y) |won't cut the| + ( =X) |.|))) + +(SYSTEM + ((INPUT CUT CHEESE) + & =A --> ( =A) + ( |Look, this room is smelly enough already without that.|))) + +(SYSTEM + ((INPUT BREAK ! =X) + & =A --> ( =A) + ( |You hurt your hand.|))) + +(SYSTEM + ((INPUT BUST BUST)(INPUT bust bust) +$ =A --> ( =A) + ( |Homer looks hurt.|))) + +(SYSTEM + ((INPUT KICK =X ! =Y) + & =A --> ( =A) + ( |Ouch! The| ( =X) |kicks back.|))) + +(system +((INPUT kick =X) & =A (HOLDS =x) & =B (PLACE ! =Y) --> ( =A) +( =B) +( |Thud! Not much of a kicker I see.|) +(in =x ! =Y))) + +(system +((INPUT kick football) & =A --> ( =A) +( |I see no football here.|))) + +(SYSTEM +((INPUT punt ! =X) & =A --> ( =A) (INPUT kick ! =X))) + +(SYSTEM + ((INPUT JUMP ! =X) + & =A --> ( =A) + ( |Up you go, down you come.|))) + +(SYSTEM + ((INPUT BURN ! =X) + & =A --> ( =A) + ( |You can't burn| ( ! =X) |without matches.|))) + +(SYSTEM + ((INPUT BURN ! =X) + & =A (HOLDS MATCHES) + --> ( =A) + ( |You may have matches, but you didn't light one.|))) + +(SYSTEM + ((INPUT OPEN ! =X) + & =A --> ( =A) + ( ( NOTCLOSED-ATN)))) + +(SYSTEM +((INPUT open chest) & =A --> ( =A) + ( |The chest can't be opened, but it is worth mucho closed.|))) + +(SYSTEM + ((INPUT HELP ! =X) + & =A --> ( =A) + ( ( HELP-ATN)))) + +(SYSTEM + ((INPUT YES ! =X) + & =A --> ( =A) + (said YES) +( |Cute, but lets get on with the show.|))) + +(system +((input no ! =x) & =a --> +( =a) ( |That was rhetorical you fool.|))) + +(system +((Input spit ! =x) & =a --> +( =a) ( |Your throat is too dry.|))) + +(SYSTEM + ((INPUT WHERE ! =X) + & =A --> ( =A) + ( |I don't know where| ! =X |. I hope we aren't lost!!|))) + +(SYSTEM + ((INPUT FIND ! =X) + & =A --> ( =A) + ( |That would be cheating if I did it.|))) + +(SYSTEM + ((INPUT DRINK ! =A) + & =B --> ( =B) + ( |The| ( ! =A) |is not drinkable.|))) + +(SYSTEM +((INPUT DRINK) & =A +--> ( =A) +( |I don't know what to drink.|))) + +(SYSTEM + ((INPUT SCREW ! =A) + & =B --> ( =B) + ( |Sorry, but i don't have a screw driver.|))) + +(SYSTEM + ((INPUT FUCK ! =A) + & =B --> ( =B) + ( |That would be pretty kinky.|))) + +(SYSTEM + ((INPUT FUCK BUST) + & =A --> ( =A) + ( |Homer is harder than you are.|))) + +(SYSTEM + ((INPUT COPULATE ! =X) & =A --> ( =A) (INPUT FUCK ! =X))) + +(SYSTEM + ((INPUT FUCK ! =X) + & =A (wears wetsuit) + --> ( =A) + ( |You can't do that with a wetsuit on!|))) + +(SYSTEM + ((INPUT UP YOURS ! =X) + & =A --> ( =A) + ( |Up your own.|))) + +(SYSTEM + ((INPUT OH ! =X) + & =A --> ( =A) + ( |Isn't life a pisser?|))) + +(system +((INPUT oh) & =A --> ( =A) ( |Mais oui.|))) + +(SYSTEM +((INPUT shit ! =X) & =A --> ( =A) ( |Hey, let's not mess up the PLACE!|))) + + +(SYSTEM + ((INPUT RAPE ! =X) & =A --> ( =A) (INPUT TORTURE ! =X))) + +(SYSTEM + ((INPUT KISS ! =X) & =A --> ( =A) ( |SMACK!|))) + +(SYSTEM +((INPUT ball ! =X) & =A --> ( =A) (INPUT fuck ! =X))) + +(SYSTEM +((INPUT hump ! =x) & =A --> ( =A) (INput fuck ! =X))) + +(SYSTEM +((INPUT Make love) & =A (likes ! =X) --> ( =A) (Input fuck ! =X))) + +(SYSTEM +((INPUT GOD DAMN) & =A --> ( =A) (INPUT pray))) + +(system +((INPUT DAMn ! =X) & =A --> ( =A) ( |Clean up your act.|))) + +(system +((INPUT masturbate ! =X) & =A --> ( =A) +( |You're too scared to get aroused at all.|))) + +(system +((PLACE torture chamber) (INPUT masturbate ! =X) & =A DAMSEL-FREE +--> ( =A) ( |I think you can get some help from your friend.|))) + +(SYSTEM +((INPUT mount ! =X) & =A --> ( =A) (going u) (WENT U))) + +(SYSTEM +((INPUT stand on ! =X) & =A --> ( =A) (INPUT mount ! =X))) + +(SYSTEM + ((INPUT GET ON ! =X) & =A --> ( =A) (INPUT MOUNT ! =X))) + +(SYSTEM + ((INPUT CLIMB ON ! =X) & =A --> ( =A) (INPUT MOUNT ! =X))) + +(SYSTEM + ((INPUT climb ! =X) & =A --> ( =A) (going u) (WENT U))) + +(SYSTEM + ((INPUT GET OFF ! =X) & =A --> ( =A) (GOING D) (WENT U))) + +(SYSTEM + ((INPUT GET DOWN ! =X) & =A --> ( =A) (GOING D) (WENT D))) + +(SYSTEM + ((INPUT DISMOUNT ! =X) + & =A + --> ( =A) + (GOING D) (WENT D))) + +(SYSTEM + ((INPUT TINGLE) + & =A --> ( =A) + ( |Nothing happens.|))) + +(SYSTEM + ((INPUT BLOW ! =X) + & =A --> ( =A) + ( |Whoooooosh!|))) + +(SYSTEM +((INPUT knock ! =X) & =A --> ( =A) ( |Thud, thud.|))) + +(SYSTEM + ((INPUT EAT ! =X) + & =A --> ( =A) +( |That is not part of a balanced diet.|))) + +(SYSTEM + ((INPUT EAT =X ! =Y) + & =A (IN =X ! =Z) + --> ( =A) + ( |You don't have| ( =X) |on you.|))) + +(SYSTEM +((INPUT eat shit) & =A --> ( =A) ( |YEACH! Fuck OFF!|))) + +(SYSTEM +((INPUT go to hell) & =A --> ( =A) ( |Oh yeah! I'm fed up with you!!|) +HALT)) + +(SYSTEM +((INPUT =x moose) & =A --> ( =A) ( |I see no moose.|))) + +(SYSTEM +((INPUT go blue) & =A --> ( =A) ( |Beat State.|))) + +(SYSTEM +((INPUT pray ! =X) & =A --> ( =A) +( |GOD responds/:|) (INPUT help))) + +(SYSTEM + ((INPUT ( fondle cuddle hug rub tap FEEL) ! =X) & =A +--> ( =A) (INPUT TOUCH ! =X))) + +(SYSTEM + ((INPUT TOUCH =X) + & =A (HOLDS =X) + --> ( =A) + ( |It is in your hands, and it feels like a| ( =X) |.|))) + +(SYSTEM + ((INPUT TOUCH WALL) + & =A --> ( =A) + ( |Surprize! The wall is flat and cold.|))) + +(SYSTEM + ((INPUT TOUCH PAINTING) + & =A (HOLDS PAINTING) + --> ( =A) + ( |The painting is still wet!!|))) + +(SYSTEM + ((INPUT TOUCH ! =X) + & =A --> ( =A) + ( |You should get it first.|))) + +(SYSTEM +((INPUT touch ! =X) & =A (likes ! =X) (PLACE torture chamber) +DAMSEL-FREE --> ( =A) +( |That's a start. Your friend is enjoying it.|))) + +(system +((INPUT touch her) & =A (likes ! =X) (PlACE torture chamber) --> +( =A) +( |Hmm. She likes that.|))) + +(system +((INPUT touch him) & =A (likes ! =X) (PLACE torture chamber) +DAMSEL-FREE --> ( =A ) +( |Hmm. He likes that.|))) + +(SYSTEM +((INPUT sit in ! =X) & =A --> ( =A) (INPUT sit on ! =X))) + +(SYSTEM +((INPUT sit ! =X) & =A --> ( =A) ( |I don't know how to sit on it.|))) + +(SYSTEM + ((ONTOP =Q) + & =A (GOING D) (GOING D) + & =B --> ( =A) + ( =B) + ( |You are back on Terra Firma.|))) + +(SYSTEM + ((ONTOP =Q) & =A +(going =x) (GOING =X) + & =Y --> ( =Y) +( =A) ( |You just fell to the ground.|)(input look))) + +(SYSTEM +((siton =q) & =A (going =X) (going =X) --> ( =A))) + +(SYSTEM +((siton =q) & =A (INPUT get up) & =B --> ( =A) +( =B) ( |You are now standing.|))) + +(SYSTEM +((siton =Q) & =A (INPUT stand ! =X) & =B --> ( =A) +( =B) ( |You are no longer sitting.|))) + +(SYSTEM +((siton =Q) (INPUT get =Q) & =A --> + ( =A) ( |You'll have to stand up first.|))) + +(SYSTEM +((ontop =Q) (Input get =Q) & =A --> + ( =A) ( |Cute, why don't you get off it first.|))) + +(SYSTEM +((HOLDS =X) (INPUT mount =X) & =A --> ( =A) +( |Why don't you drop it first.|))) + +(SYSTEM +((INPUT open sesame) & =A -->( =A) ( |No says me!|))) + +(SYSTEM +((INPUT I ! =X) & =A --> ( =A) +( |Quit talking about yourself and give me a command.|))) + +(SYSTEM +((INPUT give =X to ! =Y) & =A --> ( =A) +( |The| ( ! =Y) |doesn't take| ( =X)))) + +(SYSTEM +((INPUT give =x =y) & =A --> ( =A) +( |The| ( =x) |doesn't want| ( =y)))) + +(SYSTEM +((INPUT give =x) & =A (Holds =x) --> ( =A) +( |Hey, after we went through all the trouble to get |) +( ( =x) |I ain't gonna let you give it away.|))) + +(SYSTEM +((INPUT give ! =x) & =A --> ( =a) +( |First we should get it.|))) + +(SYSTEM +((INPUT follow moose) & =A (time /00/:02) --> ( =A) +( |Crash!! Into the wall you go.|))) + +(system +((INPUT follow moose) & =A (time /00/:02) (PLACE bus stop) --> +( =A) ( |Last I saw he went west, so away we go.|) +(INPUT west))) + +(system +((INPUT follow moose) & =A --> ( =A) ( |I see no moose here.|))) + +(SYSTEM +((INPUT swim) & =A --> ( =A) +( |Why don't you wait until we are in the water.|))) + + +(System +((PLACE LAWN ISIDE 8 8) (HOLDS BOTTLE) (GRAVE OIL) + (INPUT FILL BOTTLE ! =X) & =A --> ( =A) +( |The oil won't go into the bottle, sorry.|))) + +(SYSTEM +((PLACE LAWN ISIDE 8 8) (HOLDS BOTTLE) (GRAVE OIL) + (INPUT GET OIL ! =X) & =A --> ( =A) +( |The oil is too thick to go into the bottle.|))) + +(System +((PLACE ! =X) (in bottle ! =X) ( (inside =q bottle)) +--> ( |There is an empty bottle here.|))) + +(System +((PLACE ! =X) (In bottle ! =X) (inside =q bottle) +--> ( |There is a bottle of| ( =q) |here.|))) + +(System +((PLACE ! =X) (In bottle ! =X) & =B (inside =q bottle) (INPUT get =q) & =A +--> ( =A) ( =B) (HOLDS bottle) +( |You are now holding the bottle.|))) + +(system +((HOLDS bottle) ( (inside =q bottle)) +(INPUT fill bottle ! =g) & =A (PLACE bathroom) --> +( =A) (inside bathwater bottle) ( |The bottle is full of bathwater.|))) + +(system +((HOLDS bottle) ( (inside =q bottle)) +(INPUT fill bottle ! =g) & =A (PLACE beach 3) --> +( =A) (inside water bottle) ( |The bottle is full of sparkling water.|))) + +(system +((PLACE beach 3) (INPUT pour ! =X) & =A + (HOLDS bottle) (inside =Q bottle) & =B +--> ( =a) ( =b) ( |The bottle is empty.|))) + +(system +((PLACE bathroom) (INPUT pour ! =X) & =A + (HOLDS bottle) (inside =Q bottle) & =B +--> ( =a) ( =b) ( |The bottle is empty.|))) + +(system +((HOLDS bottle) ( (inside =Q bottle)) +(INPUT fill bottle ! =g) & =A UNDERWATER --> +( =A) (inside seawater bottle) ( |The bottle is full of seawater.|))) + +(system +((INPUT get water ! =x) & =A --> ( =A) +(INPUT fill bottle ))) + +(system +((INPUT get seawater ! =X) & =A --> ( =A) +(INPUT fill bottle ))) + +(system +((INPUT get bathwater ! =X) & =A --> ( =A) +(INPUT fill bottle ))) + +(system +((INPUT fill up ! =X) & =A --> ( =A) +(INPUT fill bottle))) + +(system +((HOLDS bottle) ( (iside =q bottle)) +(INPUT fill bottle ! =g) & =A --> ( =A) +( |There is nothing to fill the bottle with.|))) + +(system +((HOLDS bottle) (iside =q bottle) (INPUT fill bottle ! =g) & =A +--> ( =A) ( |The bottle is already full.|))) + +(system +((INPUT fill bottle ! =g) & =A --> ( =A) +( |You don't have a bottle to fill.|))) + +(system +((INPUT pour ! =X) & =A (INPUT pour ! =X) UNDERWATER --> +( =A) ( |Hmm, you want me to empty a bottle underwater.|) +( |I'm afraid that is out of my league.|))) + +(SYSTEM +((ON water ! =x) (PLACE ! =X) --> +( |There is a wet spot here.|))) + +(SYSTEM +((ON seawater ! =X) (PLACE ! =X) --> +( |There is a salty wet spot here.|))) + +(SYSTEM +((Place ! =X) (ON BATHWATER ! =X) --> +( |There is a bit of a wet spot here.|))) + +(system +((PLACE ! =X) (on turpentine ! =X) & =A --> ( =A) +( |The turpentine evaporates as it leaves the bottle.|))) + + +(System +((HOLDS bottle) & =B (inside =q bottle) (INPUT drop =Q ! =X) & =A + (PLACE ! =y) --> ( =A) ( =b) +(in bottle ! =Y))) + +(system +((HOLDS bottle) (inside =q bottle) & =A (Input pour ! =X) & =b +(PLACE ! =Y) +--> ( =a) ( =B) ( (on =q ! =Y)))) + +(system +((PLACE ! =X) (on =q ! =X) (INPUT fill bottle ! =g) & =A --> ( =A) +( |Sorry, I don't have a mop!|))) + +(system +((INPUT empty ! =x) & =A --> ( =A) (INPUT pour))) + +(system +((INPUT water ! =X) & =A --> ( =A) (Input pour))) + +(system +((INPUT pour ! =X) & =A --> ( =A) +( |You don't have a bottle full of anything.|))) + +(system +((INPUT drink ! =X) & =A (HOLDS bottle) (inside =Q bottle) & =B +--> ( =A) ( =B) ( |I love that| +( ! =X) |for breakfast every morning.|))) + +(system +((PLACE beach =u) (HOLDS bottle) (INPUT get sand ! =X) & =A +--> ( =A) ( |The sand clogs in the neck of the bottle.|) +( |For all practical purposes you can't get any sand.|))) + +(system +((PLACE beach =u) (HOLDS bottle) (INPUT fill bottle ! =X) & =A +--> ( =A) (INPUT get sand))) + +(SYSTEM +((PLACE cheese room) (INPUT eat cheese) & =A --> + ( =a) ( |The only cheese here is the walls.|))) + +(SYSTEM +((PLACE ! =X) +(in corkscrew ! =X) +--> ( |There is a diamond studded corkscrew here!|))) + +(SYSTEM +((HOLDS corkscrew) (INPUT screw ! =X) & =A --> ( +|Cork screwing is a little out of my league.|) ( =A))) + +(SYSTEM + ((PLACE ! =X) (IN RING ! =X) + --> ( |There is a huge diamond ring here.|))) + +(SYSTEM + ((PLACE ! =X) + (IN CANDY ! =X) + --> ( |There is a bowl of candy on the ground.|))) + +(SYSTEM + ((INPUT =X BOWL) & =A --> ( =A) (INPUT =X CANDY))) + +(SYSTEM + ((PLACE ! =X) + (IN CANDY ! =x) + & =A (INPUT EAT CANDY) + & =B --> ( |Candy tastes good; uhm!|) + ( |Of course the pins in the Snickers take a little chewing.|) + ( =A) + ( =B))) + +(SYSTEM + ((HOLDS CANDY) + & =B (INPUT EAT CANDY) + & =A --> ( |You eat the candy; and get cavities.|) + ( =A) + ( =B))) + +(SYSTEM + ((PLACE ! =X) (IN MARIJUANA ! =X) + --> ( |There is some fine marijuana here! Good stuff.|))) + +(system +((INPUT burn ! =X) & =A +(HOLDS matches) (PLACE lawn ! =Y) --> ( =A) +( |The matches go out before you can burn| ( ! =X)))) + +(SYSTEM + ((HOLDS MARIJUANA) & =d +(INPUT SMOKE MARIJUANA) & =B + (HOLDS MATCHES) & =C + (PLACE LAWN ! =X) +--> + ( =B) + ( =C) + ( =D) + (HUNGRY) + ( |You manage to light up,|) + ( |the matches haved dried out here, this very expensive stuff.|) + ( |Its very smooth, you begin to think you really don't|) + ( |need to adventure anymore. You are hungry.|))) + +(SYSTEM + ((HOLDS MARIJUANA) + (INPUT SMOKE MARIJUANA) + & =C --> ( =C) + ( |You don't have any matches.|))) + +(system + ((input smoke marijuana) & =a --> + ( =a) ( |You don't have any.|))) + +(SYSTEM +((HOLDS marijuana) (INPUT smoke marijuana) & =A (HOLDS matches) +--> ( =A) ( |The matches are wet.|))) + +(SYSTEM +((hungry) (HOLDS =X) --> ( |Let's eat| ( =x)) (INPUT eat =X))) + +(SYSTEM +((hungry) & =A --> ( =A))) + +(SYSTEM +((PLACE ! =X) (INPUT =Y ( maryjane Marihuana dope grass pot)) & =A --> +( =A) +(INPUT =Y marijuana))) + +(system +((PLACE ! =X) (INPUT ( smoke light burn) marijuana ! =y) & =A --> +( =A) (INPUT smoke marijuana))) + +(SYSTEM + ((PLACE ! =X) (IN CUBE ! =X) + --> ( |There is a small white cube here.|))) + +(SYSTEM + ((HOLDS CUBE) + (INPUT LICK CUBE) + & =A --> ( =A) + ( |UHM! That tasted good!!!|))) + +(system + ((HOLDS CUBE) (INPUT TASTE CUBE) & =A --> +( |To taste it you should really eat the cube.|) ( =A))) + +(SYSTEM + ((HOLDS CUBE) & =c + (HOLDS WATCH) + (INPUT EAT CUBE) + & =A +--> ( =A) ( =c) + ( |The cube tastes like sugar. You are suddenly surrounded by|) + ( |a herd of moose. They start talking to you about a moose-load of things.|) +( |One walks over to you and whispers, 'Fa Lowe, why her?'|) +( |You look at your watch , but the hands suddenly spin!|) + ( |You find yourself staring at the|) + ( |m|) +( | o|) +( | o|) +( | s|) +( | e|) +( | ?|) +( | for a long time, and enjoying it.|))) + +(SYSTEM + ((HOLDS CUBE) & =c + (INPUT EAT CUBE) + & =A +--> ( =A) ( =c) + ( |The cube tastes like sugar. You are suddenly surrounded by|) + ( |a herd of moose. They start talking to you about a moose-load of things.|) +( |One walks over to you and whispers, 'Fa Lowe, why her?'|) + ( |You find yourself staring at your toes|) +( | for a long time, and enjoying it.|))) + +(SYSTEM + ((HOLDS CUBE) & =B + (INPUT EAT CUBE) + & =A + (PLACE KITCHEN) + --> ( =A) ( =B) + ( |That was sweet!|) + ( |This kitchen is a real deary PLACE!! A bad PLACE to take acid.|) +( |You have to get out of here!!|) +( |You feel on fire, you need water to cool off.|) + (INPUT + W THEN PUSH BUTTON THEN N THEN PUSH B THEN EXIT THEN PUSH RED BUTTON))) + +(SYSTEM +((INPUT =X WHITE CUBE) & =A --> ( =A) (INPUT =X CUBE))) + +(SYSTEM +((INPUT =X ACID) & =A --> ( =A) (INPUT =X cube))) + +(system +((INPUT =x sugar ) & =A --> ( =A) (INPUT =x cube))) + +(SYSTEM + ((PLACE ! =X) (CANCERTIME IS =TIME) & =A + (TIME IS =TIME) + (TIME IS =TIME) + (LIKES ! =B) + --> +( =A) + ( |Your wicked and lusty life has finally caught up with you.|) + ( |That cigarette you had with the| ( ! =B) |has caused cancer to|) + ( |spread throughout your lungs. COUGH!! COUGH!! You are|) + ( |weakening. Hack! You're down on your knees. COUGH COUGH!!|) + ( |You keel over and die....|) + HALT)) + +(SYSTEM + ((PLACE ! =X) (IN MATCHES ! =X) + --> ( |There are matches here.|))) + +(SYSTEM + ((HOLDS MATCHES) + (INPUT =x MATCH) + & =A --> ( =A) + (INPUT =x matches))) + +(system +((HOLDS matches) +(INPUT ( light strike dry) matches) & =A +--> ( =A) ( |This house is to damp to light the matches in.|))) + +(system +((PLACE lawn ! =X) (HOLDS matches) (INPUT dry matches) & =A +--> ( =A) ( |The matches dry out.|))) + +(system +((PLACE lawn ! =X) (HOLDS matches) (INPUT ( light strike) matches) +& =A --> ( =A) ( |The match lights but goes out quickly.|))) + +(system +((INPUT smoke =x) & =a (in =x ! =y) --> ( =A) + ( |You're not holding it.|))) + +(system +((INPUT light Marijuana ! =X) & =A --> ( =A) +(INPUT smoke marijuana))) + +(SYSTEM + ((PLACE ! =X) (IN FOOTBALL ! =X) + --> ( |There is an official NFL football here!|))) + +(SYSTEM + ((PLACE ! =X) (HOLDS FOOTBALL) + & =A (INPUT KICK FOOTBALL ! =z) + & =B + --> ( =B) + ( =A) + ( |Oh wow! You kick it around,|) + ( |luckily nothing breaks.|) + (IN FOOTBALL ! =X))) + +(SYSTEM + ((HOLDS FOOTBALL) + & =A (INPUT THROW FOOTBALL ! =X) + & =B (PLACE ! =Y) + --> ( =A) + ( =B) + ( |Throw is short. Incomplete pass. Fourth down, 10 to go.|) + (IN FOOTBALL ! =Y))) + +(SYSTEM + ((INPUT =X BALL) & =Z --> ( =Z) (INPUT =X FOOTBALL))) + +(SYSTEM + ((HOLDS WATCH) + (INPUT WHAT TIME ! =W) & =A + (TIME IS =X) --> + ( =A) + ( |The time is| =X))) + +(SYSTEM + ((PLACE ! =X) (IN WATCH ! =X) + --> + ( |There's a watch here, it even has a luminous dial.|))) + +(SYSTEM + ((INPUT TIME) + & =A + --> ( =A) +(INPUT WHAT TIME))) + +(system +((INPUT read watch) & =A --> ( =a) (INPUT what time))) + +(system +((INPUT tell time) & =A --> ( =A) (INPUt what time))) + +(SYSTEM + ((INPUT WHAT TIME) + & =A --> ( =A) + ( |I have no watch.|))) + +(SYSTEM +((INPUT look at watch) & =A --> ( =A) +(INPUT what time))) + +(SYSTEM +((INPUT put on watch) & =A --> ( =A) (INPUT get watch))) + +(SYSTEM +((INPUT wind watch) & =A --> ( =A) ( |The watch is electric!|))) + +(SYSTEM +((INPUT open watch) & =A --> ( =A) ( |The watch is sealed shut.|))) + +(SYSTEM +((INPUT break watch) & =A --> ( =A) +( |The watch is shock resistent too. It still works.|))) + +(SYSTEM +((INPUT =X art ! =Y) & =A --> ( =A) (INPUT =X Painting ! =Y))) + +(SYSTEM + ((PLACE ! =X) (IN PAINTING ! =X) + (PAINTING IS COVERED) + --> ( |There is a work of ugly modern art on the ground.|))) + +(SYSTEM + ((PLACE ! =X) (IN PAINTING ! =X) + ( (PAINTING IS COVERED)) + --> ( |There is a valuable Rembrandt here.|))) + +(SYSTEM + ((HOLDS PAINTING) + (HOLDS BOTTLE) + (INSIDE TURPENTINE BOTTLE) + & =C (INPUT CLEAN ! =X) + & =A (PAINTING IS COVERED) + & =B (SCORE =Y) & =D + --> ( =A) + ( =B) + ( =C) + ( =D) + (SCORE (<+> =Y 15)) + ( |The ugly paint comes off! Underneath is a Rembrandt|) + ( |This will be very valuable.|) + ( |It is a person and a bust in the painting.|))) + +(SYSTEM +((PLACE ! =X) (IN PAINTING ! =X) (HOLDS BOTTLE) +(INSIDE TURPENTINE BOTTLE) & =A +(PAINTING IS COVERED) & =B (INPUT POUR ! =Z) & =C (score =Y) & =D +--> ( =A) ( =B) ( =C) ( =D) +( (INPUT painting ! =X)) +(score (<+> =Y 15)) +( |The turpentine hits the painting and causes the paint to come off.|) +( |The painting has a person contemplating a bust.|))) + +(SYSTEM + ((INPUT REMOVE PAINT) & =A --> ( =A) (INPUT CLEAN))) + +(SYSTEM + ((HOLDS PAINTING) + (PAINTING IS COVERED) + --> ( |Upon closer look, this is worthless!|))) + +(SYSTEM +((inside turpentine bottle) (PLACE ! =e) +(HOLDS bottle) (HOLDS painting) (INPUT pour ! =w) & =a --> +( =A) (INPUT CLEAN))) + +(SYSTEM +((PLACE ! =X) (In money ! =X) --> ( |The Money is here!|))) + +(SYSTEM + ((HOLDS STEREO) + (SOUND IS ON) + & =B (PLACE SMELLY ROOM) + --> ( =B))) + +(SYSTEM + ((IN STEREO SMELLY ROOM) + (PLACE SMELLY ROOM) + (SOUND IS ON) + & =A (INPUT TURN OFF ! =K) + & =B --> ( =A) + ( =B) + ( |The stereo is off. But you broke it, so it doesn't turn on.|))) + +(SYSTEM + ((PLACE ! =X) (IN STEREO ! =X) + --> + ( |There is an expensive stereo here, worth many megabucks!!|))) + +(SYSTEM + ((PLACE ! =X) + (IN BOOK ! =X) + --> ( |There is a book on the ground.|))) + +(SYSTEM + ((HOLDS BOOK) + (INPUT READ BOOK) + & =A --> ( =A) + ( |Vampires can only be destroyed by a stake through the heart,|) + ( |or by the light of day. They are invunerable to all other|) + ( |attacks. They dislike garlic and fear crosses. They are known|) + ( | to frequent dark rooms.|))) + +(SYSTEM + ((TIME IS /06/:00) + (TIME IS /06/:00) + --> (MORNING IS HERE) + ( |You hear a rooster crow!|))) + +(SYSTEM + ((TIME IS /20/:00) (TIME IS /20/:00) + (MORNING IS HERE) & =A +--> ( =A))) + +(SYSTEM + ((TIME IS /00/:00) + (TIME IS /00/:00) + --> (MIDNIGHT))) + +(SYSTEM + ((MIDNIGHT) + & =A --> ( =A) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |A moose comes running out of a wall at full speed straight at you!!!|) + ( |He is right on top of you!!! He runs right through you and disappears.|))) + +(SYSTEM + ((MIDNIGHT) + & =A (PLACE LAWN ! =Z) --> ( =A) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |BONG!|) + ( |A moose comes running across the lawn at full speed straight at you!!!|) + ( |He is right on top of you. He runs right through you and disappears.|))) + +(SYSTEM + ((PLACE ! =X) (IN GOLD ! =X) + --> ( |There is gold here!!!!|))) + +(SYSTEM + ((PLACE ! =X) + (IN HORN ! =X) + --> ( |There is a magic unicorn horn here.|))) + +(System + ((PLACE ! =X) (in horn ! =X) (HOLDS horn) & =A (INPUT DROP HORN) & =B +--> ( =A) ( =B) +( |When you drop the horn, it and the one on the ground merge together.|))) + +(SYSTEM +((PLACE Dining room) (ontop stool) (HOLDS horn) (INPUT get horn) & =A +--> ( =A) ( |The horn won't come off.|))) + +(SYSTEM + ((HOLDS HORN) + & =D (INPUT BLOW HORN) (INPUT BLOW HORN) + & =A + --> ( =A) + ( =D) + ( |A terrific noise comes from the horn. BLAT!!!|) + ( |The horn disappears from your hands.|) + ( |Your body shakes and you black out ......|) (CLUE))) + +(SYSTEM +((CLUE) & =A (GRAVE UNDUG) --> ( |A spirit appears to you in your sleep.|) +( |Your mind is filled with the following phrase/:|) +( |'As your family is sheep, the gold that is YOUR color must be found|) +( |before you can escape this estate.' |) ( =A))) + +(SYSTEM +((clue) & =a --> ( =A) ( |When you wake you see smoke form the word/:|) +( |EVERY OPTION ON A MACHINE HAS A PURPOSE. The smoke then dissapates.|))) + +(SYSTEM +((clue) & =A (in orchid lawn ! =X) --> ( +|You dream of a garden of flowers.|) ( =A))) + +(SYSTEM +((INPUT =X THEM) & =A --> ( =A) (INPUT =X CANDLESTICKS))) + +(SYSTEM + ((PLACE ! =X) (IN CANDLESTICKS ! =X) + --> + ( |There is a pair of silver candlesticks here!! No candles though.|))) + +(SYSTEM + ((HOLDS CANDLESTICKS) + (INPUT FORM CROSS) + (INPUT FORM CROSS) + & =X --> ( =X) + ( |The candlesticks are in a cross.|) + (CANDLESTICKS ARE CROSSED))) + +(SYSTEM + ((HOLDS CANDLESTICKS) + (INPUT MAKE CROSS) + (INPUT MAKE CROSS) + & =X --> ( =X) + ( |The candlesticks are in a cross.|) + (CANDLESTICKS ARE CROSSED))) + +(SYSTEM + ((HOLDS CANDLESTICKS) + & =A + (CANDLESTICKS ARE CROSSED) + & =Z (INPUT DROP CANDLESTICKS) + & =B (PLACE ! =X) + --> ( =Z) +( =A) + ( =B) + (IN CANDLESTICKS ! =X))) + +(SYSTEM + ((INPUT FORM CROSS) + & =A --> ( =A) + ( |You have nothing to form a cross with, arms don't work.|))) + +(SYSTEM + ((INPUT MAKE CROSS) + & =A --> ( =A) + ( |You have nothing to make a cross with, arms don't work.|))) + +(SYSTEM +((INPUT cross candlesticks) & =A --> ( =A) (INPUT make cross))) + +(SYSTEM + ((PLACE ! =X) (IN CHAIR ! =X) + --> ( |There is an old style chair on the ground.|))) + +(SYSTEM + ((HOLDS CHAIR) + --> + ( |The plate of the back of the chair says 'MADE BY LOUIS XIV'|))) + +(SYSTEM + ((PLACE ! =X) (IN CHAIR ! =X) & =A + (INPUT MOUNT CHAIR) + & =B --> ( =A) + ( =B) + ( |The priceless chair breaks under your weight.|) + ( |It then disappears.|))) + +(SYSTEM + ((PLACE ! =X) (IN CHAIR ! =X) & =A + (INPUT SIT ON CHAIR) + & =B --> ( =A) + ( =B) + ( |You sat on the chair and it broke!|) + ( |It disappears.|))) + + +(SYSTEM + ((PLACE ! =X) (IN STOOL ! =X) + --> ( |There is a sturdy stool here.|))) + +(SYSTEM + ((PLACE ! =X) (IN STOOL ! =X) (INPUT SIT = STOOL) & =A + --> ( =A) (SITON STOOL) ( |You're sitting on the stool.|))) + +(system + ((HOLDS STOOL) (INPUT SIT = STOOL) & =A --> + ( =A) ( |I suggest you drop the stool first.|))) + +(SYSTEM + ((PLACE ! =X) (IN STOOL ! =X) + (INPUT MOUNT STOOL) + & =B --> ( =B) + ( |You are on the stool.|) + (ONTOP STOOL))) + +(SYSTEM +((INPUT climb stool) & =A (place ! =x) --> ( =A) (INPUT mount stool))) + + +(SYSTEM +((INPUT ( DON wear) ! =X) & =A --> ( =A) (INPUT PUT ON ! =X))) + +(SYSTEM +((IN chest ! =x) (PLACE ! =X) --> +( |There is a chest of treasure!!!|))) + +(SYSTEM +((HOLDS chest) (open chest) & =A --> ( =A) +( |Give up, the chest doesn't open, but is worth gigabucks the way it is.|))) + +(SYSTEM +((HOLDS conch) (INPUT blow conch) & =A --> ( =A) +( |Hoooonk!!|))) + +(SYSTEM +((IN conch ! =X) (PLACE ! =x) --> +( |There is a large conch shell here.|))) + +(SYSTEM +((INPUT =x shell) & =A --> ( =A) (INPUT =x conch))) + +(SYSTEM +((HOLDS conch) (INPUT listen conch) & =A --> +( =A) ( |You hear the ocean 'rumble'.|))) + +(SYSTEM +((INPUT =X to ! =Y) & =A --> ( =A) (INPUT =x ! =y))) + +(SYSTEM +((INSIDE water bottle) & =A (INPUT drink water) & =B +(PLACE ! =X) & =C +(HOLDS bottle)--> ( =A) +( =A) ( =B) ( +|You have changed into a baby, the adventure must end.|) +HALT)) + +(SYSTEM +((INSIDE seawater bottle) & =A (INPUT drink ! =) & =B +(HOLDS bottle) --> +( =A) ( =B) ( |Yech! It tastes salty!!|))) + +(SYSTEM +((PLACE ! =x) (in token ! =x) --> ( |There is a token here.|))) + +(SYSTEM +((PLACE ! =X) (in tokens ! =x) --> ( |There are tokens here.|))) + +(SYSTEM +((INPUT bite =x ! =Y) & =A (HOLDS =x) --> ( =A) +( |The| ( =X) |bites back, Chomp!!|))) + +(system +((INPUT bite =x ! =Y) & =A --> ( =A) +( |You must be holding what you are trying to bite.|))) + + (SYSTEM +((HOLDS gem) (score =Y) & =A ( (scored gem)) --> +( =A) (score (<+> =y 15)) (scored gem))) + +(SYSTEM + ((INPUT score) & =A (score =x) --> ( |Score =| =X) ( =A))) + +(SYSTEM +(HALT (score =x) --> ( |Your final score is| =X) +( |The total possible is 440|) (turnoff))) + +(SYSTEM +((turnoff) (score ( 20)) --> ( |Hmm... I don't think you tried very hard.|))) + +(SYSTEM +((turnoff) --> ())) + +(SYSTEM +((turnoff) (score ( 50) & ( 21)) --> +( |Rank Novice! Are you scared of your own shadow?|))) + +(SYSTEM +((turnoff) (score ( 51) & ( 80)) --> +( |Beginning Ghost Hunter|))) + +(SYSTEM +((turnoff) (score ( 81) & ( 140)) --> +( |Reasonable Spirit Fighter|))) + +(SYSTEM +((turnoff) (score ( 141) & ( 220)) --> +( |Intermediate Haunt Hacker|))) + +(SYSTEM +((turnoff) (score ( 221) & ( 290)) --> +( |Advanced Monster Killer|))) + +(SYSTEM +((turnoff) (score ( 291) & ( 360)) --> +( |Master Haunter!!|))) + +(SYSTEM +((turnoff)(turnoff) (score ( 361)) --> +( |Fearless Vampire Killer|))) + +(SYSTEM +((likes ! =X) (turnoff) (score ( 435)) --> +( |and waster of many cycles.|))) + + (SYSTEM +((PLACE ! =X) (IN pearls ! =X) --> +( |There are huge pearls here!!!|))) + +(SYSTEM +((PLACE ! =X) (IN diamonds ! =X) --> +( |There are diamonds here!|))) + +(SYSTEM +((PLACE ! =x) (in orchid ! =X) --> +( |There is a beautiful black orchid here.|))) + +(SYSTEM +((PLACE ! =X) (in orchid ! =X) (INput smell ! =Y) & =A --> +( =A) ( |Yum! The orchid smells delicious!|))) + +(SYSTEM +((HOLDS orchid) (INPUT smell orchid) & =A --> ( =A) +( |I like the odor! Sniff. Sniff.|))) + +(SYSTEM +((INPUT pick orchid) & =A --> ( =A) (INPUT get orchid))) + +(SYSTEM +((INPUT smell ! =X) & =A --> +( =A) ( |Ah CHOOOO! There is alot of dust around here.|))) + +(SYSTEM +((INPUT sniff ! =X) & =A --> ( =A) (INPUT smell ! =X))) + +(SYSTEM +((PLACE ! =X) (IN rope ! =X) +(rope noose) --> ( |There is rope in a noose here.|))) + +(SYSTEM +((PLACE ! =X) (IN rope ! =X) (rope untied) +--> ( |There is some loose rope here.|))) + +(system +((PLACE ! =X) (in =y ! =X) (rope tied =Y) (in rope ! /#x) --> +( |A rope is tied to the| ( =Y)))) + +(system +((PLACE ! =X) (in rope ! =x) (rope tied =Y) (in =Y ! /#X) +--> ( |An end of a rope is here.|))) + +(system +((PLACE ! =X) (in rope ! =X) (rope tied =Y) (In =y ! =X) +--> ( |An end of the rope is here, tied to the | + ( =y)))) + +(system +((PLACE ! =X) (in rope ! =X) (rope tied =Y) (HOLDS =Y) +--> ( |A rope tied to the| ( =Y) +|is here.|))) + +(SYSTEM +((HOLDS rope) (rope noose) & =A +(INPUT untie rope) & =b --> ( =A) ( =B) +( |The rope is now untied.|) +(rope untied))) + +(SYSTEM +((rope noose) (INPUT hang ! =x) & =a --> +( =A) ( |No hanging around here.|))) + +(SYSTEM +((HOLDS rope) (rope noose) +(INPUT TIE ROPE ! =X) (INPUT tie rope ! =X) & =A --> ( =A) +( |The rope is already in knots.|))) + +(SYSTEM +((HOLDS rope) (INPUT tie ! =x) & =y +--> ( =Y) ( |Look, don't tie| ( ! =x) +|, tie rope to something you have on you.|))) + +(system +((HOLDS rope) (INPUT tieup ! =X) & =A --> +( =A) (INPUT tie rope to ! =X))) + +(SYSTEM +((HOLDS rope) (INPUT tie rope to =X) & =Y (rope untied) & =A +(HOLDS =X) --> ( =A) ( =Y) (rope tied =x) +( |The rope is tied to| ( =X) |.|))) + +(system +((HOLDS rope) (INPUT tie rope to =X) & =A +(rope tied =z) --> +( =A) ( |The rope is already tied to the| ( =z)) +( |I can tie the rope to only one object at a time.|))) + +(system +((INPUT get =X ! =L) (PLACE ! =Y) (in =X ! =Y) (rope tied =X) + (in rope ! =W) & =A --> ( =A) +(HOLDS rope) ( |You get the rope first and then ...|))) + +(system +((INPUT get rope ! =L) & =B (PLACE ! =Y) (in =x ! =y) (rope tied =x) + (in rope ! /#y) & =A --> ( =A) ( =B) + (HOLDS rope) ( |You have gotten the rope.|))) + +(system +((INPUT get rope ! =L) & =A (PLACE ! =Y) (HOLDS =X) (rope tied =X) + (in rope ! =Z) & =B --> ( =A) ( =B) +(HOLDS rope) ( |You just pulled in the rest of the rope.|))) + +(SYSTEM +((HOLDS rope) (INPUT tie rope to cecil) & =A +(PLACE ! =Z) (IN cecil ! =Z) --> ( =A) +( |You can't tie cecil down!|))) + +(system +((HOLDS rope) (PLACE laboratory) (INPUT tie rope to monster) & =A +(rope untied) +--> ( =A) ( |That would be very foolish.|))) + +(SYSTEM +((HOLDS rope) (INPUT tie rope to dracula) & =A (rope untied) +(PLACE ! =Z) (in dracula ! =Z) --> ( =A) +( |You can't get Dracula, not to mention tie him up.|))) + +(System +((holds rope) (input tie rope to ( candy marijuana cube orchid ) & =X ) +& =A (holds =x) (place ! =z) (rope untied) --> ( =a) +( |That is too small for the rope to be tied to.|))) + +(system +((INPUT lasso ! =X) & =A --> ( =A) (INPUT tie rope to ! =X))) + +(system +((HOLDS rope) (HOLDS rope) (INPUT tie rope to rope) & =A (rope untied) & =B +--> ( =A) ( =B) + ( |The rope is tied in knots.|) (rope noose))) + +(SYSTEM +((HOLDS rope) (INPUT tie rope to ! =X) & =A +(likes ! =X) +(PLACE torture chamber) DAMSEL-FREE --> +( =A) (torture damsel))) + +(SYSTEM +((HOLDS rope) (INPUT tie rope to chest) & =A +(PLACE ! =X) (in chest ! =X) (octopus is alive) --> +( =a) +( |The octopus blocks your way.|))) + +(SYSTEM +((HOLDS rope) (INPUT tie rope to ! =X) & =A --> +( =A) ( |Either you aren't holding | ( ! =X) |, or I can't tie the rope to it.|))) + +(system +((INPUT tie rope to ! =z) & =A --> ( =A) ( |You don't have the rope.|))) + +(SYSTEM +((INPUT untie rope) & =a +(rope tied =X) & =b (HOLDS =x) +--> ( =A) ( =b) (rope untied) + ( |The rope is no longer tied to| ( =x) |.|))) + +(SYSTEM +((HOLDS rope) (INPUT pull rope) & =A +(rope tied =X) (IN =x ! =y) & =B +--> ( |Umph!! You just pulled in the| ( =x) |.|) +( =a) ( =B) (HOLDS =x))) + +(system +((INPUT pull rope) & =A (rope tied =X) (HOLDS =X) (in rope ! =Z) & =B +--> ( =A) ( =B) ( |You now have all the rope.|) +(HOLDS rope))) + +(system +((INPUT untie rope ) & =A (rope untied) --> ( =A) +( |The rope isn't tied to anything.|))) + +(system +((INPUT untie rope) & =A (rope tied =X) (in =X ! =Y) --> +( =A) ( |The rope is tied to the| ( =X) +|, which you aren't holding.|))) + +(system +((INPUT pull rope) & =A (rope tied =X) (PLACE bathysphere) + (in =x ocean ! =Y) (wdoor closed) --> ( =A) + ( |The airlock door is closed on the rope.|))) + +(SYSTEM +((PLACE ! =X) (IN wetsuit ! =x) --> +( |There is a wetsuit, with everything needed to survive underwater.|))) + +(SYSTEM +((PLACE ! =X) (IN wetsuit ! =x) & =a +(INPUT put on wetsuit) --> +( =A) (HOLDS wetsuit))) + +(SYSTEM +((HOLDS wetsuit) +(INPUT put on wetsuit) & =a --> ( =A) +( |You are wearing a wetsuit.|) +(wears wetsuit))) + +(SYSTEM +((wears wetsuit) & =A (INPUT ( remove doff) WETSUIT) & =B +--> ( =A) ( =B) ( |Your wetsuit is in your arms.|))) + +(SYSTEM +((INPUT drop wetsuit) & =A (HOLDS wetsuit) & =B +(PLACE ! =X) --> ( =A) ( =B) +(in wetsuit ! =X))) + +(SYSTEM +((INPUT drop wetsuit) & =A (HOLDS wetsuit) & =B (wears wetsuit) & =C +(PLACE ! =X) --> ( =A) ( =B) ( =C) +(in wetsuit ! =X))) + +(SYSTEM +((PLACE ! =X) (Place ! =X) (IN speargun ! =x) --> +( |There is a speargun around here, the type for shooting underwater.|))) + +(SYSTEM +((PLACE ! =X) (IN speargun ! =x) (speargun IS loaded) +--> ( |The speargun is loaded, ready to fire.|))) + +(SYSTEM +((PLACE ! =X) & =C (HOLDS speargun) (speargun IS loaded) & =a +( UNDERWATER) (INPUT shoot ! =f) & =B +--> ( =A) ( =b) ( =c) (in ! =X spear) + ( |The gun goes off. BRRRANG!!!|) +( |The backlash from the speargun snaps your neck!|) +HALT)) + +(SYSTEM +((HOLDS speargun) (speargun IS unloaded) +(INPUT shoot speargun) & =A --> ( =A) +( |The gun isn't loaded with a spear!!|))) + +(SYSTEM +((HOLDS speargun) (speargun IS unloaded) & =b +(HOLDS spear) & =C (INPUT load ! =q) & =A --> +( |The gun is now loaded.|) +( =A) ( =B) ( =c) (speargun IS loaded))) + +(SYSTEM +((PLACE ! =X) (IN spear ! =x) --> +( |There is a speargun spear here.|))) + +(SYSTEM +((INPUT =x gun) & =A --> ( =A) (INPUT =x speargun))) + +(SYSTEM +((INPUT ( pres p depress push) ! =X) & =B --> ( =b) (INPUT press ! =X))) + +(SYSTEM +((Place ! =X) (IN COiNS ! =X) --> ( |You see many coins here!!|))) + +(SYSTEM +((PLACE ! =X) (in bone ! =X) --> ( |There is a bone here that you identify as from the MISSING LINK!|))) + +(SYSTEM +((PLACE ! =X) (in soap ! =X) --> ( |There is a bar of soap here.|))) + +(SYSTEM +((PLACE ! =X) (in gem ! =X) --> ( |There is a valuable gem here.|))) + +(SYSTEM +((oil =X) & =A (time is =X) (time is =X) (input ! =z) --> ( =A) +(enter ( =X 10)))) + +(SYSTEM +((enter =X) & =A (time is =X) (time is =X) (input ! =z) --> + (in truck lawn iside 7 5) ( =A) (walk ( =X 10)))) + +(SYSTEM +((walk =X) & =a (time is =X) (time is =X) (grave undug) & =b (input ! =z) --> +( =A) ( =B) +(walk ( =X 4)) (grave dug))) + +(SYSTEM +((walk =X) & =B (time is =X) (time is =X) (grave dug) & =A (input ! =z) --> +( =A) +( =B)(walk ( =X 4)) (grave deep))) + +(SYSTEM +((walk =X) & =A (time is =X) (time is =X) (grave deep) (grave oil) & =b +(input ! =z) --> +( =A) +( =B) (fixit ( =X 8)))) + +(SYSTEM +((fixit =x) & =A (time is =X) (time is =X) (input ! =z) --> + ( =A) (fixed) (return ( =X 10)))) + +(SYSTEM +((return =x) & =A (time is =X) (time is =X) (in truck ! =Y) & =B (input ! =z) + --> ( =a) +( =B))) + +(SYSTEM +((PLACE ! =X) (in jade ! =X) --> ( |There is a piece of valuable jade here.|))) + +(SYSTEM +((INPUT why ! =X) & =A --> ( =A) ( |Hey, I don't know.|) +( |Send mail to Laird@cmua if you have questions.|))) + +(SYSTEM +((INPUT eat orchid) & =A (HOLDS orchid) & =B --> ( =A) ( =B) +( |Chomp! chomp. I don't think your real family had a taste for orchids.|) +( |It looks like you aren't one of those that knows how to digest orchids.|))) + +(SYSTEM +((name =x St |.| John) (INPUT eat orchid) & =B +(HOLDS orchid) & =A --> ( =A) ( =B) +( |An orchid a day keeps the crazies away!|) +EATIT)) + +(SYSTEM +((INPUT eat orchid) (INPUT eat orchid) (in orchid ! =X) +(PLACE ! =X) --> (INPUT get orchid))) + +(SYSTEM +((INPUT say ! =x) & =a --> ( =A) (INPUT ! =X) +( |You can just type| ( ! =X)) +( |and I'll try and understand| ( ! =X) |right now.|))) + +(SYSTEM +((INPUT ( scream shout yell) ! =X) & =A --> ( |'| ! =X |!!!!'|) +( =A) ( |I don't think anybody is listening.|))) + +(SYSTEM +((INPUT hello ! =X) & =A --> ( =A) +( |Your greeting is met with silence.|))) + +(SYSTEM +((INPUT fly) & =A --> +( =A) ( |You flap your arms, but nothing happens.|))) + +(SYSTEM +((INPUT afihywn ! =X) & =A --> ( =A) ( |Hmm, is that Australian?|))) + +(SYSTEM +((orc sweat =x) & =A (time is =X) (time is =X) --> ( =A) +(orc dizzy ( =X 120)) +( | |) +( |You're starting to sweat, I think this PLACE is getting to you.|))) + +(SYSTEM +((orc dizzy =x) & =A (time is =X) (time is =X) +--> ( =A) +( | |) +( |Your getting a little dizzy.|) +( |The area around seems to swim a little when you move.|) +(orc mad ( =X 60)))) + +(SYSTEM +((orc mad =X) & =A (time is =X) (time is =X) --> ( =A) +( | |) +( |I think you are definitely going MAD. The sweaty palms and dizziness were the|) +( |first signs. If you don't do something quick, you'll commit suicide!|) +(orc suicide ( =X 30)))) + +(SYSTEM +((orc suicide =X) & =A (time is =X) (time is =X) --> ( =A) DIE +( | |) +( |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|) +( |You can't stand it anymore, you are now totally crazy!|) +( |You start laughing uncontrollably, but choke on your tongue.|) +( |Ugh! Well at least you died happy!|))) + + +(system +(DIE DIE DIE (ontop ! =X) & =A --> ( =A))) + +(system +(DIE DIE DIE (siton ! =X) & =A --> ( =A))) + +(SYSTEM +((orc ! =X) & =A EATIT & =B --> ( =A) ( =B) +( |You feel much saner.|) +( |You've managed to avoid the St. John curse!|))) + +(SYSTEM +((orc suicide =x) & =A EATIT & =B --> ( =A) ( =B) +( |You've done it! The orchid returns you to sanity.|))) + diff --git a/src/haunt/slurp.lsp b/src/haunt/slurp.lsp new file mode 100644 index 000000000..c5027f9ab --- /dev/null +++ b/src/haunt/slurp.lsp @@ -0,0 +1,1076 @@ + +;;; SLURP Version 7.0 +;;; +;;; The SLURP package provides a comfortable top-level I/O +;;; environment for CMU MacLisp users. SLURP loads and saves +;;; user programs, keeping track of the contents of each file +;;; it has loaded. SLURP's file syntax is more reasonable than +;;; the standard MacLisp syntax. TOPS-20 file syntax is now +;;; supported too. +;;; +;;; David S. Touretzky +;;; Leonard N Zubkoff +;;; Carnegie-Mellon University +;;; September, 1980 + +(COMMENT --CONTENTS-- SLURP QSLURP LSLURP VSLURP SLURP1 SLURP2 + SLURPPARSE SLURPPARSEMCL DEVP PPNSPEC CMUDEC CMUDEC1 CMUDEC2 + SEDIT UNSLURP VUNSLURP SLURPSET TYPE CHANGES SAVEWORK NEWFILE + DROPFILE COPYFN SLURP-DEFUN MARK-CHANGED FNS-IN-LIST + LISTPRINT DEFSLURP AUTOLOAD AUTOSLURP UNIONQ INTERQ DIFFQ + DSKIN DSKIN1 DSKIN1ERR DSKINLINETEST DSKINSET DSKINSET1 + DSKOUT DSKOUT1 DSKOUT2 DSKOUT3 DSKPRINT FILEATOM CHANGEDATOM + PROPATOM PROPATOMVAL SHORTSPEC DEVIFY BROKIFY TAB READSEMI + SEMICOLON FULLSEMI BRIEFSEMI) + +(DECLARE (MACROS T) + (FIXSW T) + (*LEXPR MARK-CHANGED)) + +(DECLARE (SPECIAL ^W ^Q ^R INFILE OUTFILES *NOPOINT AUTOLOAD)) + +(DECLARE (SPECIAL PRINLEVEL PRINLENGTH LINEL)) + +(DECLARE (SPECIAL SLURPCOMMENTS SLURP1-COMMENTS SLURPFORMFEEDS + SLURP1-FORMFEEDS SLURPPROPS SLURP-VERBOSITY SEMICOLON + DSKOUT-LENGTH LASTFILE SLURPEDFILES FASLOAD-MESSAGES + SLURP-INPUT INSIDE-SLURP LAST-SLURP-OUTPUT-FILE)) + +(DECLARE (SPECIAL LASTWORD CHANGEDLIST)) + +(DECLARE (SPECIAL G1OPEN-DEL G1CLOSE-DEL G1LEVEL G1FORMAT-LIST G1FCODE + G1BCODE G1PRINC-ATOMS)) + +(DECLARE (*EXPR G1FORMAT-LIST G1ENTER-OBJ EDITE)) + +(DECLARE (*LEXPR LISTPRINT TAB)) + +(PROG NIL + (SETQ LASTFILE NIL) + (SETQ SLURPCOMMENTS T) + (SETQ SLURPFORMFEEDS T) + (SETQ SLURPPROPS NIL) + (SETQ SLURP-VERBOSITY NIL) + (SETQ SEMICOLON 'FULLSEMI) + (SETQ DSKOUT-LENGTH 72.) + (SETQ FASLOAD-MESSAGES NIL) + (SETQ INSIDE-SLURP NIL) + (SETQ LAST-SLURP-OUTPUT-FILE NIL) + (OR (BOUNDP 'SLURPEDFILES) (SETQ SLURPEDFILES NIL)) + (OR (BOUNDP 'CHANGEDLIST) (SETQ CHANGEDLIST NIL))) + +(DEFUN SLURP FEXPR (XFILE) + ((LAMBDA (SLURP1-COMMENTS SLURP1-FORMFEEDS) (SLURP1 XFILE)) + SLURPCOMMENTS SLURPFORMFEEDS)) + +(DEFUN QSLURP FEXPR (XFILE) + (PROG (RESULT) + ((LAMBDA (^W ^R) + (PROG (FILE SLURP1-COMMENTS SLURP1-FORMFEEDS LASTFILE + SLURPEDFILES CHANGEDLIST) + (SETQ RESULT (SLURP1 XFILE)) + (SETQ FILE (SLURPPARSEMCL XFILE)) + (AND FILE + (MAKUNBOUND (FILEATOM FILE)) + (MAKUNBOUND (CHANGEDATOM FILE))) + (COND (RESULT + (OR (ZEROP (CHARPOS T)) (TERPRI MSGFILES)) + (PRINC (CONS 'SLURPED (CDR RESULT)) MSGFILES) + (TERPRI MSGFILES))))) + NIL NIL) + (RETURN RESULT))) + +(DEFUN LSLURP FEXPR (XFILE) + (PROG (RESULT) + ((LAMBDA (^W ^R) + (PROG (FILE SLURP1-COMMENTS SLURP1-FORMFEEDS LASTFILE + SLURPEDFILES CHANGEDLIST) + (SETQ RESULT (SLURP1 XFILE)) + (SETQ FILE (SLURPPARSEMCL XFILE)) + (AND FILE + (MAKUNBOUND (FILEATOM FILE)) + (MAKUNBOUND (CHANGEDATOM FILE))))) + NIL NIL) + (RETURN RESULT))) + +(DEFUN VSLURP FEXPR (XFILE) + ((LAMBDA (SLURP-VERBOSITY SLURP1-COMMENTS SLURP1-FORMFEEDS) + (SLURP1 XFILE)) + T SLURPCOMMENTS SLURPFORMFEEDS)) + +(DEFUN SLURP1 (XFILE) + ((LAMBDA (INSIDE-SLURP DEFAULTF) + (PROG (FILE EXT RESULT MBKF) + (SETQ FILE (SLURPPARSE (OR XFILE LASTFILE))) + (COND ((NULL FILE) + (PROG (^W ^R) + (PRINC '|Invalid file specification - | + MSGFILES) + (PRINC (OR XFILE LASTFILE) MSGFILES) + (TERPRI MSGFILES)) + (RETURN NIL))) + (SETQ EXT (CADDR FILE)) + (AND EXT (GO DOIT)) + (DO ((EXTS (CASEQ (STATUS OPSYSTEM-TYPE) + (CMU '(FAS NFS OFS MCL MBK)) + (T '(FASL NFASL OFASL LSP LBK))) + (CDR EXTS))) + ((OR (AND (SETQ EXT (CAR EXTS)) + (PROBEF (LIST (CAR FILE) (CADR FILE) EXT))) + (NULL EXTS)))) + (COND ((NULL EXT) (SETQ EXT '-ANY-)) + ((MEMQ EXT '(MBK LBK)) + (PROG (^W ^R) + (OR (ZEROP (CHARPOS T)) (TERPRI MSGFILES)) + (PRINC '|Found only backup file... will treat as source.| + + MSGFILES) + (TERPRI MSGFILES)) + (SETQ MBKF EXT))) + DOIT (SETQ FILE (LIST (CAR FILE) (CADR FILE) EXT)) + (COND ((EQ EXT '-ANY-) (SETQ RESULT 'FILE-NOT-FOUND)) + (T (SETQ RESULT (SLURP2 FILE)))) + (OR (ZEROP (CHARPOS T)) + (TERPRI MSGFILES) + (TERPRI MSGFILES)) + (COND ((ATOM RESULT) + (PROG (^W ^R) + (PRINC (CASEQ RESULT + (FILE-NOT-FOUND '|File not found - | + ) + (OPEN-ERROR ' + |Error in reading file - |) + (LINE-NUMBERS '|Can't read files with line numbers - | + ) + (T '|Unknown error - |)) + MSGFILES) + (PRINC (SHORTSPEC FILE) MSGFILES) + (TERPRI MSGFILES)) + (GO DONE))) + (SETQ LASTFILE (SHORTSPEC FILE)) + (AND MBKF + (RPLACA (LAST LASTFILE) + (CADR (ASSQ (CAR (LAST LASTFILE)) + '((MBK MCL) (LBK LSP))))) + (SET (FILEATOM (LIST (CAR FILE) + (CADR FILE) + (CAR (LAST LASTFILE)))) + (EVAL (FILEATOM FILE)))) + (AND SLURP-VERBOSITY + (NOT (ZEROP (CHARPOS T))) + (TERPRI MSGFILES)) + DONE (RETURN (COND ((NOT (ATOM RESULT)) RESULT))))) + T DEFAULTF)) + +(DEFUN SLURP2 (FILE) + (PROG (RESULT FASL) + (OR (PROBEF FILE) (RETURN 'FILE-NOT-FOUND)) + (SETQ RESULT + (COND ((SETQ FASL + (MEMQ (CADDR FILE) + '(FAS NFS OFS FASL NFASL OFASL))) + ((LAMBDA (^W) (APPLY 'FASLOAD FILE)) + (NOT FASLOAD-MESSAGES)) + FILE) + ((SETQ FASL (FASLP FILE)) + ((LAMBDA (^W) (APPLY 'FASLOAD FILE)) + (NOT FASLOAD-MESSAGES)) + FILE) + (T (DSKIN FILE)))) + (RETURN (COND ((ATOM RESULT) RESULT) + (T (COND ((NOT FASL) + (OR (MEMBER (SHORTSPEC FILE) + SLURPEDFILES) + (PUSH (SHORTSPEC FILE) + SLURPEDFILES)) + (PUTPROP (FILEATOM FILE) T 'FILEATOM) + (SETQ CHANGEDLIST + (DIFFQ CHANGEDLIST + (FNS-IN-LIST (EVAL (FILEATOM + FILE))))))) + (SHORTSPEC FILE)))))) + +(DEFUN SLURPPARSE (X) + (PROG (DEV DIR NAME EXT) + (OR X (RETURN NIL)) + (AND (ATOM X) (SETQ X (LIST X))) + (SETQ DEV + (CASEQ (STATUS FILESYSTEM-TYPE) (DEC20 'PS) (T 'DSK)) + DIR (STATUS UDIR) + EXT 'NIL) + (AND (DEVP (CAR X)) (SETQ DEV (DEVP (POP X)))) + (AND (PPNSPEC (CAR X)) (SETQ DIR (PPNSPEC (CAR X))) (POP X)) + (POP X NAME) + (AND X (POP X EXT)) + (OR (AND (SYMBOLP DIR) (SYMBOLP NAME) (SYMBOLP EXT) (NULL X)) + (RETURN NIL)) + (OR (EQ (STATUS FILESYSTEM-TYPE) 'DEC20) + (< (FLATC NAME) 7.) + (SETQ NAME + ((LAMBDA (NAME) + (RPLACD (NTHCDR 5. NAME) NIL) + (READLIST NAME)) + (EXPLODEC NAME)))) + (OR (EQ (STATUS FILESYSTEM-TYPE) 'DEC20) + (< (FLATC EXT) 3.) + (SETQ EXT + ((LAMBDA (EXT) + (RPLACD (NTHCDR 2. EXT) NIL) + (READLIST EXT)) + (EXPLODEC EXT)))) + (RETURN (LIST (LIST DEV DIR) NAME EXT)))) + +(DEFUN SLURPPARSEMCL (X) + (SETQ X (SLURPPARSE X)) + (COND ((OR (NULL X) (CADDR X)) X) + (T (LIST (CAR X) + (CADR X) + (CASEQ (STATUS OPSYSTEM-TYPE) (CMU 'MCL) (T 'LSP)))))) + +(DEFUN DEVP (X) + (AND (NOT (GET X 'PPNSPEC)) + (EQ (GETCHAR X (FLATC X)) ':) + (INTERN (IMPLODE (NREVERSE (CDR (NREVERSE (EXPLODEC X)))))))) + +(DEFUN PPNSPEC (X) + (COND ((NULL X) NIL) + ((AND (EQ (TYPEP X) 'LIST) + (FIXP (CAR X)) + (FIXP (CADR X)) + (NULL (CDDR X))) + X) + ((PPNSPEC (GET X 'PPNSPEC))) + ((AND (EQ (STATUS FILESYSTEM-TYPE) 'DEC20) + (ATOM X) + (EQ (CAR (SETQ X (EXPLODEC X))) '<) + (EQ (CAR (LAST X)) '>)) + (INTERN (IMPLODE (NREVERSE (CDR (NREVERSE (CDR X))))))) + ((AND (EQ (STATUS OPSYSTEM-TYPE) 'CMU) (CMUDEC X)) X))) + +(DEFUN CMUDEC (PPN) + (PROG (P0 P1 P2 P3 PN0 PN1 PN2 PN3) + (OR (= (LENGTH (SETQ PPN (EXPLODEC PPN))) 8.) (RETURN NIL)) + (SETQ P0 (CMUDEC1 (CAR PPN)) + P1 (CMUDEC2 (NTH 1. PPN)) + P2 (CMUDEC2 (NTH 2. PPN)) + P3 (CMUDEC2 (NTH 3. PPN)) + PN0 (CMUDEC1 (NTH 4. PPN)) + PN1 (CMUDEC1 (NTH 5. PPN)) + PN2 (CMUDEC2 (NTH 6. PPN)) + PN3 + (OR (CMUDEC2 (NTH 7. PPN)) + (AND (CMUDEC1 (NTH 7. PPN)) + (+ (CMUDEC1 (NTH 7. PPN)) 10.)))) + (RETURN (AND P0 + P1 + P2 + P3 + PN0 + PN1 + PN2 + PN3 + (LIST (+ (* P0 1000.) + (* P1 100.) + (* P2 10.) + P3 + 9.) + (+ (* PN0 9360.) + (* PN1 360.) + (* PN2 36.) + PN3)))))) + +(DEFUN CMUDEC1 (X) + (SETQ X (GETCHARN X 1.)) + (OR (AND (< 64. X) (> 91. X) (- X 65.)) + (AND (< 96. X) (> 123. X) (- X 97.)))) + +(DEFUN CMUDEC2 (X) + (SETQ X (GETCHARN X 1.)) + (AND (< 47. X) (> 58. X) (- X 48.))) + +(DEFUN SEDIT FEXPR (FILE) + (PROG (FA CA OLDFNS NEWFNS PRINLEVEL PRINLENGTH SEMICOLON) + (SETQ SEMICOLON 'BRIEFSEMI + PRINLEVEL 2. + PRINLENGTH 6.) + (COND ((AND (NULL FILE) LASTFILE) + (SETQ FILE LASTFILE) + (TERPRI MSGFILES) + (PRINC '|= | MSGFILES) + (PRINC FILE MSGFILES))) + (SETQ FILE (SLURPPARSEMCL FILE)) + (COND ((NULL FILE) + (OR (ZEROP (CHARPOS T)) (TERPRI MSGFILES)) + (PRINC '|Invalid file specification - | MSGFILES) + (PRINC (SHORTSPEC FILE) MSGFILES) + (TERPRI MSGFILES) + (RETURN NIL))) + (SETQ FA (FILEATOM FILE) + CA (CHANGEDATOM FILE)) + (COND ((NOT (AND (BOUNDP FA) (GET FA 'FILEATOM))) + (OR (ZEROP (CHARPOS T)) (TERPRI MSGFILES)) + (PRINC '|No functions associated with | MSGFILES) + (PRINC (SHORTSPEC FILE) MSGFILES) + (TERPRI MSGFILES) + (RETURN NIL))) + (OR (SYMEVAL FA) (SET FA (LIST NIL))) + (SETQ LASTFILE (SHORTSPEC FILE)) + (SETQ OLDFNS (FNS-IN-LIST (SYMEVAL FA))) + (EDITE (SYMEVAL FA) NIL FA) + (SETQ NEWFNS (FNS-IN-LIST (SYMEVAL FA))) + (SETQ CHANGEDLIST (DIFFQ CHANGEDLIST (DIFFQ NEWFNS OLDFNS))) + (SET CA + (DIFFQ (NCONC (DIFFQ NEWFNS OLDFNS) (SYMEVAL CA)) + (DIFFQ OLDFNS NEWFNS))) + (MARK-CHANGED (DIFFQ OLDFNS NEWFNS) T) + (RETURN (SHORTSPEC FILE)))) + +(DEFUN UNSLURP FEXPR (XFILE) + (PROG (*NOPOINT PRINLEVEL PRINLENGTH FA FILE RESULT) + (AND (NULL XFILE) LASTFILE (SETQ XFILE (CDR LASTFILE))) + (SETQ FILE (SLURPPARSEMCL XFILE)) + (COND ((NULL FILE) + (PRINC '|Invalid file specification - | MSGFILES) + (PRINC XFILE MSGFILES) + (TERPRI MSGFILES) + (RETURN NIL))) + (SETQ FA (FILEATOM FILE)) + (COND ((NOT (AND (BOUNDP FA) (EVAL FA))) + (PRINC '|No functions associated with | MSGFILES) + (PRINC (SHORTSPEC FILE) MSGFILES) + (TERPRI MSGFILES) + (RETURN NIL))) + (SETQ LASTFILE (SHORTSPEC FILE)) + (SETQ RESULT (DSKOUT FILE)) + (COND ((ATOM RESULT) + (OR (ZEROP (CHARPOS T)) + (TERPRI MSGFILES) + (TERPRI MSGFILES)) + (PRINC '|Error encountered while unslurping file - | + MSGFILES) + (PRINC (SHORTSPEC FILE) MSGFILES) + (TERPRI MSGFILES))) + (AND SLURP-VERBOSITY + (NOT (ZEROP (CHARPOS T))) + (TERPRI MSGFILES)) + (RETURN (COND ((NOT (ATOM RESULT)) + (SET (CHANGEDATOM FILE) NIL) + (SHORTSPEC FILE)))))) + +(DEFUN VUNSLURP FEXPR (X) + (PROG (SLURP-VERBOSITY) + (SETQ SLURP-VERBOSITY T) + (RETURN (APPLY 'UNSLURP X)))) + +(DEFUN SLURPSET FEXPR (XFILE) + ((LAMBDA (INSIDE-SLURP DEFAULTF) + (PROG (FILE FNS RESULT SLURP-VERBOSITY SLURP1-COMMENTS + SLURP1-FORMFEEDS) + (SETQ SLURP-VERBOSITY T + SLURP1-COMMENTS SLURPCOMMENTS + SLURP1-FORMFEEDS SLURPFORMFEEDS) + (SETQ FNS (INTERQ (CDR XFILE) (CDR XFILE))) + (SETQ FILE (SLURPPARSEMCL (OR (CAR XFILE) LASTFILE))) + (COND ((NULL FILE) + (PRINC '|Invalid file specification - | MSGFILES) + (PRINC (CAR XFILE) MSGFILES) + (TERPRI MSGFILES) + (RETURN NIL))) + (SETQ RESULT (DSKINSET FILE FNS)) + (OR (ZEROP (CHARPOS T)) (TERPRI MSGFILES)) + (COND ((EQ RESULT 'FILE-NOT-FOUND) + (PRINC '|File not found - | MSGFILES) + (PRINC (SHORTSPEC FILE) MSGFILES) + (TERPRI MSGFILES)) + ((EQ RESULT 'OPEN-ERROR) + (PRINC '|Error reading file - | MSGFILES) + (PRINC (SHORTSPEC FILE) MSGFILES) + (TERPRI MSGFILES)) + ((EQ RESULT 'LINE-NUMBERS) + (PRINC '|Can't read files with line numbers - | + MSGFILES) + (PRINC (SHORTSPEC FILE) MSGFILES) + (TERPRI MSGFILES)) + ((EQUAL FNS (INTERQ FNS RESULT))) + (T (SETQ FNS + (MAPCAN '(LAMBDA (XFILE) + (AND (NOT (MEMQ XFILE RESULT)) + (NCONS XFILE))) + FNS)) + (PRINC '|Not found: | MSGFILES) + (PRINC FNS MSGFILES) + (TERPRI MSGFILES))) + (SETQ LASTFILE (SHORTSPEC FILE)) + (RETURN (COND ((NOT (ATOM RESULT)) (SHORTSPEC FILE)))))) + T DEFAULTF)) + +(DEFUN TYPE FEXPR (XFILE) + (PROG (FILE FORM FCHAN) + (COND ((NULL (SETQ FILE (SLURPPARSEMCL (OR XFILE LASTFILE)))) + (PRINC '|Invalid file specification - | MSGFILES) + (PRINC (OR XFILE LASTFILE) MSGFILES) + (TERPRI MSGFILES) + (RETURN NIL)) + ((AND (PROBEF FILE) + (ERRSET (SETQ FCHAN (OPEN FILE 'IN)))) + (SETQ LASTFILE (SHORTSPEC FILE))) + (T (PRINC '|Open error on | MSGFILES) + (PRINC (SHORTSPEC FILE) MSGFILES) + (TERPRI MSGFILES) + (RETURN NIL))) + LOOP (TERPRI MSGFILES) + (COND ((EQ (SETQ FORM (READLINE FCHAN '*EOF*)) '*EOF*) + (CLOSE FCHAN) + (PRINC '|--- End of File ---| MSGFILES) + (TERPRI MSGFILES) + (RETURN (SHORTSPEC FILE)))) + (PRINC FORM MSGFILES) + (GO LOOP))) + +(DEFUN CHANGES NIL + (PROG (CHANGED) + (MAPC '(LAMBDA (FILE) + (COND ((SETQ CHANGED (EVAL (CHANGEDATOM FILE))) + (TERPRI MSGFILES) + (PRINC FILE MSGFILES) + (PRINC '| ==> | MSGFILES) + (LISTPRINT CHANGED MSGFILES) + (TERPRI MSGFILES)))) + SLURPEDFILES) + (COND ((SETQ CHANGED (FNS-IN-LIST CHANGEDLIST)) + (TERPRI MSGFILES) + (PRINC '|Unassigned Functions ==> | MSGFILES) + (LISTPRINT CHANGED MSGFILES) + (TERPRI MSGFILES))))) + +(DEFUN SAVEWORK NIL + (PROG (CHANGED) + (MAPC '(LAMBDA (FILE) + (COND ((EVAL (CHANGEDATOM FILE)) + (TERPRI MSGFILES) + (PRINC (APPLY 'UNSLURP FILE) MSGFILES) + (TERPRI MSGFILES)))) + SLURPEDFILES) + (COND ((SETQ CHANGED (FNS-IN-LIST CHANGEDLIST)) + (TERPRI MSGFILES) + (PRINC '|Unassigned Functions ==> | MSGFILES) + (LISTPRINT CHANGED MSGFILES) + (TERPRI MSGFILES))))) + +(DEFUN NEWFILE FEXPR (XFILE) + (PROG (FA FILE) + (SETQ FILE (SLURPPARSEMCL XFILE)) + (COND ((NULL FILE) + (OR (ZEROP (CHARPOS T)) (TERPRI MSGFILES)) + (PRINC '|Invalid file specification - | MSGFILES) + (PRINC XFILE MSGFILES) + (TERPRI MSGFILES) + (RETURN NIL))) + (SETQ FA (FILEATOM FILE)) + (COND ((BOUNDP FA) + (OR (ZEROP (CHARPOS T)) (TERPRI MSGFILES)) + (PRINC '|File Atom already exists - | MSGFILES) + (PRINC (SHORTSPEC FILE) MSGFILES) + (TERPRI MSGFILES) + (RETURN NIL))) + (SET FA (LIST NIL)) + (SET (CHANGEDATOM FILE) NIL) + (SET (PROPATOM FILE) NIL) + (PUTPROP FA T 'FILEATOM) + (PUSH (SHORTSPEC FILE) SLURPEDFILES) + (APPLY 'SEDIT XFILE) + (AND (NULL (CAR (SYMEVAL FA))) (SET FA (CDR (SYMEVAL FA)))) + (RETURN (SHORTSPEC FILE)))) + +(DEFUN DROPFILE FEXPR (XFILE) + (PROG (FA FILE) + (SETQ FILE (SLURPPARSEMCL XFILE)) + (COND ((NULL FILE) + (OR (ZEROP (CHARPOS T)) (TERPRI MSGFILES)) + (PRINC '|Invalid file specification - | MSGFILES) + (PRINC XFILE MSGFILES) + (TERPRI MSGFILES) + (RETURN NIL))) + (SETQ FA (FILEATOM FILE)) + (SETQ FILE (SHORTSPEC FILE)) + (COND ((NOT (BOUNDP FA)) + (OR (ZEROP (CHARPOS T)) (TERPRI MSGFILES)) + (PRINC '|File Atom does not exist - | MSGFILES) + (PRINC FILE MSGFILES) + (TERPRI MSGFILES) + (RETURN NIL))) + (SET (CHANGEDATOM FILE) NIL) + (RETURN FILE))) + +(DEFUN COPYFN FEXPR (FNS) + (PROG (TEMP SOURCEFN TARGETFN) + (SETQ TARGETFN (CAR FNS) + SOURCEFN (CADR FNS)) + (RETURN (AND (SETQ TEMP + (GETL SOURCEFN + '(EXPR FEXPR SUBR FSUBR LSUBR MACRO))) + (PROG2 (MAPCAR '(LAMBDA (PROP) + (REMPROP TARGETFN PROP)) + '(EXPR FEXPR + SUBR + FSUBR + LSUBR + MACRO)) + T) + (PUTPROP TARGETFN + (SUBST NIL NIL (CADR TEMP)) + (CAR TEMP)) + (MARK-CHANGED TARGETFN) + (SETQ LASTWORD TARGETFN) + TARGETFN)))) + +(DEFUN SLURP-DEFUN FEXPR (FNDEF) + (PROG (FNNAME PROP DEFINED) + (COND ((ATOM (CAR FNDEF)) + (COND ((MEMQ (CADR FNDEF) '(EXPR FEXPR MACRO)) + (SETQ FNNAME (CAR FNDEF)) + (SETQ PROP (CADR FNDEF))) + (T (SETQ FNNAME (CAR FNDEF)) (SETQ PROP 'EXPR)))) + (T (SETQ FNNAME (CAAR FNDEF)) (SETQ PROP (CADR FNDEF)))) + (AND (MEMQ PROP '(EXPR FEXPR MACRO)) + (SETQ DEFINED (GETL FNNAME '(EXPR FEXPR MACRO EXPR-HASH))) + (MAPCAR '(LAMBDA (PROP) (REMPROP FNNAME PROP)) + '(EXPR FEXPR MACRO EXPR-HASH))) + (SUBRCALL NIL (GET 'DEFUN 'SYSTEM-DEFUN) FNDEF) + (COND ((OR (NULL INSIDE-SLURP) DEFINED) + (MARK-CHANGED FNNAME) + (SETQ LASTWORD FNNAME))) + (RETURN FNNAME))) + +(DEFUN MARK-CHANGED NARGS + (PROG (FNS DONT-TOUCH-FILEATOMS) + (SETQ FNS (ARG 1.)) + (AND (> NARGS 1.) (SETQ DONT-TOUCH-FILEATOMS (ARG 2.))) + (MAPCAR '(LAMBDA (FN) + (OR (NOT (SYMBOLP FN)) + (MEMQ FN '(T NIL)) + (MAPCAN '(LAMBDA (FILE) + (COND ((MEMQ FN + (SYMEVAL (CHANGEDATOM FILE)) + ) + (LIST T)) + ((MEMQ FN + (CONS (FILEATOM FILE) + (SYMEVAL (FILEATOM + FILE)))) + (OR DONT-TOUCH-FILEATOMS + (SET (CHANGEDATOM FILE) + (CONS FN + (SYMEVAL ( + CHANGEDATOM FILE))))) + (LIST T)))) + SLURPEDFILES) + (MEMQ FN CHANGEDLIST) + (PUSH FN CHANGEDLIST))) + (COND ((ATOM FNS) (LIST FNS)) + (T FNS))) + (RETURN T))) + +(DEFUN FNS-IN-LIST (CHANGEDLIST) + (MAPCAN '(LAMBDA (FN) + (AND (GETL FN '(EXPR FEXPR MACRO FILEATOM)) (LIST FN))) + CHANGEDLIST)) + +(DEFUN LISTPRINT NARGS + (PROG (XLIST CPOS LINL FILES) + (SETQ XLIST (ARG 1.)) + (SETQ FILES + (COND ((> NARGS 1.) + (COND ((ATOM (ARG 2.)) (LIST (ARG 2.))) + (T (ARG 2.)))) + (T MSGFILES))) + (PRINC '|(| FILES) + (SETQ CPOS (CHARPOS (CAR FILES)) + LINL (LINEL (CAR FILES))) + (DO ((TLIST XLIST (CDR TLIST)) (FIRST T NIL)) + ((NULL TLIST)) + (COND ((< (1+ (FLATC (CAR TLIST))) + (1- (- LINL (CHARPOS T)))) + (OR FIRST (PRINC '| | FILES)) + (PRINC (CAR TLIST) FILES)) + (T (TERPRI FILES) + (TAB CPOS FILES) + (PRINC (CAR TLIST) FILES)))) + (PRINC '|)| FILES) + (RETURN T))) + +(DEFUN DEFSLURP FEXPR (XFILE) + (PROG (FNLIST FILE) + (SETQ FNLIST + (COND ((ATOM (CAR XFILE)) (NCONS (CAR XFILE))) + (T (CAR XFILE)))) + (SETQ FILE (CDR XFILE)) + (AND (NOT (SLURPPARSE FILE)) + ((LAMBDA (^W) + (TERPRI MSGFILES) + (PRINC '|Invalid DEFSLURP file specification - | + MSGFILES) + (PRINC (CDR XFILE) MSGFILES) + (BREAK DEFSLURP)) + NIL)) + (RETURN (MAPC '(LAMBDA (A) (PUTPROP A FILE 'AUTOLOAD)) FNLIST)))) + +(SETQ AUTOLOAD 'AUTOSLURP) + +(DEFUN AUTOSLURP (XFILE) + (PROG (LASTFILE FILE DEFAULTF) + (SETQ FILE (CDR XFILE)) + (AND (NOT (ATOM (CAR FILE))) + (NOT (FIXP (CAAR FILE))) + (SETQ FILE + (CONS (COND ((MEMQ (CAAR FILE) '(LISP LSP)) + (COND ((EQ (STATUS FILESYSTEM-TYPE) + 'DEC20) + ') + (T 'LISP:))) + (T (CADAR FILE))) + (CDR FILE)))) + (APPLY 'QSLURP FILE) + (COND ((NOT (GETL (CAR XFILE) + '(EXPR FEXPR MACRO SUBR FSUBR LSUBR))) + (TERPRI MSGFILES) + (PRINC '/; MSGFILES) + (PRINC (CAR XFILE) MSGFILES) + (PRINC '| from file | MSGFILES) + (PRINC (CDR XFILE) MSGFILES) + (PRINC '| undefined after autoslurp| MSGFILES) + (BREAK AUTOSLURP))))) + +(DEFUN UNIONQ (X Y) + (APPEND X + (MAPCAN '(LAMBDA (Y1) + (COND ((MEMQ Y1 X) NIL) + (T (LIST Y1)))) + Y))) + +(DEFUN INTERQ (X Y) + (MAPCAN '(LAMBDA (X1) (AND (MEMQ X1 Y) (LIST X1))) X)) + +(DEFUN DIFFQ (X Y) + (MAPCAN '(LAMBDA (X1) (AND (NOT (MEMQ X1 Y)) (LIST X1))) X)) + +(DEFUN DSKIN (FILE) + (PROG (OLDSEMI OLDFORM RESULT ECHOFILES) + (SETQ OLDSEMI (STATUS MACRO 59.)) + (SETQ OLDFORM (STATUS MACRO 12.)) + (AND (DSKINLINETEST FILE) (RETURN 'LINE-NUMBERS)) + (SETQ RESULT + ((LAMBDA (READTABLE) + (SETQ READTABLE (*ARRAY NIL 'READTABLE NIL)) + (COND (SLURP1-FORMFEEDS + (SETSYNTAX 12. + 'MACRO + '(LAMBDA NIL (LIST 'CONTROL-L)))) + (T (SSTATUS SYNTAX 12. (STATUS SYNTAX 13.)))) + (AND SLURP1-COMMENTS + (SETSYNTAX '/; 'MACRO 'READSEMI)) + (LIST (DSKIN1 FILE) READTABLE)) + READTABLE)) + (SETQ READTABLE (CADR RESULT)) + (SETSYNTAX 59. (OR (CADR OLDSEMI) 'MACRO) (CAR OLDSEMI)) + (SETSYNTAX 12. 'MACRO (CAR OLDFORM)) + (RETURN (CAR RESULT)))) + +(DEFUN DSKIN1 (FILE) + (PROG (FORM FORMV ATOMLIST FILEPROPS SLURP-INPUT INFILE ^Q) + (AND (ATOM (ERRSET (SETQ SLURP-INPUT (OPEN FILE 'IN)))) + (RETURN 'OPEN-ERROR)) + (SETQ INFILE SLURP-INPUT) + (SETQ ^Q T) + (SETQ FILEPROPS SLURPPROPS) + LOOP (COND ((EQ (CAR (SETQ FORM + (ERRSET (READ SLURP-INPUT '*EOF*)))) + '*EOF*) + (CLOSE SLURP-INPUT) + (SET (FILEATOM FILE) (REVERSE ATOMLIST)) + (SET (CHANGEDATOM FILE) NIL) + (OR (BOUNDP (PROPATOM FILE)) + (SET (PROPATOM FILE) NIL)) + (RETURN FILE)) + ((ATOM FORM) + (CLOSE SLURP-INPUT) + (RETURN 'OPEN-ERROR)) + (T (SETQ FORM (CAR FORM)))) + (COND ((ATOM FORM)) + ((OR (EQ (CAR FORM) 'DEFUN) + (AND (EQ (CAR FORM) 'SETQ) (NULL (CDDDR FORM))) + (AND (EQ (CAR FORM) 'DEFPROP) + (MEMQ (CADDDR FORM) FILEPROPS))) + (OR (MEMQ (CADR FORM) ATOMLIST) + (PUSH (CADR FORM) ATOMLIST))) + ((EQ (CAR FORM) 'SEMICOLON) + (COND ((AND (EQ (TYPEP (CAR ATOMLIST)) 'LIST) + (EQ (CAAR ATOMLIST) 'SEMICOLON)) + (NCONC (CAR ATOMLIST) (CDR FORM))) + (T (PUSH FORM ATOMLIST)))) + ((AND (EQ (CAR FORM) 'COMMENT) + (COND ((EQ (CADR FORM) '--CONTENTS--)) + ((EQ (CADR FORM) '--PROPS--) + (SET (PROPATOM FILE) (CDDR FORM)) + (SETQ FILEPROPS + (APPEND FILEPROPS (CDDR FORM)))) + (T NIL)))) + (T (PUSH FORM ATOMLIST))) + (COND ((ATOM FORM)) + ((EQ (CAR FORM) 'SEMICOLON)) + ((EQ (CAR FORM) 'CONTROL-L) (DSKPRINT FORM)) + (T (SETQ FORMV (ERRSET (EVAL FORM))) + (AND (ATOM FORMV) (DSKIN1ERR FORM)) + (AND (EQ (CAR FORM) 'SETQ) + (NULL (CDDDR FORM)) + (SETQ FORMV (NCONS (CADR FORM)))) + (DSKPRINT (CAR FORMV)))) + (GO LOOP))) + +(DEFUN DSKIN1ERR (FORM) + (PROG NIL + (TERPRI MSGFILES) + (PRINC '|FORM = | MSGFILES) + (PRIN1 FORM MSGFILES) + (TERPRI MSGFILES) + (BREAK |eval error during slurp; type $P to proceed|))) + +(DEFUN DSKINLINETEST (FILE) + (PROG (FILEOB R) + (OR (PROBEF FILE) (RETURN 'FILE-NOT-FOUND)) + (AND (ATOM (ERRSET (SETQ FILEOB (OPEN FILE 'FIXNUM)))) + (RETURN 'OPEN-ERROR)) + (ERRSET (SETQ R (AND (ODDP (IN FILEOB)) 'LINE-NUMBERS))) + (CLOSE FILEOB) + (RETURN R))) + +(DEFUN DSKINSET (FILE FNS) + ((LAMBDA (READTABLE) + (SETQ READTABLE (*ARRAY NIL 'READTABLE NIL)) + (AND SLURP1-COMMENTS (SETSYNTAX '/; 'MACRO 'READSEMI)) + (COND ((DSKINLINETEST FILE)) + (T (DSKINSET1 FILE FNS)))) + READTABLE)) + +(DEFUN DSKINSET1 (FILE FNS) + (PROG (GFNS FORM SLURP-INPUT INFILE ^Q ECHOFILES) + (OR (PROBEF FILE) (RETURN 'FILE-NOT-FOUND)) + (AND (ATOM (ERRSET (SETQ SLURP-INPUT (OPEN FILE 'IN)))) + (RETURN 'OPEN-ERROR)) + (SETQ INFILE SLURP-INPUT) + (SETQ ^Q T) + LOOP (COND ((ATOM (SETQ FORM (ERRSET (READ SLURP-INPUT '*EOF*)))) + (CLOSE SLURP-INPUT) + (RETURN 'OPEN-ERROR)) + ((EQ (SETQ FORM (CAR FORM)) '*EOF*) + (CLOSE SLURP-INPUT) + (RETURN GFNS))) + (OR (AND (EQ (TYPEP FORM) 'LIST) + (MEMQ (CAR FORM) '(DEFUN DEFPROP SETQ)) + (MEMQ (CADR FORM) FNS)) + (GO LOOP)) + (AND (ATOM (ERRSET (EVAL FORM))) (DSKIN1ERR FORM)) + (SETQ GFNS (CONS (CADR FORM) GFNS)) + (DSKPRINT (CADR FORM)) + (GO LOOP))) + +(DEFUN DSKOUT (FILE) + (PROG (FNS) + (AND (GETL 'TRACE '(SUBR LSUBR FSUBR EXPR FEXPR)) + (SETQ FNS (TRACE)) + (APPLY 'UNTRACE FNS)) + (RETURN (DSKOUT1 FILE)))) + +(DEFUN DSKOUT1 (FILE) + (PROG (OUTPUT NWFILE BKFILE CONTENTS) + (SETQ NWFILE (LIST (CAR FILE) (CADR FILE) 'M00)) + (SETQ BKFILE + (LIST (CAR FILE) + (CADR FILE) + (COND ((EQ (STATUS OPSYSTEM-TYPE) 'CMU) 'MBK) + (T 'LBK)))) + (AND LAST-SLURP-OUTPUT-FILE (CLOSE LAST-SLURP-OUTPUT-FILE)) + (AND (ATOM (ERRSET (SETQ OUTPUT (OPEN NWFILE 'OUT)))) + (RETURN 'OPEN-ERROR)) + (LINEL OUTPUT DSKOUT-LENGTH) + (SETQ LAST-SLURP-OUTPUT-FILE OUTPUT) + (SETQ CONTENTS (EVAL (FILEATOM FILE))) + (SETQ CONTENTS (DSKOUT2 CONTENTS FILE)) + (DSKOUT3 CONTENTS FILE OUTPUT) + (TERPRI OUTPUT) + (CLOSE OUTPUT) + (COND ((PROBEF FILE) + (AND (PROBEF BKFILE) (DELETEF BKFILE)) + (RENAMEF FILE BKFILE))) + (RENAMEF NWFILE FILE) + (RETURN FILE))) + +(DEFUN DSKOUT2 (CONTENTS FILE) + (PROG (CON2) + LOOP (COND ((AND CONTENTS + (EQ (TYPEP (CAR CONTENTS)) 'LIST) + (MEMQ (CAAR CONTENTS) '(COMMENT SEMICOLON)) + (COND ((NOT (EQ (CADAR CONTENTS) '--CONTENTS--))) + (T (SETQ CONTENTS (CDR CONTENTS)) NIL))) + (SETQ CON2 (APPEND CON2 (NCONS (CAR CONTENTS)))) + (SETQ CONTENTS (CDR CONTENTS)) + (GO LOOP))) + (RETURN (APPEND CON2 + (NCONS (LIST* 'COMMENT + '--CONTENTS-- + (MAPCAN '(LAMBDA (X) + (AND X + (ATOM X) + (NCONS X))) + CONTENTS))) + (AND (PROPATOMVAL FILE) + (NCONS (LIST* 'COMMENT + '--PROPS-- + (PROPATOMVAL FILE)))) + CONTENTS)))) + +(DEFUN DSKOUT3 (CONTENTS FILE OUTPUT) + (PROG (FILEPROPS VAL) + (SETQ FILEPROPS (UNIONQ SLURPPROPS (PROPATOMVAL FILE))) + (MAPC '(LAMBDA (FORM) + (COND ((NULL FORM)) + ((SYMBOLP FORM) + (AND (GETL FORM '(EXPR FEXPR MACRO)) + ((LAMBDA (^R ^W OUTFILES) + (APPLY 'GRINDEF (LIST FORM)) + (TERPRI OUTPUT)) + T T (LIST OUTPUT))) + (COND ((BOUNDP FORM) + (TERPRI OUTPUT) + (SETQ VAL (SYMEVAL FORM)) + (FUNCALL (OR PRIN1 'PRIN1) + `(SETQ ,FORM + ,(COND ((OR (EQ VAL T) + (EQ VAL NIL) + (NUMBERP VAL)) + VAL) + (T (LIST 'QUOTE + VAL)))) + OUTPUT) + (TERPRI OUTPUT))) + (MAPC '(LAMBDA (PROP) + (COND ((GET FORM PROP) + (TERPRI OUTPUT) + (FUNCALL (OR PRIN1 'PRIN1) + `(DEFPROP ,FORM + ,(GET FORM PROP) + ,PROP) + OUTPUT) + (TERPRI OUTPUT)))) + FILEPROPS)) + ((AND (EQ (TYPEP FORM) 'LIST) + (EQ (CAR FORM) 'SEMICOLON)) + (TERPRI OUTPUT) + (MAPC '(LAMBDA (COM) + (PRINC '/; OUTPUT) + (PRINC COM OUTPUT) + (TERPRI OUTPUT)) + (CDR FORM))) + ((EQ (CAR FORM) 'CONTROL-L) + (TERPRI OUTPUT) + (PRINC (ASCII 12.) OUTPUT)) + (T (TERPRI OUTPUT) + (FUNCALL (OR PRIN1 'PRIN1) FORM OUTPUT) + (TERPRI OUTPUT))) + (DSKPRINT FORM)) + CONTENTS))) + +(DEFUN DSKPRINT (X) + (PROG (COLPOS LINELEN FX PRIN1) + (OR SLURP-VERBOSITY (RETURN NIL)) + (SETQ COLPOS + ((LAMBDA (X) + (COND ((ZEROP X) X) + (T (+ X 16. (MINUS (REMAINDER X 16.)))))) + (CHARPOS T))) + (SETQ LINELEN (LINEL T)) + (COND ((EQUAL X '(CONTROL-L)) + (OR (ZEROP COLPOS) (TERPRI MSGFILES)) + (TERPRI MSGFILES)) + ((NOT (EQ (TYPEP X) 'LIST)) + (COND ((AND (EQ (TYPEP X) 'HUNK8) + (STATUS FEATURE NETL)) + (SETQ X (CXR 7. X))) + ((MEMQ X '(T NIL COMMENT DECLARE)) (RETURN NIL)) + ((OR (ATOM X) (NUMBERP X))) + (T (SETQ X (TYPEP X)))) + (COND ((LESSP (FLATSIZE X) (- LINELEN COLPOS)) + (OR (ZEROP COLPOS) (PRINC (ASCII 9.) MSGFILES)) + (OR (ZEROP (REMAINDER (CHARPOS T) 16.)) + (PRINC (ASCII 9.) MSGFILES)) + (PRIN1 X MSGFILES)) + (T (TERPRI MSGFILES) (PRIN1 X MSGFILES)))) + ((MEMQ (CAR X) + '(DECLARE COMMENT + SEMICOLON)) + (RETURN NIL)) + ((LESSP (LENGTH (SETQ FX (EXPLODE X))) LINELEN) + (OR (ZEROP COLPOS) (TERPRI MSGFILES)) + (PRIN1 X MSGFILES) + (TERPRI MSGFILES)) + (T (OR (ZEROP COLPOS) (TERPRI MSGFILES)) + (RPLACD (NTHCDR (- LINELEN 5.) FX) NIL) + (MAPC 'PRINC FX) + (PRINC '|...| MSGFILES))))) + +(DEFUN FILEATOM (FILE) + (AND (ATOM (CAR FILE)) (SETQ FILE (SLURPPARSE FILE))) + (IMPLODE (NCONC (EXPLODEC (CADR FILE)) + (LIST '-) + (EXPLODEC (CADDR FILE)) + (LIST '- 'F 'N 'S)))) + +(DEFUN CHANGEDATOM (FILE) + (AND (ATOM (CAR FILE)) (SETQ FILE (SLURPPARSE FILE))) + (IMPLODE (NCONC (EXPLODEC (CADR FILE)) + (LIST '-) + (EXPLODEC (CADDR FILE)) + (LIST '- 'C 'H 'G)))) + +(DEFUN PROPATOM (FILE) + (AND (ATOM (CAR FILE)) (SETQ FILE (SLURPPARSE FILE))) + (IMPLODE (NCONC (EXPLODEC (CADR FILE)) + (LIST '-) + (EXPLODEC (CADDR FILE)) + (LIST '- 'P 'R 'O 'P 'S)))) + +(DEFUN PROPATOMVAL (FILE) + (AND (BOUNDP (SETQ FILE (PROPATOM FILE))) (SYMEVAL FILE))) + +(DEFUN SHORTSPEC (X) + (PROG (Y) + (AND (ATOM (CAR X)) (RETURN X)) + (SETQ Y (CDR X)) + (AND (CADAR X) + (PUSH (COND ((EQ (STATUS FILESYSTEM-TYPE) 'DEC20) + (BROKIFY (CADAR X))) + (T (CADAR X))) + Y)) + (RETURN (COND ((EQ (CAAR X) + (CASEQ (STATUS FILESYSTEM-TYPE) + (DEC20 'PS) + (T 'DSK))) + Y) + (T (CONS (DEVIFY (CAAR X)) Y)))))) + +(DEFUN DEVIFY (X) (INTERN (IMPLODE (APPEND (EXPLODEC X) '(:))))) + +(DEFUN BROKIFY (X) + (INTERN (IMPLODE (APPEND '(<) (EXPLODEC X) '(>))))) + +(DEFUN TAB NARGS + (PROG (N CHAN P) + (SETQ N (ARG 1.)) + (SETQ CHAN + (COND ((> NARGS 1.) + (COND ((ATOM (ARG 2.)) (LIST (ARG 2.))) + (T (ARG 2.)))) + (T MSGFILES))) + (SETQ P (CHARPOS (CAR CHAN))) + (AND (> P N) (SETQ P 0.) (TERPRI CHAN)) + LOOP (COND ((= P N) (RETURN NIL)) + ((NOT (< N (+ P (- 8. (\ P 8.))))) + (PRINC (ASCII 9.) CHAN) + (SETQ P (+ P (- 8. (\ P 8.))))) + (T (PRINC '| | CHAN) (SETQ P (1+ P)))) + (GO LOOP))) + +(DEFUN READSEMI NIL (LIST 'SEMICOLON (READLINE SLURP-INPUT))) + +(DEFUN SEMICOLON MACRO (X) NIL) + +(SETQ SEMICOLON 'FULLSEMI) + +(DEFPROP SEMICOLON + (LAMBDA (TEMP ITEM) (FUNCALL SEMICOLON TEMP ITEM)) + GGRIND-FN) + +(DEFUN FULLSEMI (TEMP ITEM) + (PROG (G1PRINC-ATOMS) + (SETQ G1PRINC-ATOMS T) + (SETQ G1OPEN-DEL '/; + G1CLOSE-DEL '|| + G1LEVEL (1+ G1LEVEL)) + (COND (G1FORMAT-LIST (FUNCALL G1FORMAT-LIST TEMP (CDR ITEM))) + ((G1FORMAT-LIST TEMP (CDR ITEM)))) + (SETQ G1LEVEL (1- G1LEVEL)) + (PROGN (SETQ G1FCODE 'ALWAYS + G1BCODE 0.) + (G1ENTER-OBJ '|| 'PRINC NIL)))) + + +(DEFUN BRIEFSEMI (TEMP ITEM) + TEMP + (G1ENTER-OBJ NIL NIL 'START) + (PROGN (SETQ G1FCODE 'NORMAL + G1BCODE 0.) + (G1ENTER-OBJ '|(| 'PRINC NIL)) + (PROGN (SETQ G1FCODE 'NEVER + G1BCODE 0.) + (G1ENTER-OBJ (CADR ITEM) 'PRIN1 NIL)) + (PROGN (SETQ G1FCODE 'NEVER + G1BCODE 1.) + (G1ENTER-OBJ '|)| 'PRINC 'END))) + +(PROG (TEMP1 TEMP2 TEMP3) + (SETQ TEMP1 (NCONS '(NEVER))) + (RPLACD TEMP1 TEMP1) + (SETQ TEMP2 (NCONS (CONS 'ALWAYS (CONS 1. TEMP1)))) + (RPLACD TEMP2 TEMP2) + (SETQ TEMP1 (CONS 'NEVER (CONS 1. TEMP1))) + (SETQ TEMP3 (CONS NIL (CONS '(NEVER) (CONS TEMP1 TEMP2)))) + (PUTPROP 'DECLARE TEMP3 'GGRIND-TEMPLATE)) + +(PROG (TEMP1) + (SETQ TEMP1 (NCONS '(NEVER))) + (RPLACD TEMP1 TEMP1) + (SETQ TEMP1 (CONS NIL TEMP1)) + (PUTPROP 'COMMENT TEMP1 'GGRIND-TEMPLATE)) + +(DEFPROP |`-expander/|| + (LAMBDA (TEMP ITEM) + (SETQ G1OPEN-DEL '/`) + (SETQ G1CLOSE-DEL '||) + (SETQ G1LEVEL (1+ G1LEVEL)) + (CONTROL-L) + (FUNCALL (OR G1FORMAT-LIST 'G1FORMAT-LIST) + TEMP + (NCONS (CDR ITEM)))) + GGRIND-FN) + +(DEFPROP |`,/|| + (LAMBDA (TEMP ITEM) + (SETQ G1OPEN-DEL '/,) + (SETQ G1CLOSE-DEL '||) + (SETQ G1LEVEL (1+ G1LEVEL)) + (FUNCALL (OR G1FORMAT-LIST 'G1FORMAT-LIST) + TEMP + (NCONS (CDR ITEM)))) + GGRIND-FN) + +(DEFPROP |`,@/|| + (LAMBDA (TEMP ITEM) + (SETQ G1OPEN-DEL '/,@) + (SETQ G1CLOSE-DEL '||) + (SETQ G1LEVEL (1+ G1LEVEL)) + (FUNCALL (OR G1FORMAT-LIST 'G1FORMAT-LIST) + TEMP + (NCONS (CDR ITEM)))) + GGRIND-FN) + +(DEFPROP MACROEXPANDED + (LAMBDA (TEMP ITEM) + (G1FORMAT-DISPATCH NIL (CADDDR ITEM))) + GGRIND-FN) + +(PROG (CHANGEDLIST) + (OR (GET 'DEFUN 'SYSTEM-DEFUN) + (PUTPROP 'DEFUN (GET 'DEFUN 'FSUBR) 'SYSTEM-DEFUN)) + (COPYFN DEFUN SLURP-DEFUN)) + + \ No newline at end of file diff --git a/src/haunt/tlist.lsp b/src/haunt/tlist.lsp new file mode 100644 index 000000000..b4b5a59f4 --- /dev/null +++ b/src/haunt/tlist.lsp @@ -0,0 +1,142 @@ +(SETQ MUM-ATN + '((5. |tense| |flaming| |mumbling| |awesome| |foo| ) + (4. |mumble| |action| |baz| |nanos|))) + +(SETQ GHOST-ATN + '(|although | (15. + |wasted| + |strung out| + |soused| + |drunk| + |bombed| + |plastered| + |intoxicated| + |inebriated| + |temulent| + |inebrious| + |crapulous| + |sozzled| + |polluted| + |potted| + |ripped|) + |, the | + (9. + |fiend| + |poltergeist| + |apparition| + |spirit| + |ghost| + |spook| + |ghoul| + |spectre| + |wraith|) + | | + (8. |halts| |hinders| |prevents| |stops| |blocks| |stymies| |arrests| |stays|) + | your attempt to|)) + +(SETQ BAD-INPUT-ATN + '((13. + |that's a bit over my head.| + |no way buster.| + |try something different.| + |ich verstehe nicht.| + |yo no comprendo.| + |I don't grok that.| + |was that in Greek?| + |that's easy for you to say.| + |that does not compute.| + |try something else.| + |stop mumbling.| + |I don't understand that.| + |huh?|))) + +(SETQ BAD-DIRECTION-ATN + '((5. + |watch where you're going!| + |that direction is blocked.| + |ain't no way you gonna go that way.| + |try another direction.| + |not that way, you don't.|))) + +(SETQ NO-INPUT-ATN + '((7. + |insufficient data.| + |I didn't hear you.| + |speak up!| + |that's easy for you not to say.| + |don't try the silent treatment on me.| + |come on, lets do something.| + |talk! I need some attention.|))) + +(SETQ HELP-ATN + '((8. + |I don't feel like helping you| + |you don't deserve any help| + |first you have to prove you're worth it| + |so the big bad ghost hunter needs help| + |what have you ever done for me| + |you got yourself into this mess| + |I'm not the Salvation Army| + |help yourself|) + |, you | + (18. + |filthy| + |disgusting| + |vile| + |stupid| + |lousy| + |rotten| + |half-wit| + |incompetent| + |back-biting| + |dim-witted| + |moronic| + |degenerate| + |hard-core| + |flea-bitten| + |poor excuse for a| + |nano-brain| + |sexually depraved| + |dirty|) + | | + (24. + |nerd| + |rutabaga| + |tuna| + |nauga| + |armadillo| + |penguin| + |camel| + |moose| + |turkey| + |aardvark| + |flamer| + |asshole| + |jerk| + |heathen| + |skunk| + |vermin| + |hacker| + |cretin| + |NIL hacker| + |cockroach| + |insect| + |hacker| + |Pennsylvanian| + |Pittsburgher|))) + +(SETQ HAVE-ATN '((3. |you now own| |you just got| |you now have|))) + +(SETQ HOMER-ATN + '((4. + |think!| + |keep trying, something might work.| + |nothing happens.| + |the bust stays as it is.|))) + +(SETQ NOTCLOSED-ATN + '((4. + |if there is a secret panel near-by, this is not the way to open it.| + |you need to have your eyes examined.| + |I don't see anything closed.| + |there is nothing that is closed.|)))