BSD 4_2 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Tue, 8 Jun 1982 12:37:19 +0000 (04:37 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Tue, 8 Jun 1982 12:37:19 +0000 (04:37 -0800)
Work on file usr/src/games/mpu/locales
Work on file usr/src/games/mpu/locnames
Work on file usr/src/games/mpu/mpu.ddl
Work on file usr/src/games/mpu/routines
Work on file usr/src/games/mpu/objects
Work on file usr/src/games/mpu/transitions
Work on file usr/src/games/mpu/verbs
Work on file usr/src/games/mpu/frontend
Work on file usr/src/games/mpu/constants
Work on file usr/src/games/aard/frontend
Work on file usr/src/games/aard/aard.ddl
Work on file usr/src/games/ddl/sample/sample.ddl
Work on file usr/src/games/ddl/sample/READ_ME
Work on file usr/src/games/ddl/sample/constants.ddl
Work on file usr/src/games/ddl/sample/locnames.ddl
Work on file usr/src/games/ddl/sample/sample.ideas
Work on file usr/src/games/ddl/sample/routines.ddl
Work on file usr/src/games/ddl/sample/transit.ddl
Work on file usr/src/games/ddl/sample/verbs.ddl
Work on file usr/src/games/ddl/sample/locales.ddl
Work on file usr/src/games/ddl/sample/objects.ddl
Work on file usr/src/games/ddl/doc/READ-ME
Work on file usr/src/games/ddl/doc/ddlcomp.6
Work on file usr/src/games/ddl/doc/ddlrun.6
Work on file usr/src/games/ddl/doc/demo.sc
Work on file usr/src/games/ddl/doc/wishlist
Work on file usr/src/games/ddl/doc/tiny.ddl
Work on file usr/src/games/ddl/doc/builtins.ms
Work on file usr/src/games/ddl/doc/doc.ms
Work on file usr/src/games/ddl/READ-ME
Work on file usr/src/games/ddl/aard.ddl
Work on file usr/src/games/monop/monop.c
Work on file usr/src/games/monop/getinp.c
Work on file usr/src/games/monop/cards.c
Work on file usr/src/games/monop/jail.c
Work on file usr/src/games/monop/houses.c
Work on file usr/src/games/monop/morg.c
Work on file usr/src/games/monop/misc.c
Work on file usr/src/games/monop/print.c
Work on file usr/src/games/monop/rent.c
Work on file usr/src/games/monop/prop.c
Work on file usr/src/games/monop/roll.c
Work on file usr/src/games/monop/trade.c
Work on file usr/src/games/monop/spec.c
Work on file usr/src/games/monop/strcmp.c
Work on file usr/src/games/monop/cards.inp
Work on file usr/src/games/monop/deck.h
Work on file usr/src/games/monop/monop.h
Work on file usr/src/games/monop/initdeck.c
Work on file usr/src/games/monop/:rofix
Work on file usr/src/games/monop/monop.def
Work on file usr/src/games/monop/monop.ext

Synthesized-from: CSRG/cd1/4.2

52 files changed:
usr/src/games/aard/aard.ddl [new file with mode: 0644]
usr/src/games/aard/frontend [new file with mode: 0644]
usr/src/games/ddl/READ-ME [new file with mode: 0644]
usr/src/games/ddl/aard.ddl [new file with mode: 0644]
usr/src/games/ddl/doc/READ-ME [new file with mode: 0644]
usr/src/games/ddl/doc/builtins.ms [new file with mode: 0644]
usr/src/games/ddl/doc/ddlcomp.6 [new file with mode: 0644]
usr/src/games/ddl/doc/ddlrun.6 [new file with mode: 0644]
usr/src/games/ddl/doc/demo.sc [new file with mode: 0644]
usr/src/games/ddl/doc/doc.ms [new file with mode: 0644]
usr/src/games/ddl/doc/tiny.ddl [new file with mode: 0644]
usr/src/games/ddl/doc/wishlist [new file with mode: 0644]
usr/src/games/ddl/sample/READ_ME [new file with mode: 0644]
usr/src/games/ddl/sample/constants.ddl [new file with mode: 0644]
usr/src/games/ddl/sample/locales.ddl [new file with mode: 0644]
usr/src/games/ddl/sample/locnames.ddl [new file with mode: 0644]
usr/src/games/ddl/sample/objects.ddl [new file with mode: 0644]
usr/src/games/ddl/sample/routines.ddl [new file with mode: 0644]
usr/src/games/ddl/sample/sample.ddl [new file with mode: 0644]
usr/src/games/ddl/sample/sample.ideas [new file with mode: 0644]
usr/src/games/ddl/sample/transit.ddl [new file with mode: 0644]
usr/src/games/ddl/sample/verbs.ddl [new file with mode: 0644]
usr/src/games/monop/:rofix [new file with mode: 0644]
usr/src/games/monop/cards.c [new file with mode: 0644]
usr/src/games/monop/cards.inp [new file with mode: 0644]
usr/src/games/monop/deck.h [new file with mode: 0644]
usr/src/games/monop/getinp.c [new file with mode: 0644]
usr/src/games/monop/houses.c [new file with mode: 0644]
usr/src/games/monop/initdeck.c [new file with mode: 0644]
usr/src/games/monop/jail.c [new file with mode: 0644]
usr/src/games/monop/misc.c [new file with mode: 0644]
usr/src/games/monop/monop.c [new file with mode: 0644]
usr/src/games/monop/monop.def [new file with mode: 0644]
usr/src/games/monop/monop.ext [new file with mode: 0644]
usr/src/games/monop/monop.h [new file with mode: 0644]
usr/src/games/monop/morg.c [new file with mode: 0644]
usr/src/games/monop/print.c [new file with mode: 0644]
usr/src/games/monop/prop.c [new file with mode: 0644]
usr/src/games/monop/rent.c [new file with mode: 0644]
usr/src/games/monop/roll.c [new file with mode: 0644]
usr/src/games/monop/spec.c [new file with mode: 0644]
usr/src/games/monop/strcmp.c [new file with mode: 0644]
usr/src/games/monop/trade.c [new file with mode: 0644]
usr/src/games/mpu/constants [new file with mode: 0644]
usr/src/games/mpu/frontend [new file with mode: 0644]
usr/src/games/mpu/locales [new file with mode: 0644]
usr/src/games/mpu/locnames [new file with mode: 0644]
usr/src/games/mpu/mpu.ddl [new file with mode: 0644]
usr/src/games/mpu/objects [new file with mode: 0644]
usr/src/games/mpu/routines [new file with mode: 0644]
usr/src/games/mpu/transitions [new file with mode: 0644]
usr/src/games/mpu/verbs [new file with mode: 0644]

diff --git a/usr/src/games/aard/aard.ddl b/usr/src/games/aard/aard.ddl
new file mode 100644 (file)
index 0000000..4513d19
--- /dev/null
@@ -0,0 +1,2031 @@
+{*** ROUTINE DECLARATIONS ***}
+
+ROUTINE inside;
+ROUTINE ei8;
+ROUTINE cdrop;
+ROUTINE ctake;
+ROUTINE exitg;
+ROUTINE skore;
+ROUTINE darkq;
+ROUTINE darkt;
+ROUTINE objl;
+ROUTINE objs;
+ROUTINE onlmp;
+ROUTINE scord;
+ROUTINE ratng;
+ROUTINE ratnx;
+ROUTINE scads;
+
+{*** GLOBALS ***}
+
+kludge = 2;
+onoff = 2;
+signed = 2;
+tlakst = 2;
+fedmky = 2;
+ropstf = 2;
+readl = 3;
+wellbt = 2;
+cutflg = 2;
+earplg = 3;
+tookbt = 2;
+movbl = 1;
+darkbt = 2;
+rtied = 3;
+stond = 2;
+killd = 2;
+wiped = 2;
+blokd = 2;
+tooky = 2;
+abrad = 3;
+hitbr = 2;
+dugbt = 2;
+debug = 10;
+VISIT = 11;
+
+rarea = 19;
+pfound = 17;
+pplace = 18;
+pscore = 17;
+pmax = 18;
+ratvl = 19;
+weight = 20;
+
+Myloc = 15;
+
+{*** DEAD-END ROUTINES ***}
+
+
+cg = ($say "Can't go that way.
+");
+
+tosml = ($say "The hole is too small for you to fit through.
+");
+
+dumdir = ($say "I don't know which direction that is.
+");
+
+tohigh = ($say "The hole is too high for you to reach.
+");
+
+nothe = ($say "This section is not implemented yet.\n");
+
+{*** MUSEUM ROOMS ***}
+
+NOUN mrm1;
+NOUN mrm2;
+NOUN mrm3;
+NOUN mrm4;
+NOUN mrm5;
+NOUN mrm6;
+
+{*** INDIAN ROOMS ***}
+
+NOUN irm1;
+NOUN irm2;
+NOUN irm3;
+NOUN irm4;
+NOUN irm5;
+NOUN irm6;
+NOUN irm7;
+NOUN irm8;
+NOUN irm9;
+NOUN irm10;
+NOUN irm11;
+NOUN irm12;
+NOUN irm13;
+NOUN irm14;
+NOUN irm15;
+NOUN irm16;
+NOUN irm17;
+NOUN irm18;
+NOUN irm19;
+NOUN irm20;
+NOUN irm21;
+NOUN irm22;
+NOUN irm23;
+
+{*** PREHISTORIC ROOMS ***}
+
+NOUN prehs;
+NOUN prm1(prehs);
+prm1(darkbt) = 1;
+NOUN prm2(prehs);
+NOUN prm3(prehs);
+NOUN prm4(prehs);
+NOUN prm5(prehs);
+prm5(darkbt) = 1;
+NOUN prm6(prehs);
+prm6(darkbt) = 1;
+NOUN prm7(prehs);
+prm7(darkbt) = 1;
+NOUN prm8(prehs);
+prm8(darkbt) = 1;
+NOUN prm9(prehs);
+NOUN prm10(prehs);
+NOUN prm11(prehs);
+NOUN prm12(prehs);
+NOUN prm13(prehs);
+NOUN prm14(prehs);
+NOUN prm15(prehs);
+NOUN prm16(prehs);
+NOUN prm17(prehs);
+prm17(darkbt) = 1;
+NOUN prm18(prehs);
+prm18(darkbt) = 1;
+NOUN prm19(prehs);
+prm19(darkbt) = 1;
+NOUN prm20(prehs);
+prm20(darkbt) = 1;
+NOUN prm21(prehs);
+NOUN prm22(prehs);
+NOUN prm23(prehs);
+
+NOUN .ME;
+.ME(SDESC) = ($exit 0);
+.ME(LDESC) = ($exit 0);
+
+{*** PREPOSITIONS ***}
+
+PREP into;
+
+{*** OBJECTS ***}
+
+NOUN pen(mrm2);
+pen(movbl) = 1;
+pen(weight) = 1;
+pen(LDESC) = ($say "There is a ball-point pen here.\n");
+pen(SDESC) = ($say "ball-point pen");
+
+NOUN paper(mrm2);
+release = paper;
+form = paper;
+paper(movbl) = 1;
+paper(weight) = 1;
+paper(LDESC) = (($eq ($prop paper readl) 0) :
+               ($say "There is a slip of paper here.\n"))
+               (($eq ($prop paper readl) 1) :
+               ($say "There is a release form here.\n"));
+paper(SDESC) = (($eq ($prop paper readl) 0) : ($say "slip of paper"))
+               (($eq ($prop paper readl) 1) : ($say "release form"));
+
+NOUN spices(irm6);
+spices(movbl) = 1;
+spices(weight) = 3;
+spices(LDESC) = ($say "There is a bag of spices here.\n");
+spices(SDESC) = ($say "spices");
+spices(rarea) = 1;
+spices(pfound) = 5;
+spices(pplace) = 9;
+
+NOUN rupees(irm7);
+coins=rupees;
+rupees(movbl) = 1;
+rupees(weight) = 5;
+rupees(LDESC) = ($say "There is a bag of rupees (Indian coins) here.\n");
+rupees(SDESC) = ($say "rupees (coins)");
+rupees(rarea) = 1;
+rupees(pfound) = 5;
+rupees(pplace) = 15;
+
+NOUN coconut(irm3);
+coconut(movbl) = 1;
+coconut(weight) = 3;
+coconut(LDESC) = ($say "There is a large coconut here.\n");
+coconut(SDESC) = ($say "coconut");
+
+NOUN rope(mrm1);
+rope(movbl) = 1;
+rope(weight) = 3;
+rope(LDESC) = (($eq ($prop rope ropstf) 0):
+               ($say "There is a coil of rope here.\n"))
+               (($eq ($prop rope ropstf) 1) :
+               ($say "There is a long piece of rope here, magically
+rising up in mid-air.\n"));
+rope(SDESC) = ($say "rope");
+
+NOUN clarinet(irm2);
+clarinet(movbl) = 1;
+clarinet(weight) = 2;
+clarinet(LDESC) = ($say "There is a clarinet here.\n");
+clarinet(SDESC) = ($say "clarinet");
+
+NOUN cobra(irm22);
+cobra(LDESC) = ($say "There is a king cobra at the bottom of the pit.\n");
+cobra(SDESC) = ($say "cobra");
+snake = cobra;
+elapid = cobra;
+
+NOUN river;
+
+NOUN statue;
+
+NOUN banana(irm3);
+banana(movbl) = 1;
+banana(weight) = 2;
+banana(LDESC) = ($say "There is a banana here.\n");
+banana(SDESC) = ($say "banana");
+
+NOUN peel;
+peel(movbl) = 1;
+peel(weight) = 1;
+peel(LDESC) = ($say "On the ground, there is a banana peel.\n");
+peel(SDESC) = ($say "banana peel");
+
+NOUN vishnu;
+
+NOUN mara;
+
+NOUN lakshmi;
+
+NOUN crocodile;
+
+NOUN rhino(irm13);
+rhino(LDESC) = (($eq ($prop rhino cutflg) 1) :
+       ($say "There is a rhino sleeping here with his horn removed.\n"))
+       (($eq ($prop rhino cutflg) 0) : 
+       ($say "There is a rhinoceros sleeping in the corner.\n"))
+       (($eq ($prop rhino earplg) 1) :
+       ($say "There are two pieces of cotton stuck in his ears.\n"));
+rhino(SDESC) = ($say "sleeping rhino");
+
+NOUN saw(irm2);
+saw(movbl) = 1;
+saw(weight) = 2;
+saw(LDESC) = ($say "There is a hack-saw on the ground.\n");
+saw(SDESC) = ($say "hack-saw");
+hacksaw = saw;
+
+NOUN horn;
+horn(movbl) = 1;
+horn(weight) = 2;
+horn(LDESC) = ($say "There is a rhinoceros horn here.\n");
+horn(SDESC) = ($say "rhino horn");
+horn(rarea) = 1;
+horn(pfound) = 14;
+horn(pplace) = 7;
+
+NOUN cotton;
+cotton(movbl) = 1;
+cotton(weight) = 1;
+cotton(LDESC) = ($say "There is a large wad of cotton on the ground.\n");
+cotton(SDESC) = ($say "cotton");
+
+NOUN lattice(irm13);
+lattice(LDESC) = ($exit 0);
+lattice(SDESC) = ($exit 0);
+
+NOUN monkey(irm20);
+monkey(LDESC) = ($say "There is a sacred temple monkey here.\n");
+monkey(SDESC) = ($say "a monkey");
+
+NOUN tandoor;
+oven = tandoor;
+
+NOUN comb(irm14);
+comb(movbl) = 1;
+comb(weight) = 1;
+comb(LDESC) = ($say "There is an expertly carved jade comb here.\n");
+comb(SDESC) = ($say "jade comb");
+comb(rarea) = 1;
+comb(pfound) = 7;
+comb(pplace) = 6;
+
+NOUN ruby(irm17);
+ruby(movbl) = 1;
+ruby(weight) = 2;
+ruby(LDESC) = ($say "There is a crimson ruby here.\n");
+ruby(SDESC) = ($say "ruby");
+ruby(rarea) = 1;
+ruby(pfound) = 8;
+ruby(pplace) = 7;
+
+NOUN bowl(irm21);
+bowl(movbl) = 1;
+bowl(weight) = 3;
+bowl(LDESC) = ($say "There is a crystal bowl here.\n");
+bowl(SDESC) = ($say "bowl");
+bowl(rarea) = 1;
+bowl(pfound) = 10;
+bowl(pplace) = 10;
+
+NOUN bracelet(irm23);
+bracelet(movbl) = 1;
+bracelet(weight) = 1;
+bracelet(LDESC) = ($say 
+"There is a golden bracelet in the shape of a snake here.\n");
+bracelet(SDESC) = ($say "bracelet");
+bracelet(rarea) = 1;
+bracelet(pfound) = 11;
+bracelet(pplace) = 6;
+
+NOUN shovel(mrm1);
+shovel(movbl) = 1;
+shovel(weight) = 3;
+shovel(LDESC) = ($say 
+"There is a shovel here.\n");
+shovel(SDESC) = ($say "shovel");
+
+NOUN ears;
+
+NOUN pole;
+
+NOUN amber(prm3);
+amber(movbl) = 1;
+amber(weight) = 2;
+amber(LDESC) = ($say "There is a polished piece of amber here.\n");
+amber(SDESC) = ($say "amber");
+amber(rarea) = 2;
+amber(pfound) = 12;
+amber(pplace) = 6;
+
+NOUN lamp(mrm1);
+lamp(movbl) = 1;
+lamp(weight) = 3;
+lamp(LDESC) = ($say  "There is a carbide-flame lamp here.\n");
+lamp(SDESC) = ($say "lamp");
+
+NOUN grate;
+
+NOUN nugget;
+gold = nugget;
+nugget(movbl) = 1;
+nugget(weight) = 4;
+nugget(LDESC) = ($say "There is a gold nugget lying on the ground.\n");
+nugget(SDESC) = ($say "gold nugget");
+nugget(rarea) = 2;
+nugget(pfound) = 13;
+nugget(pplace) = 7;
+
+NOUN axe(prm1);
+axe(movbl) = 1;
+axe(weight) = 1;
+axe(LDESC) = ($say "There is an stone-age axe here.\n");
+axe(SDESC) = ($say "axe");
+
+NOUN spear(prm17);
+spear(movbl) = 1;
+spear(weight) = 2;
+spear(LDESC) = (($eq ($prop spear tooky) 1) : 
+               ($say "There is a Neanderthal hunting spear here.\n"))
+               (($eq ($prop spear tooky) 0) :
+               ($say
+"There is a Neanderthal hunting spear stuck in the ground.\n"));
+spear(SDESC) = ($say "spear");
+
+NOUN plant(prm2);
+plant(movbl) = 1;
+plant(weight) = 4;
+plant(LDESC) = ($say "There is a strange looking potted plant here.\n");
+plant(SDESC) = ($say "plant");
+
+NOUN smilodon;  {Putty tat}
+sabre = smilodon;
+
+NOUN troglodyte;
+
+NOUN cheese(prm4);
+cheese(movbl) = 1;
+cheese(weight) = 1;
+cheese(LDESC) = ($say
+"There is a piece of Swiss cheese here. (Aged 1,000,000 years).
+");
+cheese(SDESC) = ($say "cheese");
+
+NOUN towel(prm4);
+towel(movbl) = 1;
+towel(weight) = 2;
+towel(LDESC) = ($say "There is an old towel here.\n");
+towel(SDESC) = ($say "towel");
+
+NOUN mammoth(prm14);
+mammoth(LDESC) = ($say
+"There is a large wooly mammoth blocking the path to the south.\n");
+mammoth(SDESC) = ($say "mammoth");
+elephant = mammoth;
+pachyderm = mammoth;
+
+NOUN feet;
+
+NOUN diamond(prm12);
+diamond(movbl) = 1;
+diamond(weight) = 1;
+diamond(LDESC) = ($say "There is a small diamond here.\n");
+diamond(SDESC) = ($say "diamond");
+diamond(rarea) = 2;
+diamond(pfound) = 7;
+diamond(pplace) = 8;
+
+NOUN ivory(prm15);
+ivory(movbl) = 1;
+ivory(weight) = 2;
+ivory(LDESC) = ($say "There is a piece of ivory here.\n");
+ivory(SDESC) = ($say "ivory");
+ivory(rarea) = 2;
+ivory(pfound) = 9;
+ivory(pplace) = 8;
+
+NOUN pendant;
+pendant(movbl) = 1;
+pendant(weight) = 2;
+pendant(LDESC) = ($say "There is a ancient pendant here.\n");
+pendant(SDESC) = ($say "pendant");
+pendant(rarea) = 2;
+pendant(pfound) = 14;
+pendant(pplace) = 4;
+
+NOUN cairn;
+skulls = cairn;
+
+NOUN bear(prm19);
+bear(LDESC) = ($say "There is a ferocious cave bear blocking your path to the
+north.\n");
+bear(SDESC) = ($say "cave bear");
+
+NOUN necklace(prm20);
+necklace(movbl) = 1;
+necklace(weight) = 1;
+necklace(LDESC) = ($say "There is a pearl necklace here.\n");
+necklace(SDESC) = ($say "necklace");
+necklace(rarea) = 2;
+necklace(pfound) = 13;
+necklace(pplace) = 6;
+
+NOUN Tyranosaur;
+
+NOUN ring(prm23);
+ring(movbl) = 1;
+ring(weight) = 1;
+ring(LDESC) = ($say "There is a large diamond ring here.\n");
+ring(SDESC) = ($say "ring");
+ring(rarea) = 2;
+ring(pfound) = 13;
+ring(pplace) = 10;
+
+NOUN hole;
+
+NOUN newspaper(mrm1);
+newspaper(movbl) = 1;
+newspaper(weight) = 1;
+newspaper(LDESC) = ($say "There is a copy of a newspaper here.\n");
+newspaper(SDESC) = ($say "newspaper");
+
+NOUN crack;
+NOUN shaft;
+
+{*** VERBS ***}
+
+VERB sign;
+VERB read;
+VERB throw;
+VERB drop;
+VERB take;
+VERB play;
+VERB quit;
+VERB look;
+VERB inven;
+i=inven;l=look;
+VERB rname;
+VERB save;
+VERB shell;
+VERB restore;
+VERB touch;
+VERB eat;
+VERB swim;
+VERB feed;
+VERB score;
+VERB abracadabra;
+VERB dig;
+VERB cut;
+VERB plug;
+VERB tie;
+VERB untie;
+VERB on;
+VERB off;
+VERB light;
+VERB open;
+VERB close;
+VERB wipe;
+VERB shake;
+VERB xyzzy;
+VERB jamb;
+plugh = xyzzy;
+clean = wipe;
+shut = close;
+peruse = read;
+chuck = throw;
+hurl = throw;
+toss = throw;
+heave = throw;
+put = drop;
+discard = drop;
+get = take;
+grab = take;
+push = touch;
+pet = touch;
+devour = eat;
+consume = eat;
+wade = swim;
+ford = swim;
+shazam = abracadabra;
+hocus = abracadabra;
+abra = abracadabra;
+excavate = dig;
+remove = cut;
+end = quit;
+bye = quit;
+
+{*** FUNNY OBJECT ROUTINES ***}
+
+paper(ACTION) = (($eq ($verb) sign) :
+               (($eq ($prop paper signed) 1) :
+               ($say "You already signed it.\n")
+               ($exit 1))
+               (($ne ($loc pen) .ME) :
+               ($say "You don't have anything to write with.\n")
+               ($exit 1))
+               (($ne ($loc paper) .ME) :
+               ($say "You don't have the release with you.\n")
+               ($exit 1))
+               ($setp paper signed 1)
+               (($eq ($loc .ME) mrm3) : ($say 
+"In a blinding flash of light, a stone archway appears in the east wall!\n")
+               ($exit 1))
+               (($eq ($loc .ME) mrm5) :
+               ($say "The grate magically disappears into thin air.\n")
+               ($exit 1))
+               ($say "You hear strange noises in the nearby rooms.\n")
+               ($exit 1))
+       (($eq ($verb) read) :
+               (($ne ($loc paper) .ME) :
+               ($say "You don't have the paper with you.\n")
+               ($exit 1))
+               ($say
+"                   THIS CONTRACT LIMITS OUR LIABILITY
+                                READ IT
+
+I, the undersigned, will not hold the AARDVARK, the UCLA Computer Sciences
+Department, the UCLA Computer Club, Bell Labs, or the Digital Equipment
+Corporation responsible for any injuries or deaths due to my executing
+this program.\n")
+               ($setp paper readl 1)($exit 1));
+
+spices(ACTION) = (($and ($eq ($verb) throw) ($eq ($loc .ME) irm8)) :
+               ($say "The bag of spices lands on the other side of the river.
+")
+               ($move spices irm9)($exit 1))
+               (($eq ($verb) eat) :
+               ($say "Munch, Munch Munch.  It needed a little more salt.\n")
+               ($move spices .ALL)
+               ($exit 1) )
+               (($and ($eq ($verb) throw) ($eq ($loc .ME) irm9)) :
+               ($say "The bag of spices gets intercepted by one of the
+crocodiles, who promptly swallows it.\n")($move spices .ALL) 
+               ($exit 1));
+
+rupees(ACTION) = (($and ($eq ($verb) throw)
+                       ($or ($eq ($loc .ME) irm8) ($eq ($loc .ME) irm9))) :
+                       ($say
+"The bag is too heavy to throw across the river.  It lands in the middle
+of the river and sinks to the bottom.\n")($move rupees .ALL)
+                       ($exit 1));
+
+coconut(ACTION) = (($and ($eq ($loc .ME) irm19) ($eq ($verb) drop)) :
+               (($ne ($loc coconut) .ME) :($exit 0))
+               (($eq ($prop rupees wellbt) 0) :
+               ($say "The water in the well rises.\n")
+               ($move coconut irm19) ($exit 1))
+               ($say "The water level in the well slowly rises.
+Magically floating on the water is a bag of rupees.\n")
+               ($setp rupees wellbt 0)
+               ($move rupees irm19)
+               ($move coconut irm19) ($exit 1))
+               (($and ($eq ($verb) eat) ($eq ($loc coconut) .ME)) :
+               ($say "The coconut is too large for you to consume.\n")
+               ($exit 1) );
+
+clarinet(ACTION) = (($and ($eq ($verb) play) ($eq ($loc clarinet) .ME)) :
+               (($eq ($loc .ME) irm22) :
+               (($eq ($loc cobra) irm22) :
+               ($say "Your clarinet playing sounds so poor that the cobra
+slithers off in terror.\n")
+               ($move cobra .ALL) ($exit 1)))
+               (($eq ($loc .ME) irm16) :
+               (($eq ($loc rope) irm16) :
+               (($eq ($prop rope ropstf) 0) :
+               ($say "The rope magically extends itself up into the air.\n")
+               ($setp rope ropstf 1)($exit 1))))
+               ($say "Benny Goodman you ain't.\n")
+               ($exit 1));
+
+rope(ACTION) = (($eq ($prop rope ropstf) 1) :
+               (($eq ($verb) take) :
+               ($setp rope ropstf 0))($exit 0))
+               (($or ($eq ($loc .ME) prm2) ($eq ($loc .ME) prm3)) :
+               (($eq ($prop rope rtied) 1) :
+               (($eq ($verb) take) :
+               ($say "You have to untie the rope first.\n") ($exit 1))
+               (($eq ($verb) tie) :
+               ($say "It's already tied, turkey.\n") ($exit 1))
+               (($eq ($verb) untie) :
+               (($eq ($loc .ME) prm2) :
+               ($move rope .ME) ($setp rope rtied 0)
+               ($say "You untie the rope and coil it up.\n"))
+               (($eq ($loc .ME) prm3) :
+               ($say "It's tied down at the other end.\n"))
+               ($exit 1)))
+               (($eq ($prop rope rtied) 0) :
+               (($eq ($verb) tie) :
+               (($eq ($loc .ME) prm2) :
+               ($say "You tie one end of the rope around the pole, the other
+end dangles down into the canyon.\n")
+               ($move rope .ALL)
+               ($setp rope rtied 1) ($exit 1))
+               ($say "I see nothing to tie it onto.\n") ($exit 1))
+               (($eq ($verb) untie) :
+               ($say "It's already untied.\n"))))
+               (($eq ($loc .ME) prm3) :
+               (($eq ($verb) take) : ($say
+"You can't take it, the other end is tied down.\n") ($exit 1))
+               (($eq ($verb) untie) : ($say
+"the knot is on the other end.\n") ($exit 1)));
+
+river(ACTION) = (($and ($ne ($loc .ME) irm8) ($ne ($loc .ME) irm9)) :
+               ($say "I see no river here.\n")($exit 1))
+               (($eq ($verb) take) :
+               ($say "I can't do that.\n") ($exit 1));
+
+cobra(ACTION) = (($and ($eq ($verb) take) ($eq ($loc .ME) ($loc cobra))) :
+               ($say "That would be a poor idea.\n")($exit 1));
+
+crocodile(ACTION) = (($eq ($verb) take) :
+               ($say "I can't get to any crocodiles from here.\n")
+               ($exit 1));
+
+cmara = (($eq ($verb) take) :
+       ($say "The statue is too heavy for you to carry.\n")
+       ($exit 1));
+claks = (($and ($or ($eq ($verb) take) ($eq ($verb) touch))
+       ($eq ($prop statue tlakst) 0)) :
+       ($say
+"The statue slides away very easily, revealing a secret passage.\n")
+               ($setp statue tlakst 1)($exit 1));
+mara(ACTION) = (($eq ($loc .ME) irm10) : (cmara));
+vishnu(ACTION) = (($eq ($loc .ME) irm11) : (cmara));
+lakshmi(ACTION) = (($eq ($loc .ME) irm12) : (claks));
+statue(ACTION) = (($or ($eq ($loc .ME) irm10) ($eq ($loc .ME) irm11)) :
+               (cmara)
+               ($say "That won't accomplish anything.\n")
+               ($exit 1))
+               (($eq ($loc .ME) irm12) : (claks)
+               ($say "I don't see how you can do that to a statue.\n")
+               ($exit 1));
+
+banana(ACTION) = (($eq ($loc banana) .ME) :
+               (($eq ($verb) eat) :
+               ($say "You eat the banana, peel and all.\n")
+               ($move banana .ALL)
+               ($exit 1)))
+               (($eq ($loc .ME) irm20) :
+               (($eq ($verb) drop) :
+               ($say "The monkey picks up the banana, eats it, and discards
+the banana-peel.  As soon as the monkey finishes eating
+the banana, a bolt of lighting hits the stone slab and 
+cracks it open.\n")
+               ($setp monkey fedmky 1)
+               ($move banana .ALL)
+               ($move peel irm20) ($exit 1)));
+
+horn(ACTION) = (($eq ($prop rhino cutflg) 1) : ($exit 0))
+               (($eq ($loc .ME) irm13) : 
+               (($eq ($verb) take) :
+               ($say "It is still attached to the rhino.\n")
+               ($exit 1))
+               (($eq ($verb) cut) :
+               (($ne ($loc saw) .ME) :
+               ($say "You don't have something to cut the horn with.\n")
+               ($exit 1))
+               (($eq ($prop rhino earplg) 1) :
+               ($say "You cut the horn off without waking up the rhino.\n")
+               ($setp rhino cutflg 1)
+               ($move horn irm13) ($exit 1))
+               ($say "The noise of the sawing wakes up the rhinoceros who
+tramples you to death because you disturbed his beauty sleep.\n")
+               (exitg)));
+
+lattice(ACTION) = (($eq ($loc .ME) irm13) :
+               (($eq ($verb) take) :
+               (($eq ($prop rhino earplg) 1) :
+               ($say "You successfully take the lattice without waking the
+rhino.  Unfortunately, the lattice was the structure which supported the roof
+of the room, and the ceiling comes crashing down upon you and breaks every 
+bone in your body.\n"))
+               (($eq ($prop rhino earplg) 0) :
+               ($say "As you take the lattice, a large part of the bamboo
+falls down.  The noise caused by the falling bamboo scares the sleeping
+rhinoceros who tramples you in his panicked exit from the room.\n"))
+               (exitg)));
+
+monkey(ACTION) = (($eq ($loc .ME) irm20) :
+               (($eq ($verb) feed) :
+               (($eq ($loc banana) .ME) :
+               ($say "The monkey takes your banana, peels it, eats it,
+and throws away the banana peel.  As soon as he finishes eating
+the banana, there is a rumble from the depths of the earth and 
+a crack appears in the stone slab.\n")
+               ($setp monkey fedmky 1)
+               ($move banana .ALL)
+               ($move peel irm20) ($exit 1))));
+
+cotton(ACTION) = (($eq ($loc .ME) irm13) :
+               (($and ($eq ($verb) drop) ($eq ($iobj) ears)) :
+               ($say
+"You stick the wads of cotton into the rhino's ears.\n")
+               ($move cotton .ALL)
+               ($setp rhino earplg 1)
+               ($exit 1)))
+               (($eq ($loc cotton) .ALL):
+               (($eq ($loc .ME) irm13):
+               (($eq ($verb) take) :
+               ($say "OK\n")
+               ($move cotton .ME)
+               ($setp rhino earplg 0)
+               ($exit 1))));
+
+pole(ACTION) = (($and ($eq ($loc .ME) prm2) ($eq ($verb) take)) :
+               ($say "The pole is firmly cemented into the ground.\n")
+               ($exit 1));
+
+lamp(ACTION) = (($eq ($verb) light) : (onlmp) ($exit 1));
+
+oven(ACTION) = (($and ($eq ($loc .ME) irm4) ($eq ($verb) open)) :
+               ($say "The door of the oven doesn't budge.\n")
+               ($exit 1));
+
+grate(ACTION) = (($and ($eq ($prop paper signed) 0)
+                       ($eq ($loc .ME) mrm5)) :
+               (($or ($eq ($verb) open) ($eq ($verb) take)) :
+                       ($say
+"The grate appears to be firmly cemented into the wall.\n")
+               ($exit 1))
+               (($eq ($verb) shut) :
+               ($say "The grate is already shut.\n")($exit 1)));
+
+weapo = (($eq ($verb) throw) :
+       (($and ($eq ($prop bear hitbr) 0) ($eq ($loc .ME) prm19)) :
+       ($say "The axe bounces harmlessly off of the bear.\n")
+       ($move axe prm19) ($exit 1))
+       (($eq ($loc .ME) prm14) :
+       ($say "The weapon that you just threw imbeds itself deep into the 
+skull of the mammoth and is covered by the mammoth's long fur so that it
+can't be seen.  The mammoth just stares back at you blankly.\n")
+       ($move ($dobj) .ALL) ($exit 1))
+       (($or ($eq ($loc .ME) irm8) ($eq ($loc .ME) irm9)) :
+       ($say "You miss the crocodile and your weapon sinks into the river.\n")
+       ($move ($dobj) .ALL) ($exit 1))
+       (($eq ($loc .ME) irm13):
+       ($say "Your weapon bounces harmlessly off of the rhino.\n")
+       ($move ($dobj) irm13) ($exit 1))
+       (($and ($eq ($loc .ME) prm6) ($eq ($prop smilo stond) 0)) :
+       ($say "The sabre-tooth catches your weapon in its mouth and promptly
+swallows it.\n") ($move ($dobj) .ALL) ($exit 1))
+       (($and ($eq ($loc .ME) prm8) ($eq ($prop trogl killd) 0)) :
+       ($say "You hit the troglodyte, who, screaming in pain, drops the
+gold nugget and falls over the cliff.\n") ($setp trogl killd 1)
+       ($move ($dobj) .ALL)
+       ($move nugget prm8) ($exit 1)));
+
+spear(ACTION) = (($eq ($loc spear) .ME) : 
+               (($ne ($loc .ME) prm19) :
+               (weapo))
+               (($eq ($loc .ME) prm19) :
+               (($eq ($verb) throw) :
+               ($say
+"You repeatedly throw your spear at the bear.  Eventually, he gets
+bored and wanders off.\n")
+               ($move bear .ALL)
+               ($move spear prm19)
+               ($setp bear hitbr 1) ($exit 1) )))
+               (($eq ($loc .ME) prm17) :
+               (($eq ($verb) take) :
+               (($eq ($prop spear tooky) 0) :
+               ($say
+"You hear a loud roar as an avalanche blocks the path to your north.\n")
+               ($move spear .ME)
+               ($setp spear tooky 1) ($exit 1))))
+               (($eq ($verb) shake) :
+($say "I don't see any playwrights here.\n"))
+               (($and ($eq ($loc .ME) prm23) ($eq ($verb) take)) :
+               ($say 
+"As soon as you take the spear, the Tyranosaurus Rex closes his mouth and
+swallows you.\n") (exitg));
+
+axe(ACTION) = (($eq ($loc axe) .ME) : (weapo));
+
+smilo(ACTION) = (($and ($eq ($loc .ME) prm6) ($eq ($verb) take)) :
+               ($say "You must be dumber than you look.\n")
+               ($exit 1));
+
+troglodyte(ACTION) = (($and ($eq ($loc .ME) prm8) ($eq ($verb) take)) :
+               ($say "The troglodyte does not look like he wants to be
+carried.\n") ($exit 1));
+
+plant(ACTION) = (($eq ($loc .ME) prm6) :
+               (($or ($eq ($verb) throw) ($eq ($verb) drop)) :
+               (($eq ($prop smilo stond) 0) :
+               ($say 
+"The plant you were holding turns out to be primo grade catnip.  The
+sabre-tooth cat grabs the plant and runs off purring loudly.\n")
+               ($move plant .ALL)
+               ($setp smilo stond 1) ($exit 1))))
+               (($eq ($verb) eat) :
+               ($say 
+"You completely eat the plant and now feel quite nauseous.\n")
+               ($move plant .ALL) ($exit 1));
+
+nugget(ACTION) = (($and ($eq ($verb) take)
+               ($eq ($prop trogl killd) 0)) :
+               ($say "He ain't gonna let you take it.\n")($exit 1));
+
+cheese(ACTION) = (($eq ($verb) eat) :
+               ($say "You eat the cheese, but nothing peculiar happens.\n")
+               ($move cheese .ALL) ($exit 1))
+               (($and ($eq ($verb) drop) ($eq ($loc .ME) prm14)) :
+               ($say 
+"As soon as you drop the cheese, a mouse runs out of the hole in the east 
+wall and takes it.  This scares the mammoth who runs off in terror.\n")
+               ($setp mammoth blokd 1)
+               ($move mammoth .ALL)
+               ($move cheese .ALL) ($exit 1));
+
+mammoth(ACTION) = (($eq ($loc mammoth) ($loc .ME)) :
+               (($eq ($verb) feed) :
+               ($say "He doesn't look hungry.\n")($exit 1))
+               (($eq ($verb) take) : ($say
+"He doesn't look too easy to carry.\n") ($exit 1)));
+
+feet(ACTION) = (($eq ($verb) wipe) :
+               (($ne ($loc towel) .ME) :
+               ($say "You don't have something to wipe them with.\n")
+               ($exit 1))
+               ($say "You just cleaned off your feet.\n")
+               ($setp feet wiped 0) ($exit 1))
+               (($eq ($verb) touch) :
+               ($say "You can't without bending your knees.\n"));
+
+cairn(ACTION) = (($eq ($loc .ME) prm18) :
+               ($say 
+"How dare you do such a thing.  Any idiot with just the slightest knowledge
+of prehistoric etiquette knows that you aren't supposed to do anything to
+a cairn.\n") ($exit 1) );
+
+bear(ACTION) = (($eq ($loc .ME) prm19) :
+               (($eq ($verb) take) :
+               (($eq ($prop bear hitbr) 0) :
+               ($say 
+"The bear is a little too bulky to carry.\n")($exit 1))));
+
+Tyranosaur(ACTION) = (($and ($ne ($loc .ME) prm22) ($ne ($loc .ME) prm23)) :
+               ($say
+"What?  One of those things hasn't existed in several million years.\n"));
+
+hole(ACTION) = (($eq ($loc .ME) prm14) :
+               ($say "That hole is too small to do anything with.\n")
+               ($exit 1))
+               (($eq ($loc .ME) irm19) :
+               (($eq ($verb) drop) :
+               (($eq ($iobj) hole) :
+               ($say "It falls back out of the hole.\n")
+               ($exit 1))))
+               (($eq ($loc .ME) irm6) :
+               (($eq ($verb) drop) :
+               (($eq ($iobj) hole) :
+               (($eq ($dobj) spices) :
+               (($ne ($loc spices) .ME) :
+               ($say "You ain't got it with you.\n")
+               ($exit 1))
+($say "The bag of spices rips against the jagged sides of the shaft and 
+almost all of the spices get blown away in the wind.\n")
+               ($move spices .ALL)
+               ($exit 1))
+               (($eq ($dobj) rupees) :
+               (($ne ($loc rupees) .ME) :
+               ($say "You ain't got the coins with you.\n")
+               ($exit 1))
+($say "The rupees fall down the shaft into the darkness below.  You
+eventually hear a barely audible splash.\n")
+               ($setp rupees wellbt 1)
+               ($move rupees .ALL)
+               ($exit 1))
+               ($say "That doesn't fit in the hole.\n")
+               ($exit 1)
+               )))
+               ($say "I do not see any holes here.\n");
+
+newspaper(ACTION) = (($and ($eq ($verb) read) ($eq ($loc newspaper) .ME)) :
+               ($say
+"                         DAILY GNUS
+Vol 2.                                                         25 AUGUST
+
+")
+               ($say
+"Spies in the far reaches of the Museum have reported that new construction
+is now taking place.\n\n")
+               ($say
+"Dungeon consultant Mr. Mctesq has recently waved his magic wand over the aardvark
+museum.  The following things should be brought to light
+The commands, SAVE, RESTORE, and SHELL exists and work.
+")
+               ($say
+"Multiple commands on a line seperated by a comma are properly handled
+by the ddl parser.\n")
+               ($say
+"Again, Adventurers are reminded that restocking of the museum sections will
+be greatly rewarded.\n\n"
+                       )($exit 1));
+
+crack(ACTION) = (($eq ($verb) jamb) :
+               ($say "The only climbable cracks in this place are A4.\n")
+               ($exit 1))
+               ($say "I can't figure that out. I'm not as smart as I am 
+cracked up to be.\n")($exit 1);
+
+shaft(ACTION) = (($eq ($verb) jamb) :
+               ($say "Try jamb crack (How do you jamb a shaft?)\n")
+               ($exit 1));
+
+{*** DIRECTIONS ***}
+
+VERB north;
+VERB south;
+VERB east;
+VERB west;
+VERB up;
+VERB down;
+VERB in;
+VERB out;
+n=north;
+s=south;
+e=east;
+w=west;
+u=up;
+d=down;
+enter = in;
+exit=out;
+leave=out;
+climb=up;
+
+{*** VERB ROUTINES ***}
+
+plug(ACTION) = (($eq ($loc .ME) irm13) :
+               (($eq ($loc cotton) .ME) :
+               ($say
+"You stick the cotton into the rhino's ears.\n")
+               ($move cotton .ALL)
+               ($setp rhino earplg 1)
+               ($exit 1)))
+               ($say "I don't quite understand what you mean.\n");
+
+dig(ACTION) = (($ne ($loc shovel) .ME) :
+               ($say "You don't have something to dig with.\n")
+               ($exit 1))
+               (($eq ($loc .ME) irm9) :
+               (($eq ($prop cotton tookbt) 0) : ($setp cotton tookbt 1)
+               ($say "You find some cotton buried in the sand.\n")
+               ($move cotton irm9)($exit 0))
+               ($say "OK\n") ($exit 0))
+               (($eq ($loc .ME) prm17) :
+               (($eq ($prop pendant dugbt) 0) : ($setp pendant dugbt 1)
+               ($say "You find an ancient pendant buried in the grave.\n")
+               ($move pendant prm17) ($exit 0))
+               ($say "You dig some but you don't find anything.\n")
+               ($exit 0))
+               ($say "The ground is too hard to dig into.\n");
+
+cantdo = ($say "I don't believe I can do that.\n");
+sign(ACTION) = (cantdo);
+play(ACTION) = (cantdo);
+
+arolg = ($say "It will probably cost you an arm or a leg to feed that.\n")
+       ($exit 1);
+feed(ACTION) = (($or ($eq ($loc .ME) irm8) ($eq ($loc .ME) irm9)) :
+               (($eq ($dobj) crocodile) :
+               (arolg)))
+               (($and ($eq ($loc .ME) prm19) ($eq ($dobj) bear)) :
+               (($eq ($prop bear hitbr) 0) :
+               (arolg)))
+               (($and ($eq ($loc .ME) prm6) ($eq ($dobj) smilo)) :
+               (($eq ($prop smilo stond) 0) :
+               (arolg)))
+               (($or ($eq ($loc .ME) prm22) ($eq ($loc .ME) prm23)) :
+               (($eq ($dobj) Tyran) : (arolg)))
+               ($say "I don't quite understand what you mean.\n");
+
+cut(ACTION) = (cantdo);
+
+read(ACTION) = ($say "I don't see any text here that I can read.\n");
+
+throw(ACTION) = (cdrop);
+
+touch(ACTION) = ($say "That doesn't seem to accomplish much.\n");
+
+eat(ACTION) = ($say "I think I just lost my appetite.\n");
+
+abracadabra(ACTION) = (($ne prehs ($loc ($loc .ME))) :
+               ($say
+"That phrase hasn't worked in at least ten thousand years.\n")
+               ($exit 0))
+               (($ne ($loc .ME) prm17) :
+               ($say "Nothing happens.\n") ($exit 0))
+               (($eq ($prop spear tooky) 1) :
+               (($eq ($prop spear abrad) 0) :
+               ($setp spear abrad 1)
+               ($say "The rubble gets magically cleared away.\n")
+               ($exit 0)))
+               ($say "Nothing much happens.\n");
+
+tie(ACTION) =  ($say "It is impossible to tie a knot in that right now. \n");
+
+untie(ACTION) = ($say "I don't quite understand what you mean.\n");
+
+on(ACTION) = (($eq ($prop lamp onoff) 1) :
+               ($say "The lamp is already on.\n") ($exit 1))
+               (onlmp) ($exit 1);
+
+off(ACTION) = (($ne ($loc lamp) .ME) :
+               ($say "You don't have the lamp with you.\n")
+               ($exit 1))
+               (($eq ($prop lamp onoff) 0) :
+               ($say "The lamp is already off.\n")
+               ($exit 1))
+               ($setp lamp onoff 0)
+               ($say "The lamp is now off.\n");
+
+light(ACTION) = ($say "I don't know how to light that.\n");
+
+open(ACTION) = ($say "That thing is un-openable.\n");
+
+close(ACTION) = ($say "I don't quite understand what you mean.\n" );
+
+swim(ACTION) = (($eq ($loc .ME) irm8) :
+               (ei8) ($exit 0))
+               (($eq ($loc .ME) irm9) :
+               (ei8) ($move .ME irm8) ($exit 0))
+               ($say "I don't see enough water here to even wade in.\n");
+
+wipe(ACTION) = ($say "I don't quite comprehend what you are saying.\n");
+
+shake(ACTION) = ($say "That probably won't accomplish much.\n");
+
+jamb(ACTION) = ($say "I don't quite comprehend what you mean.\n");
+
+xyzzy(ACTION) = ($say 
+"You are transported to a room where you are faced by a wizard who points to
+you and says, ''Them's fighting words!''  You immediately get attacked by
+all sorts of denizens of the museum: there is a cobra chewing on your leg,") 
+       ($say "
+a troglodyte is bashing your brains out with a gold nugget, a crocodile is 
+removing large chunks of flesh from you, a rhinoceros is goring you with his
+horn, a sabre-tooth cat is busy trying to disembowel you, you are being")
+       ($say "
+trampled by a large mammoth, a vampire is sucking you dry, a Tyranosaurus
+Rex is sinking his six inch long fangs into various parts of your anatomy,
+a large bear is dismembering your body, a gargoyle is bouncing up and")
+       ($say "
+down on your head, a burly troll is tearing you limb from limb, several
+dire wolves are making mince meat out of your torso, and the wizard is about
+to transport you to the corner of Westwood and Broxton.\n")
+       ($say "Oh dear, you seem to have gotten yourself killed, as well.\n")
+       (skore) (ratng) (ratnx) ($spec 3 0 0 0 0);
+
+score(ACTION) = (skore)(ratng);
+skore = ($say "You scored")
+       ($num ($prop .ME pscore))
+       ($say "out of")
+       ($num ($prop .ME pmax))
+       ($say "possible points.\n");
+
+ratng =        ($setp .ME ratvl 0)
+       (($ne ($prop .ME pscore) 0) :
+       ($setp .ME ratvl ($quotient ($times ($prop .ME pscore) 8)
+                                       ($prop .ME pmax))))
+       ($say "That gives you a ranking of ")
+       (($eq ($prop .ME ratvl) 0) :
+       ($say "junior beginning adventurer.\n"))
+       (($eq ($prop .ME ratvl) 1) :
+       ($say "senior beginning adventurer.\n"))
+       (($eq ($prop .ME ratvl) 2) :
+       ($say "intermediate adventurer.\n"))
+       (($eq ($prop .ME ratvl) 3) :
+       ($say "expert adventurer.\n"))
+       (($eq ($prop .ME ratvl) 4) :
+       ($say "junior master adventurer.\n"))
+       (($eq ($prop .ME ratvl) 5) :
+       ($say "master adventurer.\n"))
+       (($eq ($prop .ME ratvl) 6) :
+       ($say "senior master adventurer.\n"))
+       (($eq ($prop .ME ratvl) 7) :
+       ($say "life master adventurer.\n"))
+       (($eq ($prop .ME ratvl) 8) :
+       ($say "super-stud adventurer.\n"));
+
+ratnx = (($eq ($prop .ME ratvl) 8) : 
+       ($say "CONGRATULATIONS.\n") ($spec 3 0 0 0 0))
+       ($say "To achieve the next higher rating, you need to score")
+       ($setp .ME ratvl ($plus ($prop .ME ratvl) 1))
+       ($setp .ME ratvl ($times ($prop .ME ratvl) ($prop .ME pmax)))
+       ($setp .ME ratvl ($quotient ($prop .ME ratvl) 8))
+       ($setp .ME ratvl ($plus ($prop .ME ratvl) 1))
+       ($setp .ME ratvl ($minus ($prop .ME ratvl) ($prop .ME pscore)))
+       ($num ($prop .ME ratvl))
+       ($say "more points.\n");
+
+objl = (($eq %1 0) : ($exit 0))
+       (objl ($link %1))
+       (($ldisc %1));
+
+objs = (($eq %1 0) : ($exit 0))
+       (objs ($link %1))
+       (($eq %1 .ME) : ($exit 0))
+       (($eq ($prop .ME kludge) 1) : ($say "You can see:\n")
+                               ($setp .ME kludge 0))
+       (($sdisc %1))
+       ($say "\n");
+
+LLOOK =  (($ldisc ($loc .ME)))
+       (objl ($cont ($loc .ME)));
+
+SLOOK = (($sdisc ($loc .ME)))
+       ($setp .ME kludge 1)
+       (objs ($cont ($loc .ME)));
+
+LOOK = ( ($prop ($loc .ME) VISIT) :
+               (($ne @Myloc ($loc .ME)) :   (SLOOK)) :
+               (($ne @Myloc ($loc .ME)) :
+                       (LLOOK) ($setp ($loc .ME) VISIT 1))
+       )
+       ($setg Myloc ($loc .ME))
+       ($say "> ");
+
+START = ($setp .ME pmax 250)
+       ($setp .ME debug 0)
+       ($move .ME mrm1)
+       ($sdem LOOK);
+
+quit(ACTION) = (skore) (ratng) (ratnx) ($spec 3 0 0 0 0);
+
+        look(ACTION) = (LLOOK);
+
+take(ACTION) = (ctake);
+scale = ($setp .ME weight 0)
+       (($ne ($cont .ME) 0) :
+       ($setg 12 ($cont .ME)) (scads));
+scads = (($ne @12 0):
+       ($setp .ME weight ($plus ($prop .ME weight) ($prop @12 weight)))
+       ($setg 12 ($link @12))
+       (scads));
+ctake = (scale)
+       (($ne ($loc .ME) ($loc ($dobj))):
+       ($say "I don't see that item here.\n")($exit 0))
+       (($eq ($prop ($dobj) movbl) 0) :
+       ($say "That thing is too heavy to carry.\n")($exit 0))
+       (($gt ($plus ($prop ($dobj) weight) ($prop .ME weight)) 20) :
+       ($say
+"You are carrying too much.  You will have to at least drop something first.
+") ($exit 0))
+       ($setp .ME weight ($plus ($prop ($dobj) weight) ($prop .ME weight)))
+       ($say "OK\n") ($move ($dobj) .ME)
+       (($eq ($prop ($dobj) rarea) 0 ) : ($exit 0))
+       ($setp .ME pscore ($plus ($prop .ME pscore) ($prop ($dobj) pfound)))
+       ($setp ($dobj) pfound 0);
+
+drop(ACTION) = (cdrop);
+cdrop = (($ne ($loc ($dobj)) .ME) :
+       ($say "You don't have it with you.\n")($exit 0))
+       (($eq ($loc .ME) prm21) :
+       ($say "OK, it falls further down into the crack.\n")
+       ($move ($dobj) prm22) ($exit 1))
+       ($say "OK\n") ($move ($dobj) ($loc .ME))
+       (($eq ($prop ($dobj) rarea) 0 ) : ($exit 0))
+       (($eq ($prop ($dobj) rarea) 2) : (($eq ($loc .ME) mrm5) :
+                       (scord)))
+       (($eq ($prop ($dobj) rarea) 1): (($eq ($loc .ME) mrm3) : 
+               (scord)));
+       
+       scord = 
+       ($setp .ME pscore ($plus ($prop .ME pscore) ($prop ($dobj) pplace)))
+       ($setp ($dobj) pplace 0);
+
+rname(ACTION) = (($sdisc ($loc .ME))) ($exit 1);
+save(ACTION) = ($say "Ok, so far this is how things stand.\n")
+              (skore) (ratng)
+              ($spec 4 0 0 0 0);
+shell(ACTION) = ($spec 6 "/bin/csh" "-i" 0 0);
+restore(ACTION) = ($spec 5 0 0 0 0) ($say "Restored.\n");
+inven(ACTION) = ($say "You are carrying:\n")
+               (($eq ($cont .ME) 0):($say "Nothing\n")($exit 1))
+               ($setg 12 ($cont .ME)) (inside);
+inside = (($ne @12 0) : (($sdisc @12)) ($say "\n")
+       ($setg 12 ($link @12)) (inside));
+
+{*** ROOM DESCRIPTIONS ***}
+
+mrm1(LDESC) = ($say "You are standing outside the north entrance of a large
+brick building.  Inscribed above the doorway, appear the 
+text: 'AARDVARK'S MUSEUM -- GATEWAY TO ADVENTURELAND'.
+");
+mrm1(SDESC) = ($say "Museum entrance
+");
+
+mrm2(LDESC) = ($say "You are in a large rotunda of an old museum.  Doors lead
+to the north, south, east, and west, and a narrow stairway 
+in the north-east corner of the room leads down.
+");
+mrm2(SDESC) = ($say "Museum rotunda
+");
+
+mrom3a = ($say "You are in a dimly lit room containing an empty display case.
+A portion of a vandalized sign above the case reads: 
+'ARTIFACTS OF ANCIENT INDIA -- Several of these items,
+including the sacred rhinoceros horn, the deadly ...'.
+The rest of the sign is unreadable.
+");
+mrm3(LDESC) = (mrom3a)
+               (($eq ($prop paper signed) 0) : ($say 
+"To the west, you can look through a large door into the rotunda
+of the museum. On the east wall of the hall there is an outline
+of an arch.
+"))
+               (($eq ($prop paper signed) 1) : ($say
+"Through the door to the west, you can see part of the rotunda
+of the museum.  To the east, there is a stone archway.
+"));
+mrm3(SDESC) = ($say "East wing of the museum
+");
+
+mrm4(LDESC) = ($say "You are in a non-descript room with absolutely 
+nothing in it.  A hollow voice says ''This room is unavailable for use at this
+time.  Please leave through the doorway to your north.''
+");
+mrm4(SDESC) = ($say "Closed room
+");
+
+mrom5 = ($say "You are standing before a large empty display case in a poorly
+lit basement-like room.  Encircling the room high on the walls appear the text
+''HALL OF PREHISTORY.''  A stairway leads up, and in the south wall, there is
+a small hole");
+mrm5(LDESC) = (mrom5)
+               (($eq ($prop paper signed) 1) :
+               ($say ".\n"))
+               (($eq ($prop paper signed) 0) :
+               ($say " covered by a grate.\n"));
+mrm5(SDESC) = ($say "Hall of Prehistory.\n");
+
+mrm6(LDESC) = ($say
+"You are wandering through a dense forest past twisted birch trees
+rising toward the sky in contorted agony.  Enormous skeletons of burned
+out sycamores are scattered throughout the area, and gnarled stumps of")
+($say
+"\nonce proud oak trees make the appearance of the forest even more 
+disturbing.  Nothing is stirring, a pall of death seems to hang over the
+forest like a blanket, and you can't seem to figure out which direction\n")
+($say "is which.\n");
+mrm6(SDESC) = ($say "You are lost in the forest.\n");
+
+irm1(LDESC) = ($say "You  are at the top of a highly ornate spiral stairway.
+A wing of the museum can be seen to the west.  The room is moist 
+and damp, and the scent of cumin and saffron fills the air.
+");
+irm1(SDESC) = ($say "Top of spiral stairway
+");
+
+irm2(LDESC) = ($say "You are in an east-west passage at the bottom of
+a spiral stairway.  A slight breeze blows from east to west.
+");
+irm2(SDESC) = ($say "Bottom of spiral stairway
+");
+
+irm3(LDESC) = ($say "You are standing in a deserted Indian marketplace.
+Although it seems to have once been a bustling area, 
+there is very little left here.  Most of the vacant
+booths form an alley running north, and a small path
+goes east.
+");
+irm3(SDESC) = ($say "Marketplace
+");
+
+irm4(LDESC) = ($say "You are in a small kitchen adjoining the marketplace.
+Most of the furniture in the room has been broken, and all               
+of the pottery once used for cooking has been stolen. In the
+north-west corner, there is a tandoori oven.  A door to the
+south leads back out to the marketplace, and a trap-door 
+leads down to what appears to be a murky basement.
+");
+irm4(SDESC) = ($say "Kitchen
+");
+
+irm5(LDESC) = ($say "You are in a cellar which apparently has been used to
+store spices.  Empty racks line all the walls of the room, 
+and everything in the room seems to be blanketed in a thin
+layer of dust.  An unreachable hole appears in the ceiling
+and exits lead to the north, south, and east.
+");
+irm5(SDESC) = ($say "Spice cellar
+");
+
+irm6(LDESC) = ($say "You are in a small cave-like room apparently once used
+for the cultivation of mushrooms.  You find the smell of
+this room slightly displeasing.  There are exits to the  
+south and west, and there is a small hole in the 
+north wall, through which you can see a long vertical
+shaft with jagged sides.
+");
+irm6(SDESC) = ($say "Mushroom room
+");
+
+irm7(LDESC) = ($say "You are in an abandoned warehouse-like room which, 
+though once used for storage, is now predominantly full of  
+rubble.  Exits lead to the north and east.
+");
+irm7(SDESC) = ($say "Warehouse
+");
+
+irm8(LDESC) = ($say "You are standing on a rocky beach on the west bank
+of a slow-moving subterranean river. Several large 
+crocodiles are lazily sleeping at the north end of the river. 
+A path leads to the west.
+");
+irm8(SDESC) = ($say "West bank of river
+");
+
+irm9(LDESC) = ($say "You are on a sandy beach on the east bank of a crocodile
+infested river.  A roughly hewn stairway in the rock leads up 
+far beyond your range of vision.
+");
+irm9(SDESC) = ($say "East bank of river
+");
+
+irm10(LDESC) = ($say "You are in a room containing an enormous statue of
+Mara, Hindu goddess and consort to Vishnu.  Passages lead 
+to the east, west, and south, and a roughly hewn stairway
+seems to go down to an area further underground.
+");
+irm10(SDESC) =($say "In front of Mara's statue
+");
+
+irm11(LDESC) = ($say "You are standing in front of a gigantic statue of the
+Hindu god Vishnu.  Passages lead north and south, and it appears
+that you can squeeze through a narrow crack in the western wall.
+");
+irm11(SDESC) = ($say "In front of Vishnu's statue
+");
+
+irom12a = ($say "You are in a room containing an enormous statue of 
+Lakshmi, Hindu goddess and consort to Vishnu.  
+");
+irm12(LDESC) = (irom12a)
+               (($eq ($prop statue tlakst) 0) : ($say 
+"Passages lead to the north and east.
+"))
+               (($eq ($prop statue tlakst) 1) : ($say
+"Passages lead to the east and north, and on the west wall
+there is a hole large enough to crawl through.
+"));
+irm12(SDESC) = ($say "In front of Lakshmi's statue
+");
+
+irm13(LDESC) = ($say "You are in what would appear to be a totally man-made
+cave.  The walls are covered with bamboo shafts cut and 
+tied together to form a very complex lattice pattern.
+An extremely narrow passage leads east, and there is a 
+large door to the south.
+");
+irm13(SDESC) = ($say "Bamboo Room
+");
+
+irm14(LDESC) = ($say "You are in a small room with a very low ceiling. The
+only exit is to the east.
+");
+irm14(SDESC) = ($say "Flat Room
+");
+
+irm15(LDESC) = ($say "You are standing in the center of a large dome-like 
+room.  Exits lead to the north, east, and west, and around the perimeter of
+the room appear the words 'ABRACADABRA -- VARUNA SUCKS COCONUTS.'
+");
+irm15(SDESC) = ($say "Inside Dome
+");
+
+irm16(LDESC) = ($say
+"You are at the base of a tall naturally formed shaft.
+On all sides, you are surrounded by gigantic basalt columns
+towering above you in a serpentine manner, as if great 
+likenesses of Vasuki himself.  Passages lead to the north,
+east, and west, and above you appears a small ledge.
+");
+irm16(SDESC) = ($say "Vertical Shaft
+");
+
+irm17(LDESC) = ($say
+"You are on a small ledge high above the base of a large
+shaft.  There is a rope seemingly standing rigid allowing you to
+climb down, but the climb above you seems quite dificult.
+");
+irm17(SDESC) = ($say "On small ledge
+");
+
+irm18(LDESC) = ($say
+"You are in a small room which smells strongly of
+incense.  Stone archways lead to the south, and east, and
+a smaller passage leads to the west.  You also hear some
+chanting and Sitar music in the background.
+");
+irm18(SDESC) = ($say "Incense room
+");
+
+irm19(LDESC) = ($say
+"You are at the holy well of Varuna, the water god.  The well is in the
+middle of the room, leading straight down into some water far below.
+Legend has it that those who climb down into the well suffer a fate
+worse than death, so it is advisable not to go down.  In the 
+ceiling, there is a round hole")
+       (($eq ($prop rupees wellbt) 1) :
+       ($say " and the water in the well appears to have
+been disturbed recently.\n"))
+       (($eq ($prop rupees wellbt) 0) :
+       ($say ".\n"));
+irm19(SDESC) = ($say "Varuna's well
+");
+
+irom20a = ($say
+"You are at the entrance to Siva's temple.
+");
+irm20(LDESC) = (irom20a)
+               (($eq ($prop monkey fedmky) 1) : ($say
+"A passage leads back to the west, and a crack in a huge stone slab allows
+one to proceed east.
+"))
+               (($eq ($prop monkey fedmky) 0) : ($say
+"A passage leads back to the west, but the entrance to the temple is blocked
+by a huge stone slab.
+"));
+irm20(SDESC) = ($say "Entrance to Siva's temple
+");
+
+irm21(LDESC) = ($say 
+"You are standing in front of Siva's altar, a small stone slab in front of
+a large monolith.  The exit is to the west.
+");
+irm21(SDESC) = ($say "Siva's Altar
+");
+
+irm22(LDESC) = ($say
+"You are standing at the top of a six-foot deep snake pit.  The walls of the
+room are covered with bas relief figures of cobras, kraits, and other 
+miscellaneous elapids.  Exits lead to the west and south, through archways
+ringed by pythons carved into the rock.
+");
+irm22(SDESC) = ($say "Top of Snake pit
+");
+
+irm23(LDESC) = ($say
+"You are at the bottom of a snake pit.  The only direction it appears you 
+can go is back out.
+");
+irm23(SDESC) =($say "Bottom of snake pit
+");
+
+prm1(LDESC) = (darkq) ($say
+"You are in the north-south corridor of an ancient paleolithic cave.  Its 
+low ceiling is covered with paintings of wild game which have faded due to
+the passing of time.\n");
+prm1(SDESC) = (darkq)($say "North-south corridor.\n");
+
+prm2(LDESC) = ($say
+"You are standing on a ledge above the floor of a subterranean canyon
+running east-west.  Shafts of sunlight penetrate through cracks in the
+ceiling high above, washing the room with an alabaster murkiness;
+casting shadows on the weathered rocks which have lain undisturbed
+for countless centuries. A small crawlway leads north, and there is a
+short, stout pole sticking out of the ground.")
+       (($eq ($prop rope rtied) 1) : ($say "  A section of rope is tied 
+around the pole, with the other end hanging down into the canyon.\n"))
+       (($eq ($prop rope rtied) 0) : ($say "\n"));
+
+prm2(SDESC) = ($say "Above East-west canyon.\n");
+
+prm3(LDESC) = ($say 
+"You are at the bottom of a canyon running east-west.  The passage to the
+east is blocked by rubble, so it appears that the only direction you can
+go is west. A rope dangles down from above.\n");
+prm3(SDESC) = ($say "East end of canyon.\n");
+
+prm4(LDESC) = ($say
+"You are standing in front of a limestone cavern, the entrance of which looks
+like a gaping mouth of a grotesque monster.  It appears that you can enter
+the cave to your south, or go either direction in the east-west canyon that
+you are in.\n");
+prm4(SDESC) = ($say "Entrance to limestone cavern.\n");
+
+prm5(LDESC) = (darkq) ($say
+"You are in a very narrow room which probably was once much larger.
+However, it appears that a recent cave-in has closed off much of the
+room to the east.  To your north, there is a corridor which apparently
+leads back out, and in the eastern wall, there is a hole which you can
+probably crawl through.\n");
+prm5(SDESC) = (darkq) ($say "Narrow room in cave.\n");
+
+prm6(LDESC) = (darkq) (($eq ($prop smilo stond) 0) : ($say
+"You are standing above a shallow pit which is empty except for a
+large smilodon (sabre-tooth tiger) which is growling at you menacingly.
+The only other direction it looks like you can go is back out through a
+small hole in the rubble forming the west wall of the room you are in.\n"))
+                       (($eq ($prop smilo stond) 1) : ($say
+"You are standing above an empty shallow pit.  There is a small hole in the
+west wall of the room you are in.\n"));
+prm6(SDESC) = (darkq) ($say "Above shallow pit.\n");
+
+prm7(LDESC) = (darkq) ($say
+"You are standing on the loose gravel of a shallow pit.  An exit leads
+south, and above you, there is a small ledge which you can climb up to.\n");
+prm7(SDESC) = (darkq) ($say "In shallow pit.\n");
+
+trogf = (($eq ($prop trogl killd) 0) : 
+       ($say " and there is an angry
+troglodyte here holding a large gold nugget under his arm"))
+       ($say ".\n");
+trgfs = (($eq ($prop trogl killd) 0) :
+       ($say "There is an angry troglodyte holding a gold nugget here.\n"));
+prm8(LDESC) = (darkq) ($say
+"You are standing near the west rim of sheer cliff which drops down into a deep
+almost bottomless abyss. A passage leads north") (trogf);
+prm8(SDESC) = (darkq) ($say "West rim of canyon.\n") (trgfs);
+
+prm9(LDESC) = ($say 
+"You are at the junction of two canyons.  The larger one runs east-west
+and the smaller one runs north.\n");
+prm9(SDESC) = ($say "Canyon junction\n");
+
+prm10(LDESC) = ($say
+"You are standing on a shale slab tilted from west to east at about a 
+forty-five degree angle.  At the east end of the slab, there is a short
+drop into what appears to be a lake.  Above you and to the west, it appears
+that there is some more explorable terrain, and the canyon leads back to
+to the south.  The air is quite warm, and there is a slight scent similar
+to asphalt in the air.\n");
+prm10(SDESC) = ($say "On shale slab.\n");
+
+prm11(LDESC) = ($say 
+"You are standing in the south end of a short canyon running north-south.
+The ground below your feet is littered with flakes of a dark rock, which
+seems to comprise most of the surrounding canyon walls.  There is a path to
+your north, and a steep slope down and to the east.\n");
+prm11(SDESC) = ($say "Canyon full of rubble.\n");
+
+prm12(LDESC) = ($say
+"You are standing in the north end of a short canyon.  The ground is
+covered with a thin film of oil which apppears to be seeping out of
+a crack in the earth.  The only apparent direction you can go is south.\n");
+prm12(SDESC) = ($say "Oily end of canyon.\n");
+
+prm13(LDESC) = ($say "You are standing in what was once a tributary into
+the now-extinct river which formed the large canyon in this area.  There
+is a streambed running to the south, and you can also go east and west.\n");
+prm13(SDESC) = ($say "End of dry river bed.\n");
+
+prm14(LDESC) = ($say
+"You are standing in a narrow north-south canyon with a river bed running 
+down the middle of it.  There is a semicirular shaped hole at the base of
+the eastern wall.\n");
+prm14(SDESC) = ($say "In narrow part of river bed.\n");
+
+prm15(LDESC) = ($say 
+"You are at the base of three water-eroded cliffs to your south, east and 
+west.  It appears that a U-shaped waterfall once flowed into this area, and
+exited out to the north.\n");
+prm15(SDESC) = ($say "Below dried waterfall.\n");
+
+prm16(LDESC) = ($say 
+"You are in a section of the canyon where much of the rock appears to be
+primarily sandstone.  Water has apparently flowed out of a cave to your 
+north into three-foot wide crack in the ground.  A substantial amount of
+rubble blocks your way west, and the rest of the canyon winds east.\n");
+prm16(SDESC) = ($say "Sandstone area.\n");
+
+prm17(LDESC) = (darkq) ($say
+"You are standing in front of the freshly dug gravesite of a Nearderthal
+hunter.  There is an exit to your south, and it seems that more of the 
+cave can be explored to the north.\n")
+(($and ($eq ($prop spear tooky) 1) ($eq ($prop spear abrad) 0)) :
+($say "However, a large amount of rubble blocks that path.\n"));
+prm17(SDESC) = (darkq)($say "Neanderthal's gravesite\n");
+
+prm18(LDESC) = (darkq) ($say
+"You are in a narrow room of a north-south running cave.  A large cairn of
+prehistoric cave bear skulls is piled high in one corner of the room.
+There are exits to the north and south.\n");
+prm18(SDESC) = (darkq) ($say "In front of cave bear cairn.\n");
+
+prm19(LDESC) = (darkq) ($say
+"You are in a large cavern room with a high ceiling.  Cracks in the walls
+lead in all directions but none of them seem to lead anywhere.  There are
+however, two major paths to the north and the south.\n");
+prm19(SDESC) = (darkq) ($say
+"Large Cavern room.\n");
+
+prm20(LDESC) = (darkq) ($say
+"You are in a room which was the site of a recent cave-in.  It appears to
+be futile to go any other direction except south.\n");
+prm20(SDESC) = (darkq) ($say "Cave-in site.\n");
+
+prm21(LDESC) = ($say
+"You are in a crack in the earth which seems to have been formed by an ancient
+earthquake.  Various strata in the rock of different darkness seem to indicate
+that much time has passed since the formation of the rock at the lower end of
+this crack.  It seems that you can chimney up back out of the crack, or climb
+further down into it.\n");
+prm21(SDESC) = ($say "In large crack.\n");
+
+prm22(LDESC) = ($say
+"You are standing on a narrow ledge about twenty-five feet above the ground.
+Aside from going back up, the only other direction you can go is to step off 
+the ledge to the west into the mouth of the large Tyranosaurus Rex waiting to
+swallow you whole.\n");
+prm22(SDESC) = ($say
+"On ledge in front of Tyranosaurus Rex.\n");
+
+prm23(LDESC) = ($say
+"You are standing inside the mouth of a Tyranosaurus Rex, whose jaws are
+being held open by a spear wedged length-wise in his mouth.  Various pieces
+of former adventurers can be found among the six-inch long teeth here.
+You can step back out of the Tyranosaur onto the small ledge, or go
+further down into the Tyranosaur and get digested.\n");
+prm23(SDESC) = ($say "Inside mouth of Tyranosaur.\n");
+
+{*** FUNNY TRANSITION ROUTINES ***}
+
+exitg = ($say "Oh dear, you seem to have gotten yourself killed.\n")
+(skore)
+(ratng)
+(ratnx)
+(($eq ($prop .ME debug) 0) : ($spec 3 0 0 0 0));
+
+em3 = (($eq ($prop paper signed) 0):(cg) ($exit 0))
+      ($move .ME irm1);
+
+ei8 = (($eq ($loc spice) .ME) : ($say
+"The savory blend of spices and human wakes up the sleeping crocodiles who
+decide to have you for breakfast.
+") (exitg))
+      (($eq ($loc rupee) .ME) : ($say
+"The weight of the coins pulls you underwater and you eventually drown.
+") (exitg))
+      ($say "You manage to get across the river, just as the crocodiles
+begin to stir.
+")($move .ME irm9);
+
+wi12 = (($eq ($prop statue tlakst) 0) : (cg) ($exit 0))
+       ($move .ME irm14);
+
+ui16 = (($eq ($prop rope ropstf) 0) : (cg) ($exit 0))
+       ($say "You scramble up the rope and get to the ledge.
+") ($move .ME irm17);
+
+ui17 = ($say "Are you a rock climber? \n")
+       (($eq ($yorn) 0) : ($say "Then you better not try it.\n")
+               ($exit 0))
+       ($say "That climb is rated 5.11. Do you still want to try it?\n")
+       (($eq ($yorn) 0) : ($say "Wise move.\n") ($exit 0))
+       ($say "Half way up, you fall off a 1/32 inch wide ledge and
+plummet to your death.\n") (exitg);
+
+di19 = ($say "You magically get transported to the corner of Westwood and
+Broxton, where you are forced to spend the rest of eternity surrounded by
+Hari-Krishna freaks. (That'll teach you not to believe legends.)\n")
+       ($spec 3 0 0 0 0);
+
+ei20 = (($eq ($prop monkey fedmky) 0):(cg)($exit 0))
+       ($move .ME irm21);
+
+wi21 = (($eq ($loc peel) irm20) : ($say
+"As you leave the temple, you slip on a banana peel and break your neck.\n")
+       (exitg)) ($move .ME irm20);
+
+di22 = (($eq ($loc cobra) irm22) : ($say
+"The cobra takes a bite at your unprotected leg and injects an
+unhealthy dose of neurotoxin.  You start to lose your senses, your 
+cognitive abilities, an yer rekcogiskdfsdk.\n")
+(exitg))($move .ME irm23);
+
+sm5 = (($eq ($prop paper signed) 0) :
+       ($say "You bumped into the grate.\n")
+       ($exit 0))
+       ($move .ME prm1);
+
+dp2 = (($eq ($prop rope rtied) 0) :
+       ($say "It is too dangerous to climb down without a rope.\n")
+       ($exit 0))
+       (($and ($eq ($loc lamp) .ME) ($eq ($prop lamp onoff) 1)) :
+       ($say "Half-way down the rope, the carbide lamp burns through the
+rope above you and you plummet to your death.\n" )
+       (exitg))
+       ($say "You climb down the rope without any problems.\n")
+       ($move .ME prm3);
+
+ep5 = (($eq ($loc spear) .ME) :
+       ($say "You can't fit the spear you are carrying through that crack.\n")
+       ($exit 1))
+       ($move .ME prm6);
+
+ep8 = ($say "You fall off the cliff and plummet several hundred feet to your
+death.\n") (exitg);
+
+dp6 = (($eq ($prop smilo stond) 0) :
+       ($say "As soon as you reach the bottom of the pit, the sabre-tooth
+tiger tears you to shreads.\n") (exitg))
+       ($move .ME prm7);
+
+ep10 = ($say "You fall into the lake, which actually turns out to be a
+tar-pit covered with a thin layer of rain water.  You eventually sink and
+get fossilized.\n") (exitg);
+
+ep11 = (($eq ($prop feet wiped) 0) :
+       ($move .ME prm10) ($exit 1))
+       ($say "As you walk down the slab, your feet slip and you tumble
+off the slab.\n")(ep10);
+
+sp12 = ($say "You find your feet to be quite slippery as you walk.\n")
+       ($setp feet wiped 1)
+       ($move .ME prm11);
+
+sp14 = (($eq ($prop mammoth blokd) 0) :
+       ($say "The mammoth keeps you from going that way.\n")
+       ($exit 1))
+       ($move .ME prm15);
+
+np17 = (($and ($eq ($prop spear tooky) 1) ($eq ($prop spear abrad) 0)) :
+       ($say
+"The rubble keeps you from going in that direction.\n")($exit 1))
+       ($move .ME prm18);
+
+np19 = (($eq ($prop bear hitbr) 0) :
+       ($say "The bear keeps you from going that direction.\n")
+       ($exit 1))
+       ($move .ME prm20);
+
+wp22 = (($eq ($loc spear) .ME) :
+       ($say "The spear that you were carrying lodges in the tyranosaur's
+mouth.\n") ($move spear prm23)($move .ME prm23))
+       (($eq ($loc spear) prm23) :
+       ($move .ME prm23))
+       (($and ($ne ($loc spear) .ME) ($ne ($loc spear) prm23)) :
+       ($say "The tyranosaur crushes you in his jaw and then swallows you.\n")
+       (exitg));
+
+dp23 = ($say "You slide down the gullet of the tyranosaur and get 
+digested alive.\n") (exitg);
+
+dm6 = ($say "After wandering around in the forest for a while, you eventually
+find your way out.\n")($move .ME mrm1);
+
+darkq = (($or ($and ($ne ($loc .ME) ($loc lamp)) ($ne ($loc lamp) .ME))
+       ($eq ($prop lamp onoff) 0 )) :
+       ($say "It's too dark to see anything in here.\n")
+       ($exit 1));
+
+darkt = (($or ($and ($ne ($loc .ME) ($loc lamp)) ($ne ($loc lamp) .ME))
+       ($eq ($prop lamp onoff) 0)) :
+       (($pct 50) : ($say
+"While stumbling around in the darkness, you trip and impale yourself on a 
+stalagmite.\n")(exitg)));  
+
+onlmp = (($ne ($loc lamp) .ME) :
+       ($say "You don't have the lamp with you.\n")
+       ($exit 1))
+       (($eq ($prop lamp onoff) 0) :
+       ($say "A blue flame now flickers out of the lantern.\n")
+       ($setp lamp onoff 1)
+                 ($exit 1));
+
+{*** TRANSITIONS ***}
+
+mrm1(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME mrm6 mrm2 mrm6 mrm6 0 0 mrm2 0 0 0)
+               ($miss 0 0 0 0 cg cg 0 dumdir 0 0);
+
+mrm2(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME mrm1 mrm4 mrm3 mrm4 0 mrm5 0 0 0 0)
+               ($miss 0 0 0 0 cg 0 dumdir dumdir 0 0);
+
+mrm3(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 mrm2 0 0 0 0 0 0)
+               ($miss cg cg em3 0 cg cg dumdir dumdir 0 0);
+
+mrm4(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME mrm2 0 0 0 0 0 0 mrm2 0 0)
+               ($miss 0 cg cg cg cg cg cg 0 0 0);
+
+mrm5(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 mrm2 0 0 0 0 0)
+               ($miss cg sm5 cg cg 0 cg dumdir dumdir 0 0);
+
+mrm6(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 0 0 0 0 0 0)
+               ($miss dm6 dm6 dm6 dm6 cg cg dumdir dm6 0 0);
+
+irm1(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 mrm3 0 irm2 0 0 0 0)
+               ($miss cg cg cg 0 cg 0 dumdir dumdir 0 0);
+
+irm2(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 irm10 irm3 irm1 0 0 0 0 0)
+               ($miss cg cg 0 0 0 cg dumdir dumdir 0 0);
+
+irm3(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm4 0 irm2 0 0 0 0 0  0 0)
+               ($miss 0 cg 0 cg cg cg dumdir dumdir 0 0);
+
+irm4(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm3 0 0 0 irm5 0 irm3 0 0)
+               ($miss cg 0 cg cg cg 0 dumdir 0 0 0);
+
+irm5(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm6 irm7 irm8 0 0 0 0 0 0 0)
+               ($miss 0 0 0 cg tohigh cg dumdir dumdir 0 0);
+
+irm6(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm5 0 irm7 0 0 0 0 0 0)
+               ($miss tosml 0 cg 0 cg cg dumdir dumdir 0 0);
+
+irm7(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm5 0 irm6 0 0 0 0 0 0 0)
+               ($miss 0 cg 0 cg cg cg dumdir dumdir 0 0);
+
+irm8(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 irm5 0 0 0 irm5 0 0)
+               ($miss cg cg ei8 0 cg cg dumdir 0 0 0);
+
+irm9(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 irm8 irm10 0 0 irm10 0 0)
+               ($miss cg cg cg 0 0 cg dumdir 0 0 0);
+
+irm10(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm11 irm22 irm2 0 irm9 0 0 0 0)
+               ($miss cg 0 0 0 cg 0 dumdir dumdir 0 0);
+
+irm11(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm10 irm12 0 irm13 0 0 0 0 0 0)
+               ($miss 0 0 cg 0 cg cg cg cg 0 0);
+
+irm12(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm11 0 irm15 0 0 0 0 0 0 0)
+               ($miss 0 cg 0 wi12 cg cg dumdir dumdir 0 0);
+
+irm13(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm15 irm11 0 0 0 0 0 0 0)
+               ($miss cg 0 0 cg cg cg dumdir dumdir 0 0);
+
+irm14(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 irm12 0 0 0 0 irm12 0 0)
+               ($miss cg cg 0 cg cg cg dumdir 0 0 0);
+
+irm15(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm13 0 irm16 irm12 0 0 0 0 0 0)
+               ($miss 0 cg 0 0 cg cg dumdir dumdir 0 0);
+
+irm16(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm22 0 irm18 irm15 0 0 0 0 0 0)
+               ($miss 0 cg 0 0 ui16 cg dumdir dumdir 0 0);
+
+irm17(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 0 irm16 0 0 0 0)
+               ($miss cg cg cg cg ui17 0 dumdir dumdir 0 0);
+
+irm18(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm19 irm20 irm16 0 0 0 0 0 0)
+               ($miss cg 0 0 0 cg cg dumdir dumdir 0 0);
+
+irm19(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm18 0 0 0 0 0 0 irm18 0 0)
+               ($miss 0 cg cg tosml cg di19 dumdir 0 0 0);
+
+irm20(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 irm18 0 0 0 0 0 0)
+               ($miss cg cg ei20 0 cg cg dumdir dumdir 0 0);
+
+irm21(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 0 0 0 0 0 0)
+               ($miss cg cg cg wi21 cg cg dumdir wi21 0 0);
+
+irm22(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm16 0 irm10 0 0 0 0 0 0)
+               ($miss cg 0 cg 0 cg di22 di22 cg 0 0);
+
+irm23(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 irm22 0 0 irm22 0 0)
+               ($miss cg cg cg cg 0 cg dumdir 0 0 0);
+
+prm1(ACTION) = (darkt)
+       ($setv n s e w u d in out 0 0)
+       ($hit .ME mrm5 prm2 0 0 0 0 0 0 0 0)
+       ($miss 0 0 cg cg cg cg dumdir dumdir 0 0);
+
+prm2(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm1 0 0 0 0 0 0 0 0 0)
+               ($miss 0 cg cg cg cg dp2 dumdir dumdir 0 0);
+
+prm3(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 prm4 prm2 0 0 0 0 0)
+               ($miss cg cg cg 0 0 cg dumdir dumdir 0 0);
+
+prm4(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm5 prm3 prm9 0 0 prm5 0 0 0)
+               ($miss cg 0 0 0 cg cg 0 dumdir 0 0);
+
+prm5(ACTION) = (darkt) ($setv n s e w u d in out 0 0)
+               ($hit .ME prm4 0 0 0 0 0 0 prm4 0 0)
+               ($miss 0 cg ep5 cg cg cg dumdir 0 0 0);
+
+prm6(ACTION) = (darkt) ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 prm5 0 0 0 0 0 0)
+               ($miss cg cg cg 0 cg dp6 dumdir dumdir 0 0);
+
+prm7(ACTION) = (darkt) ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm8 0 0 prm6 0 0 0 0 0)
+               ($miss cg 0 cg cg 0 cg dumdir dumdir 0 0);
+
+prm8(ACTION) = (darkt) ($setv n s e w u d in out 0 0)
+               ($hit .ME prm7 0 0 0 0 0 0 0 0 0)
+               ($miss 0 cg ep8 cg cg cg dumdir dumdir 0 0);
+
+prm9(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm10 0 prm4 prm13 0 0 0 0 0 0)
+               ($miss 0 cg 0 0 cg cg dumdir dumdir 0 0);
+
+prm10(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm9 0 prm11 prm11 0 0 0 0 0)
+               ($miss cg 0 ep10 0 0 cg dumdir dumdir 0 0);
+
+prm11(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm12 0 0 0 0 0 0 0 0 0)
+               ($miss 0 cg ep11 cg cg ep11 dumdir dumdir 0 0);
+
+prm12(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 0 0 0 0 0 0)
+               ($miss cg  sp12 cg cg cg cg dumdir dumdir 0 0);
+
+prm13(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm14 prm9 prm16 0 0 0 0 0 0)
+               ($miss cg 0 0 0 cg cg dumdir dumdir 0 0);
+
+prm14(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm13 0 0 0 0 0 0 0 0 0)
+               ($miss 0 sp14 tosml cg cg cg dumdir dumdir 0 0);
+
+prm15(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm14 0 0 0 0 0 0 0 0 0)
+               ($miss 0 cg cg cg cg cg dumdir dumdir 0 0);
+
+prm16(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm17 0 prm13 0 0 prm21 0 0 0 0)
+               ($miss 0 cg 0 cg cg 0 dumdir dumdir 0 0);
+
+prm17(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm16 0 0 0 0 0 0 0 0)
+               ($miss np17 0 cg cg cg cg dumdir dumdir 0 0);
+
+prm18(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm19 prm17 0 0 0 0 0 0 0 0)
+               ($miss 0 0 cg cg cg cg dumdir dumdir 0 0);
+
+prm19(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm18 0 0 0 0 0 0 0 0)
+               ($miss np19 0 cg cg cg cg dumdir dumdir 0 0);
+
+prm20(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm19 0 0 0 0 0 prm19 0 0)
+               ($miss cg 0 cg cg cg cg dumdir 0 0 0);
+
+prm21(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 prm16 prm22 0 0 0 0)
+               ($miss cg cg cg cg 0 0 dumdir dumdir 0 0);
+
+prm22(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 prm21 0 0 0 0 0)
+               ($miss cg cg cg wp22 0 cg dumdir dumdir 0 0);
+
+prm23(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 prm22 0 0 0 0 prm22 0 0)
+               ($miss cg cg 0 cg cg dp23 dumdir 0 0 0);
+
+{*** CHEAT ROUTINES ***}
+
+chetr = (($eq ($prop .ME debug) 0) : ($exit 1));
+VERB BEAM;
+BEAM(ACTION) = (chetr) ($move .ME ($dobj))(LLOOK);
+VERB TRACTOR;
+TRACTOR(ACTION) = (chetr) ($move ($dobj) ($loc .ME))
+               ($say "The ")(($sdisc ($dobj)))($say
+" magically appears.\n");
+VERB DRIBBLE;
+DRIBBLE(ACTION) = (chetr) (ctake) (cdrop);
diff --git a/usr/src/games/aard/frontend b/usr/src/games/aard/frontend
new file mode 100644 (file)
index 0000000..98e5b48
--- /dev/null
@@ -0,0 +1 @@
+/usr/games/lib/ddlrun /usr/games/lib/aard
diff --git a/usr/src/games/ddl/READ-ME b/usr/src/games/ddl/READ-ME
new file mode 100644 (file)
index 0000000..1dd8169
--- /dev/null
@@ -0,0 +1,22 @@
+
+               D D L   Packaging
+
+   This directory contains an unrestricted distribution of
+the UCLA Dungeon Definition Language processor which includes
+no sources for ddlrun and ddlcomp.
+
+   The directory contains the following files and subdirectories:
+
+       Files:
+READ-ME:               This file.
+aard.ddl:              A complete, but slightly uninspired, DDL dungeon
+ddlcomp:               Binary (Vax VMUnix) for the DDL "compiler"
+ddlrun:                        Binary (Vax VMUnix) for the DDL runtime processor
+
+       Directories:
+doc:                   Documentation
+sample:                        Sources for a incomplete dungeon demonstrating some
+                          more sophisticated uses of DDL
+
+The documentation files doc.ms and builtins.ms should be run
+through tbl and troff (eg tbl doc.ms builtins.ms|troff -ms).
diff --git a/usr/src/games/ddl/aard.ddl b/usr/src/games/ddl/aard.ddl
new file mode 100644 (file)
index 0000000..d851eef
--- /dev/null
@@ -0,0 +1,2016 @@
+{*** ROUTINE DECLARATIONS ***}
+
+ROUTINE inside;
+ROUTINE ei8;
+ROUTINE cdrop;
+ROUTINE ctake;
+ROUTINE exitg;
+ROUTINE skore;
+ROUTINE darkq;
+ROUTINE darkt;
+ROUTINE objl;
+ROUTINE objs;
+ROUTINE onlmp;
+ROUTINE scord;
+ROUTINE ratng;
+ROUTINE ratnx;
+ROUTINE scads;
+
+{*** GLOBALS ***}
+
+kludge = 2;
+onoff = 2;
+signed = 2;
+tlakst = 2;
+fedmky = 2;
+ropstf = 2;
+readl = 3;
+wellbt = 2;
+cutflg = 2;
+earplg = 3;
+tookbt = 2;
+movbl = 1;
+darkbt = 2;
+rtied = 3;
+stond = 2;
+killd = 2;
+wiped = 2;
+blokd = 2;
+tooky = 2;
+abrad = 3;
+hitbr = 2;
+dugbt = 2;
+debug = 10;
+VISIT = 11;
+
+rarea = 19;
+pfound = 17;
+pplace = 18;
+pscore = 17;
+pmax = 18;
+ratvl = 19;
+weight = 20;
+
+Myloc = 15;
+
+{*** DEAD-END ROUTINES ***}
+
+
+cg = ($say "Can't go that way.
+");
+
+tosml = ($say "The hole is too small for you to fit through.
+");
+
+dumdir = ($say "I don't know which direction that is.
+");
+
+tohigh = ($say "The hole is too high for you to reach.
+");
+
+nothe = ($say "This section is not implemented yet.\n");
+
+{*** MUSEUM ROOMS ***}
+
+NOUN mrm1;
+NOUN mrm2;
+NOUN mrm3;
+NOUN mrm4;
+NOUN mrm5;
+NOUN mrm6;
+
+{*** INDIAN ROOMS ***}
+
+NOUN irm1;
+NOUN irm2;
+NOUN irm3;
+NOUN irm4;
+NOUN irm5;
+NOUN irm6;
+NOUN irm7;
+NOUN irm8;
+NOUN irm9;
+NOUN irm10;
+NOUN irm11;
+NOUN irm12;
+NOUN irm13;
+NOUN irm14;
+NOUN irm15;
+NOUN irm16;
+NOUN irm17;
+NOUN irm18;
+NOUN irm19;
+NOUN irm20;
+NOUN irm21;
+NOUN irm22;
+NOUN irm23;
+
+{*** PREHISTORIC ROOMS ***}
+
+NOUN prehs;
+NOUN prm1(prehs);
+prm1(darkbt) = 1;
+NOUN prm2(prehs);
+NOUN prm3(prehs);
+NOUN prm4(prehs);
+NOUN prm5(prehs);
+prm5(darkbt) = 1;
+NOUN prm6(prehs);
+prm6(darkbt) = 1;
+NOUN prm7(prehs);
+prm7(darkbt) = 1;
+NOUN prm8(prehs);
+prm8(darkbt) = 1;
+NOUN prm9(prehs);
+NOUN prm10(prehs);
+NOUN prm11(prehs);
+NOUN prm12(prehs);
+NOUN prm13(prehs);
+NOUN prm14(prehs);
+NOUN prm15(prehs);
+NOUN prm16(prehs);
+NOUN prm17(prehs);
+prm17(darkbt) = 1;
+NOUN prm18(prehs);
+prm18(darkbt) = 1;
+NOUN prm19(prehs);
+prm19(darkbt) = 1;
+NOUN prm20(prehs);
+prm20(darkbt) = 1;
+NOUN prm21(prehs);
+NOUN prm22(prehs);
+NOUN prm23(prehs);
+
+NOUN .ME;
+.ME(SDESC) = ($exit 0);
+.ME(LDESC) = ($exit 0);
+
+{*** PREPOSITIONS ***}
+
+PREP into;
+
+{*** OBJECTS ***}
+
+NOUN pen(mrm2);
+pen(movbl) = 1;
+pen(weight) = 1;
+pen(LDESC) = ($say "There is a ball-point pen here.\n");
+pen(SDESC) = ($say "ball-point pen");
+
+NOUN paper(mrm2);
+release = paper;
+form = paper;
+paper(movbl) = 1;
+paper(weight) = 1;
+paper(LDESC) = (($eq ($prop paper readl) 0) :
+               ($say "There is a slip of paper here.\n"))
+               (($eq ($prop paper readl) 1) :
+               ($say "There is a release form here.\n"));
+paper(SDESC) = (($eq ($prop paper readl) 0) : ($say "slip of paper"))
+               (($eq ($prop paper readl) 1) : ($say "release form"));
+
+NOUN spices(irm6);
+spices(movbl) = 1;
+spices(weight) = 3;
+spices(LDESC) = ($say "There is a bag of spices here.\n");
+spices(SDESC) = ($say "spices");
+spices(rarea) = 1;
+spices(pfound) = 5;
+spices(pplace) = 9;
+
+NOUN rupees(irm7);
+coins=rupees;
+rupees(movbl) = 1;
+rupees(weight) = 5;
+rupees(LDESC) = ($say "There is a bag of rupees (Indian coins) here.\n");
+rupees(SDESC) = ($say "rupees (coins)");
+rupees(rarea) = 1;
+rupees(pfound) = 5;
+rupees(pplace) = 15;
+
+NOUN coconut(irm3);
+coconut(movbl) = 1;
+coconut(weight) = 3;
+coconut(LDESC) = ($say "There is a large coconut here.\n");
+coconut(SDESC) = ($say "coconut");
+
+NOUN rope(mrm1);
+rope(movbl) = 1;
+rope(weight) = 3;
+rope(LDESC) = (($eq ($prop rope ropstf) 0):
+               ($say "There is a coil of rope here.\n"))
+               (($eq ($prop rope ropstf) 1) :
+               ($say "There is a long piece of rope here, magically
+rising up in mid-air.\n"));
+rope(SDESC) = ($say "rope");
+
+NOUN clarinet(irm2);
+clarinet(movbl) = 1;
+clarinet(weight) = 2;
+clarinet(LDESC) = ($say "There is a clarinet here.\n");
+clarinet(SDESC) = ($say "clarinet");
+
+NOUN cobra(irm22);
+cobra(LDESC) = ($say "There is a king cobra at the bottom of the pit.\n");
+cobra(SDESC) = ($say "cobra");
+snake = cobra;
+elapid = cobra;
+
+NOUN river;
+
+NOUN statue;
+
+NOUN banana(irm3);
+banana(movbl) = 1;
+banana(weight) = 2;
+banana(LDESC) = ($say "There is a banana here.\n");
+banana(SDESC) = ($say "banana");
+
+NOUN peel;
+peel(movbl) = 1;
+peel(weight) = 1;
+peel(LDESC) = ($say "On the ground, there is a banana peel.\n");
+peel(SDESC) = ($say "banana peel");
+
+NOUN vishnu;
+
+NOUN mara;
+
+NOUN lakshmi;
+
+NOUN crocodile;
+
+NOUN rhino(irm13);
+rhino(LDESC) = (($eq ($prop rhino cutflg) 1) :
+       ($say "There is a rhino sleeping here with his horn removed.\n"))
+       (($eq ($prop rhino cutflg) 0) : 
+       ($say "There is a rhinoceros sleeping in the corner.\n"))
+       (($eq ($prop rhino earplg) 1) :
+       ($say "There are two pieces of cotton stuck in his ears.\n"));
+rhino(SDESC) = ($say "sleeping rhino");
+
+NOUN saw(irm2);
+saw(movbl) = 1;
+saw(weight) = 2;
+saw(LDESC) = ($say "There is a hack-saw on the ground.\n");
+saw(SDESC) = ($say "hack-saw");
+hacksaw = saw;
+
+NOUN horn;
+horn(movbl) = 1;
+horn(weight) = 2;
+horn(LDESC) = ($say "There is a rhinoceros horn here.\n");
+horn(SDESC) = ($say "rhino horn");
+horn(rarea) = 1;
+horn(pfound) = 14;
+horn(pplace) = 7;
+
+NOUN cotton;
+cotton(movbl) = 1;
+cotton(weight) = 1;
+cotton(LDESC) = ($say "There is a large wad of cotton on the ground.\n");
+cotton(SDESC) = ($say "cotton");
+
+NOUN lattice(irm13);
+lattice(LDESC) = ($exit 0);
+lattice(SDESC) = ($exit 0);
+
+NOUN monkey(irm20);
+monkey(LDESC) = ($say "There is a sacred temple monkey here.\n");
+monkey(SDESC) = ($say "a monkey");
+
+NOUN tandoor;
+oven = tandoor;
+
+NOUN comb(irm14);
+comb(movbl) = 1;
+comb(weight) = 1;
+comb(LDESC) = ($say "There is an expertly carved jade comb here.\n");
+comb(SDESC) = ($say "jade comb");
+comb(rarea) = 1;
+comb(pfound) = 7;
+comb(pplace) = 6;
+
+NOUN ruby(irm17);
+ruby(movbl) = 1;
+ruby(weight) = 2;
+ruby(LDESC) = ($say "There is a crimson ruby here.\n");
+ruby(SDESC) = ($say "ruby");
+ruby(rarea) = 1;
+ruby(pfound) = 8;
+ruby(pplace) = 7;
+
+NOUN bowl(irm21);
+bowl(movbl) = 1;
+bowl(weight) = 3;
+bowl(LDESC) = ($say "There is a crystal bowl here.\n");
+bowl(SDESC) = ($say "bowl");
+bowl(rarea) = 1;
+bowl(pfound) = 10;
+bowl(pplace) = 10;
+
+NOUN bracelet(irm23);
+bracelet(movbl) = 1;
+bracelet(weight) = 1;
+bracelet(LDESC) = ($say 
+"There is a golden bracelet in the shape of a snake here.\n");
+bracelet(SDESC) = ($say "bracelet");
+bracelet(rarea) = 1;
+bracelet(pfound) = 11;
+bracelet(pplace) = 6;
+
+NOUN shovel(mrm1);
+shovel(movbl) = 1;
+shovel(weight) = 3;
+shovel(LDESC) = ($say 
+"There is a shovel here.\n");
+shovel(SDESC) = ($say "shovel");
+
+NOUN ears;
+
+NOUN pole;
+
+NOUN amber(prm3);
+amber(movbl) = 1;
+amber(weight) = 2;
+amber(LDESC) = ($say "There is a polished piece of amber here.\n");
+amber(SDESC) = ($say "amber");
+amber(rarea) = 2;
+amber(pfound) = 12;
+amber(pplace) = 6;
+
+NOUN lamp(mrm1);
+lamp(movbl) = 1;
+lamp(weight) = 3;
+lamp(LDESC) = ($say  "There is a carbide-flame lamp here.\n");
+lamp(SDESC) = ($say "lamp");
+
+NOUN grate;
+
+NOUN nugget;
+gold = nugget;
+nugget(movbl) = 1;
+nugget(weight) = 4;
+nugget(LDESC) = ($say "There is a gold nugget lying on the ground.\n");
+nugget(SDESC) = ($say "gold nugget");
+nugget(rarea) = 2;
+nugget(pfound) = 13;
+nugget(pplace) = 7;
+
+NOUN axe(prm1);
+axe(movbl) = 1;
+axe(weight) = 1;
+axe(LDESC) = ($say "There is an stone-age axe here.\n");
+axe(SDESC) = ($say "axe");
+
+NOUN spear(prm17);
+spear(movbl) = 1;
+spear(weight) = 2;
+spear(LDESC) = (($eq ($prop spear tooky) 1) : 
+               ($say "There is a Neanderthal hunting spear here.\n"))
+               (($eq ($prop spear tooky) 0) :
+               ($say
+"There is a Neanderthal hunting spear stuck in the ground.\n"));
+spear(SDESC) = ($say "spear");
+
+NOUN plant(prm2);
+plant(movbl) = 1;
+plant(weight) = 4;
+plant(LDESC) = ($say "There is a strange looking potted plant here.\n");
+plant(SDESC) = ($say "plant");
+
+NOUN smilodon;  {Putty tat}
+sabre = smilodon;
+smilo = smilodon;
+
+NOUN troglodyte;
+trogl = troglodyte;
+
+NOUN cheese(prm4);
+cheese(movbl) = 1;
+cheese(weight) = 1;
+cheese(LDESC) = ($say
+"There is a piece of Swiss cheese here. (Aged 1,000,000 years).
+");
+cheese(SDESC) = ($say "cheese");
+
+NOUN towel(prm4);
+towel(movbl) = 1;
+towel(weight) = 2;
+towel(LDESC) = ($say "There is an old towel here.\n");
+towel(SDESC) = ($say "towel");
+
+NOUN mammoth(prm14);
+mammoth(LDESC) = ($say
+"There is a large wooly mammoth blocking the path to the south.\n");
+mammoth(SDESC) = ($say "mammoth");
+elephant = mammoth;
+pachyderm = mammoth;
+
+NOUN feet;
+
+NOUN diamond(prm12);
+diamond(movbl) = 1;
+diamond(weight) = 1;
+diamond(LDESC) = ($say "There is a small diamond here.\n");
+diamond(SDESC) = ($say "diamond");
+diamond(rarea) = 2;
+diamond(pfound) = 7;
+diamond(pplace) = 8;
+
+NOUN ivory(prm15);
+ivory(movbl) = 1;
+ivory(weight) = 2;
+ivory(LDESC) = ($say "There is a piece of ivory here.\n");
+ivory(SDESC) = ($say "ivory");
+ivory(rarea) = 2;
+ivory(pfound) = 9;
+ivory(pplace) = 8;
+
+NOUN pendant;
+pendant(movbl) = 1;
+pendant(weight) = 2;
+pendant(LDESC) = ($say "There is a ancient pendant here.\n");
+pendant(SDESC) = ($say "pendant");
+pendant(rarea) = 2;
+pendant(pfound) = 14;
+pendant(pplace) = 4;
+
+NOUN cairn;
+skulls = cairn;
+
+NOUN bear(prm19);
+bear(LDESC) = ($say "There is a ferocious cave bear blocking your path to the
+north.\n");
+bear(SDESC) = ($say "cave bear");
+
+NOUN necklace(prm20);
+necklace(movbl) = 1;
+necklace(weight) = 1;
+necklace(LDESC) = ($say "There is a pearl necklace here.\n");
+necklace(SDESC) = ($say "necklace");
+necklace(rarea) = 2;
+necklace(pfound) = 13;
+necklace(pplace) = 6;
+
+NOUN Tyranosaur;
+Tyran = Tyranosaur;
+
+NOUN ring(prm23);
+ring(movbl) = 1;
+ring(weight) = 1;
+ring(LDESC) = ($say "There is a large diamond ring here.\n");
+ring(SDESC) = ($say "ring");
+ring(rarea) = 2;
+ring(pfound) = 13;
+ring(pplace) = 10;
+
+NOUN hole;
+
+NOUN newspaper(mrm1);
+newspaper(movbl) = 1;
+newspaper(weight) = 1;
+newspaper(LDESC) = ($say "There is a copy of a newspaper here.\n");
+newspaper(SDESC) = ($say "newspaper");
+
+NOUN crack;
+NOUN shaft;
+
+{*** VERBS ***}
+
+VERB sign;
+VERB read;
+VERB throw;
+VERB drop;
+VERB take;
+VERB play;
+VERB quit;
+VERB look;
+VERB inven;
+i=inven;l=look;
+VERB touch;
+VERB eat;
+VERB swim;
+VERB feed;
+VERB score;
+VERB abracadabra;
+VERB dig;
+VERB cut;
+VERB plug;
+VERB tie;
+VERB untie;
+VERB on;
+VERB off;
+VERB light;
+VERB open;
+VERB close;
+VERB wipe;
+VERB shake;
+VERB xyzzy;
+VERB jamb;
+plugh = xyzzy;
+clean = wipe;
+shut = close;
+peruse = read;
+chuck = throw;
+hurl = throw;
+toss = throw;
+heave = throw;
+put = drop;
+discard = drop;
+get = take;
+grab = take;
+push = touch;
+pet = touch;
+devour = eat;
+consume = eat;
+wade = swim;
+ford = swim;
+shazam = abracadabra;
+hocus = abracadabra;
+abra = abracadabra;
+excavate = dig;
+remove = cut;
+end = quit;
+bye = quit;
+
+{*** FUNNY OBJECT ROUTINES ***}
+
+paper(ACTION) = (($eq ($verb) sign) :
+               (($eq ($prop paper signed) 1) :
+               ($say "You already signed it.\n")
+               ($exit 1))
+               (($ne ($loc pen) .ME) :
+               ($say "You don't have anything to write with.\n")
+               ($exit 1))
+               (($ne ($loc paper) .ME) :
+               ($say "You don't have the release with you.\n")
+               ($exit 1))
+               ($setp paper signed 1)
+               (($eq ($loc .ME) mrm3) : ($say 
+"In a blinding flash of light, a stone archway appears in the east wall!\n")
+               ($exit 1))
+               (($eq ($loc .ME) mrm5) :
+               ($say "The grate magically disappears into thin air.\n")
+               ($exit 1))
+               ($say "You hear strange noises in the nearby rooms.\n")
+               ($exit 1))
+       (($eq ($verb) read) :
+               (($ne ($loc paper) .ME) :
+               ($say "You don't have the paper with you.\n")
+               ($exit 1))
+               ($say
+"                   THIS CONTRACT LIMITS OUR LIABILITY
+                                READ IT
+
+I, the undersigned, will not hold the AARDVARK, the UCLA Computer Sciences
+Department, the UCLA Computer Club, Bell Labs, or the Digital Equipment
+Corporation responsible for any injuries or deaths due to my executing
+this program.\n")
+               ($setp paper readl 1)($exit 1));
+
+spices(ACTION) = (($and ($eq ($verb) throw) ($eq ($loc .ME) irm8)) :
+               ($say "The bag of spices lands on the other side of the river.
+")
+               ($move spices irm9)($exit 1))
+               (($eq ($verb) eat) :
+               ($say "Munch, Munch Munch.  It needed a little more salt.\n")
+               ($move spices .ALL)
+               ($exit 1) )
+               (($and ($eq ($verb) throw) ($eq ($loc .ME) irm9)) :
+               ($say "The bag of spices gets intercepted by one of the
+crocodiles, who promptly swallows it.\n")($move spices .ALL) 
+               ($exit 1));
+
+rupees(ACTION) = (($and ($eq ($verb) throw)
+                       ($or ($eq ($loc .ME) irm8) ($eq ($loc .ME) irm9))) :
+                       ($say
+"The bag is too heavy to throw across the river.  It lands in the middle
+of the river and sinks to the bottom.\n")($move rupees .ALL)
+                       ($exit 1));
+
+coconut(ACTION) = (($and ($eq ($loc .ME) irm19) ($eq ($verb) drop)) :
+               (($ne ($loc coconut) .ME) :($exit 0))
+               (($eq ($prop rupees wellbt) 0) :
+               ($say "The water in the well rises.\n")
+               ($move coconut irm19) ($exit 1))
+               ($say "The water level in the well slowly rises.
+Magically floating on the water is a bag of rupees.\n")
+               ($setp rupees wellbt 0)
+               ($move rupees irm19)
+               ($move coconut irm19) ($exit 1))
+               (($and ($eq ($verb) eat) ($eq ($loc coconut) .ME)) :
+               ($say "The coconut is too large for you to consume.\n")
+               ($exit 1) );
+
+clarinet(ACTION) = (($and ($eq ($verb) play) ($eq ($loc clarinet) .ME)) :
+               (($eq ($loc .ME) irm22) :
+               (($eq ($loc cobra) irm22) :
+               ($say "Your clarinet playing sounds so poor that the cobra
+slithers off in terror.\n")
+               ($move cobra .ALL) ($exit 1)))
+               (($eq ($loc .ME) irm16) :
+               (($eq ($loc rope) irm16) :
+               (($eq ($prop rope ropstf) 0) :
+               ($say "The rope magically extends itself up into the air.\n")
+               ($setp rope ropstf 1)($exit 1))))
+               ($say "Benny Goodman you ain't.\n")
+               ($exit 1));
+
+rope(ACTION) = (($eq ($prop rope ropstf) 1) :
+               (($eq ($verb) take) :
+               ($setp rope ropstf 0))($exit 0))
+               (($or ($eq ($loc .ME) prm2) ($eq ($loc .ME) prm3)) :
+               (($eq ($prop rope rtied) 1) :
+               (($eq ($verb) take) :
+               ($say "You have to untie the rope first.\n") ($exit 1))
+               (($eq ($verb) tie) :
+               ($say "It's already tied, turkey.\n") ($exit 1))
+               (($eq ($verb) untie) :
+               (($eq ($loc .ME) prm2) :
+               ($move rope .ME) ($setp rope rtied 0)
+               ($say "You untie the rope and coil it up.\n"))
+               (($eq ($loc .ME) prm3) :
+               ($say "It's tied down at the other end.\n"))
+               ($exit 1)))
+               (($eq ($prop rope rtied) 0) :
+               (($eq ($verb) tie) :
+               (($eq ($loc .ME) prm2) :
+               ($say "You tie one end of the rope around the pole, the other
+end dangles down into the canyon.\n")
+               ($move rope .ALL)
+               ($setp rope rtied 1) ($exit 1))
+               ($say "I see nothing to tie it onto.\n") ($exit 1))
+               (($eq ($verb) untie) :
+               ($say "It's already untied.\n"))))
+               (($eq ($loc .ME) prm3) :
+               (($eq ($verb) take) : ($say
+"You can't take it, the other end is tied down.\n") ($exit 1))
+               (($eq ($verb) untie) : ($say
+"the knot is on the other end.\n") ($exit 1)));
+
+river(ACTION) = (($and ($ne ($loc .ME) irm8) ($ne ($loc .ME) irm9)) :
+               ($say "I see no river here.\n")($exit 1))
+               (($eq ($verb) take) :
+               ($say "I can't do that.\n") ($exit 1));
+
+cobra(ACTION) = (($and ($eq ($verb) take) ($eq ($loc .ME) ($loc cobra))) :
+               ($say "That would be a poor idea.\n")($exit 1));
+
+crocodile(ACTION) = (($eq ($verb) take) :
+               ($say "I can't get to any crocodiles from here.\n")
+               ($exit 1));
+
+cmara = (($eq ($verb) take) :
+       ($say "The statue is too heavy for you to carry.\n")
+       ($exit 1));
+claks = (($and ($or ($eq ($verb) take) ($eq ($verb) touch))
+       ($eq ($prop statue tlakst) 0)) :
+       ($say
+"The statue slides away very easily, revealing a secret passage.\n")
+               ($setp statue tlakst 1)($exit 1));
+mara(ACTION) = (($eq ($loc .ME) irm10) : (cmara));
+vishnu(ACTION) = (($eq ($loc .ME) irm11) : (cmara));
+lakshmi(ACTION) = (($eq ($loc .ME) irm12) : (claks));
+statue(ACTION) = (($or ($eq ($loc .ME) irm10) ($eq ($loc .ME) irm11)) :
+               (cmara)
+               ($say "That won't accomplish anything.\n")
+               ($exit 1))
+               (($eq ($loc .ME) irm12) : (claks)
+               ($say "I don't see how you can do that to a statue.\n")
+               ($exit 1));
+
+banana(ACTION) = (($eq ($loc banana) .ME) :
+               (($eq ($verb) eat) :
+               ($say "You eat the banana, peel and all.\n")
+               ($move banana .ALL)
+               ($exit 1)))
+               (($eq ($loc .ME) irm20) :
+               (($eq ($verb) drop) :
+               ($say "The monkey picks up the banana, eats it, and discards
+the banana-peel.  As soon as the monkey finishes eating
+the banana, a bolt of lighting hits the stone slab and 
+cracks it open.\n")
+               ($setp monkey fedmky 1)
+               ($move banana .ALL)
+               ($move peel irm20) ($exit 1)));
+
+horn(ACTION) = (($eq ($prop rhino cutflg) 1) : ($exit 0))
+               (($eq ($loc .ME) irm13) : 
+               (($eq ($verb) take) :
+               ($say "It is still attached to the rhino.\n")
+               ($exit 1))
+               (($eq ($verb) cut) :
+               (($ne ($loc saw) .ME) :
+               ($say "You don't have something to cut the horn with.\n")
+               ($exit 1))
+               (($eq ($prop rhino earplg) 1) :
+               ($say "You cut the horn off without waking up the rhino.\n")
+               ($setp rhino cutflg 1)
+               ($move horn irm13) ($exit 1))
+               ($say "The noise of the sawing wakes up the rhinoceros who
+tramples you to death because you disturbed his beauty sleep.\n")
+               (exitg)));
+
+lattice(ACTION) = (($eq ($loc .ME) irm13) :
+               (($eq ($verb) take) :
+               (($eq ($prop rhino earplg) 1) :
+               ($say "You successfully take the lattice without waking the
+rhino.  Unfortunately, the lattice was the structure which supported the roof
+of the room, and the ceiling comes crashing down upon you and breaks every 
+bone in your body.\n"))
+               (($eq ($prop rhino earplg) 0) :
+               ($say "As you take the lattice, a large part of the bamboo
+falls down.  The noise caused by the falling bamboo scares the sleeping
+rhinoceros who tramples you in his panicked exit from the room.\n"))
+               (exitg)));
+
+monkey(ACTION) = (($eq ($loc .ME) irm20) :
+               (($eq ($verb) feed) :
+               (($eq ($loc banana) .ME) :
+               ($say "The monkey takes your banana, peels it, eats it,
+and throws away the banana peel.  As soon as he finishes eating
+the banana, there is a rumble from the depths of the earth and 
+a crack appears in the stone slab.\n")
+               ($setp monkey fedmky 1)
+               ($move banana .ALL)
+               ($move peel irm20) ($exit 1))));
+
+cotton(ACTION) = (($eq ($loc .ME) irm13) :
+               (($and ($eq ($verb) drop) ($eq ($iobj) ears)) :
+               ($say
+"You stick the wads of cotton into the rhino's ears.\n")
+               ($move cotton .ALL)
+               ($setp rhino earplg 1)
+               ($exit 1)))
+               (($eq ($loc cotton) .ALL):
+               (($eq ($loc .ME) irm13):
+               (($eq ($verb) take) :
+               ($say "OK\n")
+               ($move cotton .ME)
+               ($setp rhino earplg 0)
+               ($exit 1))));
+
+pole(ACTION) = (($and ($eq ($loc .ME) prm2) ($eq ($verb) take)) :
+               ($say "The pole is firmly cemented into the ground.\n")
+               ($exit 1));
+
+lamp(ACTION) = (($eq ($verb) light) : (onlmp) ($exit 1));
+
+oven(ACTION) = (($and ($eq ($loc .ME) irm4) ($eq ($verb) open)) :
+               ($say "The door of the oven doesn't budge.\n")
+               ($exit 1));
+
+grate(ACTION) = (($and ($eq ($prop paper signed) 0)
+                       ($eq ($loc .ME) mrm5)) :
+               (($or ($eq ($verb) open) ($eq ($verb) take)) :
+                       ($say
+"The grate appears to be firmly cemented into the wall.\n")
+               ($exit 1))
+               (($eq ($verb) shut) :
+               ($say "The grate is already shut.\n")($exit 1)));
+
+weapo = (($eq ($verb) throw) :
+       (($and ($eq ($prop bear hitbr) 0) ($eq ($loc .ME) prm19)) :
+       ($say "The axe bounces harmlessly off of the bear.\n")
+       ($move axe prm19) ($exit 1))
+       (($eq ($loc .ME) prm14) :
+       ($say "The weapon that you just threw imbeds itself deep into the 
+skull of the mammoth and is covered by the mammoth's long fur so that it
+can't be seen.  The mammoth just stares back at you blankly.\n")
+       ($move ($dobj) .ALL) ($exit 1))
+       (($or ($eq ($loc .ME) irm8) ($eq ($loc .ME) irm9)) :
+       ($say "You miss the crocodile and your weapon sinks into the river.\n")
+       ($move ($dobj) .ALL) ($exit 1))
+       (($eq ($loc .ME) irm13):
+       ($say "Your weapon bounces harmlessly off of the rhino.\n")
+       ($move ($dobj) irm13) ($exit 1))
+       (($and ($eq ($loc .ME) prm6) ($eq ($prop smilo stond) 0)) :
+       ($say "The sabre-tooth catches your weapon in its mouth and promptly
+swallows it.\n") ($move ($dobj) .ALL) ($exit 1))
+       (($and ($eq ($loc .ME) prm8) ($eq ($prop trogl killd) 0)) :
+       ($say "You hit the troglodyte, who, screaming in pain, drops the
+gold nugget and falls over the cliff.\n") ($setp trogl killd 1)
+       ($move ($dobj) .ALL)
+       ($move nugget prm8) ($exit 1)));
+
+spear(ACTION) = (($eq ($loc spear) .ME) : 
+               (($ne ($loc .ME) prm19) :
+               (weapo))
+               (($eq ($loc .ME) prm19) :
+               (($eq ($verb) throw) :
+               ($say
+"You repeatedly throw your spear at the bear.  Eventually, he gets
+bored and wanders off.\n")
+               ($move bear .ALL)
+               ($move spear prm19)
+               ($setp bear hitbr 1) ($exit 1) )))
+               (($eq ($loc .ME) prm17) :
+               (($eq ($verb) take) :
+               (($eq ($prop spear tooky) 0) :
+               ($say
+"You hear a loud roar as an avalanche blocks the path to your north.\n")
+               ($move spear .ME)
+               ($setp spear tooky 1) ($exit 1))))
+               (($eq ($verb) shake) :
+($say "I don't see any playwrights here.\n"))
+               (($and ($eq ($loc .ME) prm23) ($eq ($verb) take)) :
+               ($say 
+"As soon as you take the spear, the Tyranosaurus Rex closes his mouth and
+swallows you.\n") (exitg));
+
+axe(ACTION) = (($eq ($loc axe) .ME) : (weapo));
+
+smilo(ACTION) = (($and ($eq ($loc .ME) prm6) ($eq ($verb) take)) :
+               ($say "You must be dumber than you look.\n")
+               ($exit 1));
+
+troglodyte(ACTION) = (($and ($eq ($loc .ME) prm8) ($eq ($verb) take)) :
+               ($say "The troglodyte does not look like he wants to be
+carried.\n") ($exit 1));
+
+plant(ACTION) = (($eq ($loc .ME) prm6) :
+               (($or ($eq ($verb) throw) ($eq ($verb) drop)) :
+               (($eq ($prop smilo stond) 0) :
+               ($say 
+"The plant you were holding turns out to be primo grade catnip.  The
+sabre-tooth cat grabs the plant and runs off purring loudly.\n")
+               ($move plant .ALL)
+               ($setp smilo stond 1) ($exit 1))))
+               (($eq ($verb) eat) :
+               ($say 
+"You completely eat the plant and now feel quite nauseous.\n")
+               ($move plant .ALL) ($exit 1));
+
+nugget(ACTION) = (($and ($eq ($verb) take)
+               ($eq ($prop trogl killd) 0)) :
+               ($say "He ain't gonna let you take it.\n")($exit 1));
+
+cheese(ACTION) = (($eq ($verb) eat) :
+               ($say "You eat the cheese, but nothing peculiar happens.\n")
+               ($move cheese .ALL) ($exit 1))
+               (($and ($eq ($verb) drop) ($eq ($loc .ME) prm14)) :
+               ($say 
+"As soon as you drop the cheese, a mouse runs out of the hole in the east 
+wall and takes it.  This scares the mammoth who runs off in terror.\n")
+               ($setp mammoth blokd 1)
+               ($move mammoth .ALL)
+               ($move cheese .ALL) ($exit 1));
+
+mammoth(ACTION) = (($eq ($loc mammoth) ($loc .ME)) :
+               (($eq ($verb) feed) :
+               ($say "He doesn't look hungry.\n")($exit 1))
+               (($eq ($verb) take) : ($say
+"He doesn't look too easy to carry.\n") ($exit 1)));
+
+feet(ACTION) = (($eq ($verb) wipe) :
+               (($ne ($loc towel) .ME) :
+               ($say "You don't have something to wipe them with.\n")
+               ($exit 1))
+               ($say "You just cleaned off your feet.\n")
+               ($setp feet wiped 0) ($exit 1))
+               (($eq ($verb) touch) :
+               ($say "You can't without bending your knees.\n"));
+
+cairn(ACTION) = (($eq ($loc .ME) prm18) :
+               ($say 
+"How dare you do such a thing.  Any idiot with just the slightest knowledge
+of prehistoric etiquette knows that you aren't supposed to do anything to
+a cairn.\n") ($exit 1) );
+
+bear(ACTION) = (($eq ($loc .ME) prm19) :
+               (($eq ($verb) take) :
+               (($eq ($prop bear hitbr) 0) :
+               ($say 
+"The bear is a little too bulky to carry.\n")($exit 1))));
+
+Tyranosaur(ACTION) = (($and ($ne ($loc .ME) prm22) ($ne ($loc .ME) prm23)) :
+               ($say
+"What?  One of those things hasn't existed in several million years.\n"));
+
+hole(ACTION) = (($eq ($loc .ME) prm14) :
+               ($say "That hole is too small to do anything with.\n")
+               ($exit 1))
+               (($eq ($loc .ME) irm19) :
+               (($eq ($verb) drop) :
+               (($eq ($iobj) hole) :
+               ($say "It falls back out of the hole.\n")
+               ($exit 1))))
+               (($eq ($loc .ME) irm6) :
+               (($eq ($verb) drop) :
+               (($eq ($iobj) hole) :
+               (($eq ($dobj) spices) :
+               (($ne ($loc spices) .ME) :
+               ($say "You ain't got it with you.\n")
+               ($exit 1))
+($say "The bag of spices rips against the jagged sides of the shaft and 
+almost all of the spices get blown away in the wind.\n")
+               ($move spices .ALL)
+               ($exit 1))
+               (($eq ($dobj) rupees) :
+               (($ne ($loc rupees) .ME) :
+               ($say "You ain't got the coins with you.\n")
+               ($exit 1))
+($say "The rupees fall down the shaft into the darkness below.  You
+eventually hear a barely audible splash.\n")
+               ($setp rupees wellbt 1)
+               ($move rupees .ALL)
+               ($exit 1))
+               ($say "That doesn't fit in the hole.\n")
+               ($exit 1)
+               )))
+               ($say "I do not see any holes here.\n");
+
+newspaper(ACTION) = (($and ($eq ($verb) read) ($eq ($loc newspaper) .ME)) :
+               ($say
+"                         DAILY GNUS
+Vol 2.                                                         25 AUGUST
+
+")
+               ($say
+"Spies in the far reaches of the Museum have reported that new construction
+is now taking place.\n\n")
+               ($say
+"Again, Adventurers are reminded that restocking of the museum sections will
+be greatly rewarded.\n\n"
+                       )($exit 1));
+
+crack(ACTION) = (($eq ($verb) jamb) :
+               ($say "The only climbable cracks in this place are A4.\n")
+               ($exit 1))
+               ($say "I can't figure that out. I'm not as smart as I am 
+cracked up to be.\n")($exit 1);
+
+shaft(ACTION) = (($eq ($verb) jamb) :
+               ($say "Try jamb crack (How do you jamb a shaft?)\n")
+               ($exit 1));
+
+{*** DIRECTIONS ***}
+
+VERB north;
+VERB south;
+VERB east;
+VERB west;
+VERB up;
+VERB down;
+VERB in;
+VERB out;
+n=north;
+s=south;
+e=east;
+w=west;
+u=up;
+d=down;
+enter = in;
+exit=out;
+leave=out;
+climb=up;
+
+{*** VERB ROUTINES ***}
+
+plug(ACTION) = (($eq ($loc .ME) irm13) :
+               (($eq ($loc cotton) .ME) :
+               ($say
+"You stick the cotton into the rhino's ears.\n")
+               ($move cotton .ALL)
+               ($setp rhino earplg 1)
+               ($exit 1)))
+               ($say "I don't quite understand what you mean.\n");
+
+dig(ACTION) = (($ne ($loc shovel) .ME) :
+               ($say "You don't have something to dig with.\n")
+               ($exit 1))
+               (($eq ($loc .ME) irm9) :
+               (($eq ($prop cotton tookbt) 0) : ($setp cotton tookbt 1)
+               ($say "You find some cotton buried in the sand.\n")
+               ($move cotton irm9)($exit 0))
+               ($say "OK\n") ($exit 0))
+               (($eq ($loc .ME) prm17) :
+               (($eq ($prop pendant dugbt) 0) : ($setp pendant dugbt 1)
+               ($say "You find an ancient pendant buried in the grave.\n")
+               ($move pendant prm17) ($exit 0))
+               ($say "You dig some but you don't find anything.\n")
+               ($exit 0))
+               ($say "The ground is too hard to dig into.\n");
+
+cantdo = ($say "I don't believe I can do that.\n");
+sign(ACTION) = (cantdo);
+play(ACTION) = (cantdo);
+
+arolg = ($say "It will probably cost you an arm or a leg to feed that.\n")
+       ($exit 1);
+feed(ACTION) = (($or ($eq ($loc .ME) irm8) ($eq ($loc .ME) irm9)) :
+               (($eq ($dobj) crocodile) :
+               (arolg)))
+               (($and ($eq ($loc .ME) prm19) ($eq ($dobj) bear)) :
+               (($eq ($prop bear hitbr) 0) :
+               (arolg)))
+               (($and ($eq ($loc .ME) prm6) ($eq ($dobj) smilo)) :
+               (($eq ($prop smilo stond) 0) :
+               (arolg)))
+               (($or ($eq ($loc .ME) prm22) ($eq ($loc .ME) prm23)) :
+               (($eq ($dobj) Tyran) : (arolg)))
+               ($say "I don't quite understand what you mean.\n");
+
+cut(ACTION) = (cantdo);
+
+read(ACTION) = ($say "I don't see any text here that I can read.\n");
+
+throw(ACTION) = (cdrop);
+
+touch(ACTION) = ($say "That doesn't seem to accomplish much.\n");
+
+eat(ACTION) = ($say "I think I just lost my appetite.\n");
+
+abracadabra(ACTION) = (($ne prehs ($loc ($loc .ME))) :
+               ($say
+"That phrase hasn't worked in at least ten thousand years.\n")
+               ($exit 0))
+               (($ne ($loc .ME) prm17) :
+               ($say "Nothing happens.\n") ($exit 0))
+               (($eq ($prop spear tooky) 1) :
+               (($eq ($prop spear abrad) 0) :
+               ($setp spear abrad 1)
+               ($say "The rubble gets magically cleared away.\n")
+               ($exit 0)))
+               ($say "Nothing much happens.\n");
+
+tie(ACTION) =  ($say "It is impossible to tie a knot in that right now. \n");
+
+untie(ACTION) = ($say "I don't quite understand what you mean.\n");
+
+on(ACTION) = (($eq ($prop lamp onoff) 1) :
+               ($say "The lamp is already on.\n") ($exit 1))
+               (onlmp) ($exit 1);
+
+off(ACTION) = (($ne ($loc lamp) .ME) :
+               ($say "You don't have the lamp with you.\n")
+               ($exit 1))
+               (($eq ($prop lamp onoff) 0) :
+               ($say "The lamp is already off.\n")
+               ($exit 1))
+               ($setp lamp onoff 0)
+               ($say "The lamp is now off.\n");
+
+light(ACTION) = ($say "I don't know how to light that.\n");
+
+open(ACTION) = ($say "That thing is un-openable.\n");
+
+close(ACTION) = ($say "I don't quite understand what you mean.\n" );
+
+swim(ACTION) = (($eq ($loc .ME) irm8) :
+               (ei8) ($exit 0))
+               (($eq ($loc .ME) irm9) :
+               (ei8) ($move .ME irm8) ($exit 0))
+               ($say "I don't see enough water here to even wade in.\n");
+
+wipe(ACTION) = ($say "I don't quite comprehend what you are saying.\n");
+
+shake(ACTION) = ($say "That probably won't accomplish much.\n");
+
+jamb(ACTION) = ($say "I don't quite comprehend what you mean.\n");
+
+xyzzy(ACTION) = ($say 
+"You are transported to a room where you are faced by a wizard who points to
+you and says, ''Them's fighting words!''  You immediately get attacked by
+all sorts of denizens of the museum: there is a cobra chewing on your leg,") 
+       ($say "
+a troglodyte is bashing your brains out with a gold nugget, a crocodile is 
+removing large chunks of flesh from you, a rhinoceros is goring you with his
+horn, a sabre-tooth cat is busy trying to disembowel you, you are being")
+       ($say "
+trampled by a large mammoth, a vampire is sucking you dry, a Tyranosaurus
+Rex is sinking his six inch long fangs into various parts of your anatomy,
+a large bear is dismembering your body, a gargoyle is bouncing up and")
+       ($say "
+down on your head, a burly troll is tearing you limb from limb, several
+dire wolves are making mince meat out of your torso, and the wizard is about
+to transport you to the corner of Westwood and Broxton.\n")
+       ($say "Oh dear, you seem to have gotten yourself killed, as well.\n")
+       (skore) (ratng) (ratnx) ($spec 3 0 0 0 0);
+
+score(ACTION) = (skore)(ratng);
+skore = ($say "You scored")
+       ($num ($prop .ME pscore))
+       ($say "out of")
+       ($num ($prop .ME pmax))
+       ($say "possible points.\n");
+
+ratng =        ($setp .ME ratvl 0)
+       (($ne ($prop .ME pscore) 0) :
+       ($setp .ME ratvl ($quotient ($times ($prop .ME pscore) 8)
+                                       ($prop .ME pmax))))
+       ($say "That gives you a ranking of ")
+       (($eq ($prop .ME ratvl) 0) :
+       ($say "junior beginning adventurer.\n"))
+       (($eq ($prop .ME ratvl) 1) :
+       ($say "senior beginning adventurer.\n"))
+       (($eq ($prop .ME ratvl) 2) :
+       ($say "intermediate adventurer.\n"))
+       (($eq ($prop .ME ratvl) 3) :
+       ($say "expert adventurer.\n"))
+       (($eq ($prop .ME ratvl) 4) :
+       ($say "junior master adventurer.\n"))
+       (($eq ($prop .ME ratvl) 5) :
+       ($say "master adventurer.\n"))
+       (($eq ($prop .ME ratvl) 6) :
+       ($say "senior master adventurer.\n"))
+       (($eq ($prop .ME ratvl) 7) :
+       ($say "life master adventurer.\n"))
+       (($eq ($prop .ME ratvl) 8) :
+       ($say "super-stud adventurer.\n"));
+
+ratnx = (($eq ($prop .ME ratvl) 8) : 
+       ($say "CONGRATULATIONS.\n") ($spec 3 0 0 0 0))
+       ($say "To achieve the next higher rating, you need to score")
+       ($setp .ME ratvl ($plus ($prop .ME ratvl) 1))
+       ($setp .ME ratvl ($times ($prop .ME ratvl) ($prop .ME pmax)))
+       ($setp .ME ratvl ($quotient ($prop .ME ratvl) 8))
+       ($setp .ME ratvl ($plus ($prop .ME ratvl) 1))
+       ($setp .ME ratvl ($minus ($prop .ME ratvl) ($prop .ME pscore)))
+       ($num ($prop .ME ratvl))
+       ($say "more points.\n");
+
+objl = (($eq %1 0) : ($exit 0))
+       (objl ($link %1))
+       (($ldisc %1));
+
+objs = (($eq %1 0) : ($exit 0))
+       (objs ($link %1))
+       (($eq %1 .ME) : ($exit 0))
+       (($eq ($prop .ME kludge) 1) : ($say "You can see:\n")
+                               ($setp .ME kludge 0))
+       (($sdisc %1))
+       ($say "\n");
+
+LLOOK =  (($ldisc ($loc .ME)))
+       (objl ($cont ($loc .ME)));
+
+SLOOK = (($sdisc ($loc .ME)))
+       ($setp .ME kludge 1)
+       (objs ($cont ($loc .ME)));
+
+LOOK = ( ($prop ($loc .ME) VISIT) :
+               (($ne @Myloc ($loc .ME)) :   (SLOOK)) :
+               (($ne @Myloc ($loc .ME)) :
+                       (LLOOK) ($setp ($loc .ME) VISIT 1))
+       )
+       ($setg Myloc ($loc .ME))
+       ($say "> ");
+
+START = ($setp .ME pmax 250)
+       ($setp .ME debug 0)
+       ($move .ME mrm1)
+       ($sdem LOOK);
+
+quit(ACTION) = (skore) (ratng) (ratnx) ($spec 3 0 0 0 0);
+
+        look(ACTION) = (LLOOK);
+
+take(ACTION) = (ctake);
+scale = ($setp .ME weight 0)
+       (($ne ($cont .ME) 0) :
+       ($setg 12 ($cont .ME)) (scads));
+scads = (($ne @12 0):
+       ($setp .ME weight ($plus ($prop .ME weight) ($prop @12 weight)))
+       ($setg 12 ($link @12))
+       (scads));
+ctake = (scale)
+       (($ne ($loc .ME) ($loc ($dobj))):
+       ($say "I don't see that item here.\n")($exit 0))
+       (($eq ($prop ($dobj) movbl) 0) :
+       ($say "That thing is too heavy to carry.\n")($exit 0))
+       (($gt ($plus ($prop ($dobj) weight) ($prop .ME weight)) 20) :
+       ($say
+"You are carrying too much.  You will have to at least drop something first.
+") ($exit 0))
+       ($setp .ME weight ($plus ($prop ($dobj) weight) ($prop .ME weight)))
+       ($say "OK\n") ($move ($dobj) .ME)
+       (($eq ($prop ($dobj) rarea) 0 ) : ($exit 0))
+       ($setp .ME pscore ($plus ($prop .ME pscore) ($prop ($dobj) pfound)))
+       ($setp ($dobj) pfound 0);
+
+drop(ACTION) = (cdrop);
+cdrop = (($ne ($loc ($dobj)) .ME) :
+       ($say "You don't have it with you.\n")($exit 0))
+       (($eq ($loc .ME) prm21) :
+       ($say "OK, it falls further down into the crack.\n")
+       ($move ($dobj) prm22) ($exit 1))
+       ($say "OK\n") ($move ($dobj) ($loc .ME))
+       (($eq ($prop ($dobj) rarea) 0 ) : ($exit 0))
+       (($eq ($prop ($dobj) rarea) 2) : (($eq ($loc .ME) mrm5) :
+                       (scord)))
+       (($eq ($prop ($dobj) rarea) 1): (($eq ($loc .ME) mrm3) : 
+               (scord)));
+       
+       scord = 
+       ($setp .ME pscore ($plus ($prop .ME pscore) ($prop ($dobj) pplace)))
+       ($setp ($dobj) pplace 0);
+
+inven(ACTION) = ($say "You are carrying:\n")
+               (($eq ($cont .ME) 0):($say "Nothing\n")($exit 1))
+               ($setg 12 ($cont .ME)) (inside);
+inside = (($ne @12 0) : (($sdisc @12)) ($say "\n")
+       ($setg 12 ($link @12)) (inside));
+
+{*** ROOM DESCRIPTIONS ***}
+
+mrm1(LDESC) = ($say "You are standing outside the north entrance of a large
+brick building.  Inscribed above the doorway, appear the 
+text: 'AARDVARK'S MUSEUM -- GATEWAY TO ADVENTURELAND'.
+");
+mrm1(SDESC) = ($say "Museum entrance
+");
+
+mrm2(LDESC) = ($say "You are in a large rotunda of an old museum.  Doors lead
+to the north, south, east, and west, and a narrow stairway 
+in the north-east corner of the room leads down.
+");
+mrm2(SDESC) = ($say "Museum rotunda
+");
+
+mrom3a = ($say "You are in a dimly lit room containing an empty display case.
+A portion of a vandalized sign above the case reads: 
+'ARTIFACTS OF ANCIENT INDIA -- Several of these items,
+including the sacred rhinoceros horn, the deadly ...'.
+The rest of the sign is unreadable.
+");
+mrm3(LDESC) = (mrom3a)
+               (($eq ($prop paper signed) 0) : ($say 
+"To the west, you can look through a large door into the rotunda
+of the museum. On the east wall of the hall there is an outline
+of an arch.
+"))
+               (($eq ($prop paper signed) 1) : ($say
+"Through the door to the west, you can see part of the rotunda
+of the museum.  To the east, there is a stone archway.
+"));
+mrm3(SDESC) = ($say "East wing of the museum
+");
+
+mrm4(LDESC) = ($say "You are in a non-descript room with absolutely 
+nothing in it.  A hollow voice says ''This room is unavailable for use at this
+time.  Please leave through the doorway to your north.''
+");
+mrm4(SDESC) = ($say "Closed room
+");
+
+mrom5 = ($say "You are standing before a large empty display case in a poorly
+lit basement-like room.  Encircling the room high on the walls appear the text
+''HALL OF PREHISTORY.''  A stairway leads up, and in the south wall, there is
+a small hole");
+mrm5(LDESC) = (mrom5)
+               (($eq ($prop paper signed) 1) :
+               ($say ".\n"))
+               (($eq ($prop paper signed) 0) :
+               ($say " covered by a grate.\n"));
+mrm5(SDESC) = ($say "Hall of Prehistory.\n");
+
+mrm6(LDESC) = ($say
+"You are wandering through a dense forest past twisted birch trees
+rising toward the sky in contorted agony.  Enormous skeletons of burned
+out sycamores are scattered throughout the area, and gnarled stumps of")
+($say
+"\nonce proud oak trees make the appearance of the forest even more 
+disturbing.  Nothing is stirring, a pall of death seems to hang over the
+forest like a blanket, and you can't seem to figure out which direction\n")
+($say "is which.\n");
+mrm6(SDESC) = ($say "You are lost in the forest.\n");
+
+irm1(LDESC) = ($say "You  are at the top of a highly ornate spiral stairway.
+A wing of the museum can be seen to the west.  The room is moist 
+and damp, and the scent of cumin and saffron fills the air.
+");
+irm1(SDESC) = ($say "Top of spiral stairway
+");
+
+irm2(LDESC) = ($say "You are in an east-west passage at the bottom of
+a spiral stairway.  A slight breeze blows from east to west.
+");
+irm2(SDESC) = ($say "Bottom of spiral stairway
+");
+
+irm3(LDESC) = ($say "You are standing in a deserted Indian marketplace.
+Although it seems to have once been a bustling area, 
+there is very little left here.  Most of the vacant
+booths form an alley running north, and a small path
+goes east.
+");
+irm3(SDESC) = ($say "Marketplace
+");
+
+irm4(LDESC) = ($say "You are in a small kitchen adjoining the marketplace.
+Most of the furniture in the room has been broken, and all               
+of the pottery once used for cooking has been stolen. In the
+north-west corner, there is a tandoori oven.  A door to the
+south leads back out to the marketplace, and a trap-door 
+leads down to what appears to be a murky basement.
+");
+irm4(SDESC) = ($say "Kitchen
+");
+
+irm5(LDESC) = ($say "You are in a cellar which apparently has been used to
+store spices.  Empty racks line all the walls of the room, 
+and everything in the room seems to be blanketed in a thin
+layer of dust.  An unreachable hole appears in the ceiling
+and exits lead to the north, south, and east.
+");
+irm5(SDESC) = ($say "Spice cellar
+");
+
+irm6(LDESC) = ($say "You are in a small cave-like room apparently once used
+for the cultivation of mushrooms.  You find the smell of
+this room slightly displeasing.  There are exits to the  
+south and west, and there is a small hole in the 
+north wall, through which you can see a long vertical
+shaft with jagged sides.
+");
+irm6(SDESC) = ($say "Mushroom room
+");
+
+irm7(LDESC) = ($say "You are in an abandoned warehouse-like room which, 
+though once used for storage, is now predominantly full of  
+rubble.  Exits lead to the north and east.
+");
+irm7(SDESC) = ($say "Warehouse
+");
+
+irm8(LDESC) = ($say "You are standing on a rocky beach on the west bank
+of a slow-moving subterranean river. Several large 
+crocodiles are lazily sleeping at the north end of the river. 
+A path leads to the west.
+");
+irm8(SDESC) = ($say "West bank of river
+");
+
+irm9(LDESC) = ($say "You are on a sandy beach on the east bank of a crocodile
+infested river.  A roughly hewn stairway in the rock leads up 
+far beyond your range of vision.
+");
+irm9(SDESC) = ($say "East bank of river
+");
+
+irm10(LDESC) = ($say "You are in a room containing an enormous statue of
+Mara, Hindu goddess and consort to Vishnu.  Passages lead 
+to the east, west, and south, and a roughly hewn stairway
+seems to go down to an area further underground.
+");
+irm10(SDESC) =($say "In front of Mara's statue
+");
+
+irm11(LDESC) = ($say "You are standing in front of a gigantic statue of the
+Hindu god Vishnu.  Passages lead north and south, and it appears
+that you can squeeze through a narrow crack in the western wall.
+");
+irm11(SDESC) = ($say "In front of Vishnu's statue
+");
+
+irom12a = ($say "You are in a room containing an enormous statue of 
+Lakshmi, Hindu goddess and consort to Vishnu.  
+");
+irm12(LDESC) = (irom12a)
+               (($eq ($prop statue tlakst) 0) : ($say 
+"Passages lead to the north and east.
+"))
+               (($eq ($prop statue tlakst) 1) : ($say
+"Passages lead to the east and north, and on the west wall
+there is a hole large enough to crawl through.
+"));
+irm12(SDESC) = ($say "In front of Lakshmi's statue
+");
+
+irm13(LDESC) = ($say "You are in what would appear to be a totally man-made
+cave.  The walls are covered with bamboo shafts cut and 
+tied together to form a very complex lattice pattern.
+An extremely narrow passage leads east, and there is a 
+large door to the south.
+");
+irm13(SDESC) = ($say "Bamboo Room
+");
+
+irm14(LDESC) = ($say "You are in a small room with a very low ceiling. The
+only exit is to the east.
+");
+irm14(SDESC) = ($say "Flat Room
+");
+
+irm15(LDESC) = ($say "You are standing in the center of a large dome-like 
+room.  Exits lead to the north, east, and west, and around the perimeter of
+the room appear the words 'ABRACADABRA -- VARUNA SUCKS COCONUTS.'
+");
+irm15(SDESC) = ($say "Inside Dome
+");
+
+irm16(LDESC) = ($say
+"You are at the base of a tall naturally formed shaft.
+On all sides, you are surrounded by gigantic basalt columns
+towering above you in a serpentine manner, as if great 
+likenesses of Vasuki himself.  Passages lead to the north,
+east, and west, and above you appears a small ledge.
+");
+irm16(SDESC) = ($say "Vertical Shaft
+");
+
+irm17(LDESC) = ($say
+"You are on a small ledge high above the base of a large
+shaft.  There is a rope seemingly standing rigid allowing you to
+climb down, but the climb above you seems quite dificult.
+");
+irm17(SDESC) = ($say "On small ledge
+");
+
+irm18(LDESC) = ($say
+"You are in a small room which smells strongly of
+incense.  Stone archways lead to the south, and east, and
+a smaller passage leads to the west.  You also hear some
+chanting and Sitar music in the background.
+");
+irm18(SDESC) = ($say "Incense room
+");
+
+irm19(LDESC) = ($say
+"You are at the holy well of Varuna, the water god.  The well is in the
+middle of the room, leading straight down into some water far below.
+Legend has it that those who climb down into the well suffer a fate
+worse than death, so it is advisable not to go down.  In the 
+ceiling, there is a round hole")
+       (($eq ($prop rupees wellbt) 1) :
+       ($say " and the water in the well appears to have
+been disturbed recently.\n"))
+       (($eq ($prop rupees wellbt) 0) :
+       ($say ".\n"));
+irm19(SDESC) = ($say "Varuna's well
+");
+
+irom20a = ($say
+"You are at the entrance to Siva's temple.
+");
+irm20(LDESC) = (irom20a)
+               (($eq ($prop monkey fedmky) 1) : ($say
+"A passage leads back to the west, and a crack in a huge stone slab allows
+one to proceed east.
+"))
+               (($eq ($prop monkey fedmky) 0) : ($say
+"A passage leads back to the west, but the entrance to the temple is blocked
+by a huge stone slab.
+"));
+irm20(SDESC) = ($say "Entrance to Siva's temple
+");
+
+irm21(LDESC) = ($say 
+"You are standing in front of Siva's altar, a small stone slab in front of
+a large monolith.  The exit is to the west.
+");
+irm21(SDESC) = ($say "Siva's Altar
+");
+
+irm22(LDESC) = ($say
+"You are standing at the top of a six-foot deep snake pit.  The walls of the
+room are covered with bas relief figures of cobras, kraits, and other 
+miscellaneous elapids.  Exits lead to the west and south, through archways
+ringed by pythons carved into the rock.
+");
+irm22(SDESC) = ($say "Top of Snake pit
+");
+
+irm23(LDESC) = ($say
+"You are at the bottom of a snake pit.  The only direction it appears you 
+can go is back out.
+");
+irm23(SDESC) =($say "Bottom of snake pit
+");
+
+prm1(LDESC) = (darkq) ($say
+"You are in the north-south corridor of an ancient paleolithic cave.  Its 
+low ceiling is covered with paintings of wild game which have faded due to
+the passing of time.\n");
+prm1(SDESC) = (darkq)($say "North-south corridor.\n");
+
+prm2(LDESC) = ($say
+"You are standing on a ledge above the floor of a subterranean canyon
+running east-west.  Shafts of sunlight penetrate through cracks in the
+ceiling high above, washing the room with an alabaster murkiness;
+casting shadows on the weathered rocks which have lain undisturbed
+for countless centuries. A small crawlway leads north, and there is a
+short, stout pole sticking out of the ground.")
+       (($eq ($prop rope rtied) 1) : ($say "  A section of rope is tied 
+around the pole, with the other end hanging down into the canyon.\n"))
+       (($eq ($prop rope rtied) 0) : ($say "\n"));
+
+prm2(SDESC) = ($say "Above East-west canyon.\n");
+
+prm3(LDESC) = ($say 
+"You are at the bottom of a canyon running east-west.  The passage to the
+east is blocked by rubble, so it appears that the only direction you can
+go is west. A rope dangles down from above.\n");
+prm3(SDESC) = ($say "East end of canyon.\n");
+
+prm4(LDESC) = ($say
+"You are standing in front of a limestone cavern, the entrance of which looks
+like a gaping mouth of a grotesque monster.  It appears that you can enter
+the cave to your south, or go either direction in the east-west canyon that
+you are in.\n");
+prm4(SDESC) = ($say "Entrance to limestone cavern.\n");
+
+prm5(LDESC) = (darkq) ($say
+"You are in a very narrow room which probably was once much larger.
+However, it appears that a recent cave-in has closed off much of the
+room to the east.  To your north, there is a corridor which apparently
+leads back out, and in the eastern wall, there is a hole which you can
+probably crawl through.\n");
+prm5(SDESC) = (darkq) ($say "Narrow room in cave.\n");
+
+prm6(LDESC) = (darkq) (($eq ($prop smilo stond) 0) : ($say
+"You are standing above a shallow pit which is empty except for a
+large smilodon (sabre-tooth tiger) which is growling at you menacingly.
+The only other direction it looks like you can go is back out through a
+small hole in the rubble forming the west wall of the room you are in.\n"))
+                       (($eq ($prop smilo stond) 1) : ($say
+"You are standing above an empty shallow pit.  There is a small hole in the
+west wall of the room you are in.\n"));
+prm6(SDESC) = (darkq) ($say "Above shallow pit.\n");
+
+prm7(LDESC) = (darkq) ($say
+"You are standing on the loose gravel of a shallow pit.  An exit leads
+south, and above you, there is a small ledge which you can climb up to.\n");
+prm7(SDESC) = (darkq) ($say "In shallow pit.\n");
+
+trogf = (($eq ($prop trogl killd) 0) : 
+       ($say " and there is an angry
+troglodyte here holding a large gold nugget under his arm"))
+       ($say ".\n");
+trgfs = (($eq ($prop trogl killd) 0) :
+       ($say "There is an angry troglodyte holding a gold nugget here.\n"));
+prm8(LDESC) = (darkq) ($say
+"You are standing near the west rim of sheer cliff which drops down into a deep
+almost bottomless abyss. A passage leads north") (trogf);
+prm8(SDESC) = (darkq) ($say "West rim of canyon.\n") (trgfs);
+
+prm9(LDESC) = ($say 
+"You are at the junction of two canyons.  The larger one runs east-west
+and the smaller one runs north.\n");
+prm9(SDESC) = ($say "Canyon junction\n");
+
+prm10(LDESC) = ($say
+"You are standing on a shale slab tilted from west to east at about a 
+forty-five degree angle.  At the east end of the slab, there is a short
+drop into what appears to be a lake.  Above you and to the west, it appears
+that there is some more explorable terrain, and the canyon leads back to
+to the south.  The air is quite warm, and there is a slight scent similar
+to asphalt in the air.\n");
+prm10(SDESC) = ($say "On shale slab.\n");
+
+prm11(LDESC) = ($say 
+"You are standing in the south end of a short canyon running north-south.
+The ground below your feet is littered with flakes of a dark rock, which
+seems to comprise most of the surrounding canyon walls.  There is a path to
+your north, and a steep slope down and to the east.\n");
+prm11(SDESC) = ($say "Canyon full of rubble.\n");
+
+prm12(LDESC) = ($say
+"You are standing in the north end of a short canyon.  The ground is
+covered with a thin film of oil which apppears to be seeping out of
+a crack in the earth.  The only apparent direction you can go is south.\n");
+prm12(SDESC) = ($say "Oily end of canyon.\n");
+
+prm13(LDESC) = ($say "You are standing in what was once a tributary into
+the now-extinct river which formed the large canyon in this area.  There
+is a streambed running to the south, and you can also go east and west.\n");
+prm13(SDESC) = ($say "End of dry river bed.\n");
+
+prm14(LDESC) = ($say
+"You are standing in a narrow north-south canyon with a river bed running 
+down the middle of it.  There is a semicirular shaped hole at the base of
+the eastern wall.\n");
+prm14(SDESC) = ($say "In narrow part of river bed.\n");
+
+prm15(LDESC) = ($say 
+"You are at the base of three water-eroded cliffs to your south, east and 
+west.  It appears that a U-shaped waterfall once flowed into this area, and
+exited out to the north.\n");
+prm15(SDESC) = ($say "Below dried waterfall.\n");
+
+prm16(LDESC) = ($say 
+"You are in a section of the canyon where much of the rock appears to be
+primarily sandstone.  Water has apparently flowed out of a cave to your 
+north into three-foot wide crack in the ground.  A substantial amount of
+rubble blocks your way west, and the rest of the canyon winds east.\n");
+prm16(SDESC) = ($say "Sandstone area.\n");
+
+prm17(LDESC) = (darkq) ($say
+"You are standing in front of the freshly dug gravesite of a Nearderthal
+hunter.  There is an exit to your south, and it seems that more of the 
+cave can be explored to the north.\n")
+(($and ($eq ($prop spear tooky) 1) ($eq ($prop spear abrad) 0)) :
+($say "However, a large amount of rubble blocks that path.\n"));
+prm17(SDESC) = (darkq)($say "Neanderthal's gravesite\n");
+
+prm18(LDESC) = (darkq) ($say
+"You are in a narrow room of a north-south running cave.  A large cairn of
+prehistoric cave bear skulls is piled high in one corner of the room.
+There are exits to the north and south.\n");
+prm18(SDESC) = (darkq) ($say "In front of cave bear cairn.\n");
+
+prm19(LDESC) = (darkq) ($say
+"You are in a large cavern room with a high ceiling.  Cracks in the walls
+lead in all directions but none of them seem to lead anywhere.  There are
+however, two major paths to the north and the south.\n");
+prm19(SDESC) = (darkq) ($say
+"Large Cavern room.\n");
+
+prm20(LDESC) = (darkq) ($say
+"You are in a room which was the site of a recent cave-in.  It appears to
+be futile to go any other direction except south.\n");
+prm20(SDESC) = (darkq) ($say "Cave-in site.\n");
+
+prm21(LDESC) = ($say
+"You are in a crack in the earth which seems to have been formed by an ancient
+earthquake.  Various strata in the rock of different darkness seem to indicate
+that much time has passed since the formation of the rock at the lower end of
+this crack.  It seems that you can chimney up back out of the crack, or climb
+further down into it.\n");
+prm21(SDESC) = ($say "In large crack.\n");
+
+prm22(LDESC) = ($say
+"You are standing on a narrow ledge about twenty-five feet above the ground.
+Aside from going back up, the only other direction you can go is to step off 
+the ledge to the west into the mouth of the large Tyranosaurus Rex waiting to
+swallow you whole.\n");
+prm22(SDESC) = ($say
+"On ledge in front of Tyranosaurus Rex.\n");
+
+prm23(LDESC) = ($say
+"You are standing inside the mouth of a Tyranosaurus Rex, whose jaws are
+being held open by a spear wedged length-wise in his mouth.  Various pieces
+of former adventurers can be found among the six-inch long teeth here.
+You can step back out of the Tyranosaur onto the small ledge, or go
+further down into the Tyranosaur and get digested.\n");
+prm23(SDESC) = ($say "Inside mouth of Tyranosaur.\n");
+
+{*** FUNNY TRANSITION ROUTINES ***}
+
+exitg = ($say "Oh dear, you seem to have gotten yourself killed.\n")
+(skore)
+(ratng)
+(ratnx)
+(($eq ($prop .ME debug) 0) : ($spec 3 0 0 0 0));
+
+em3 = (($eq ($prop paper signed) 0):(cg) ($exit 0))
+      ($move .ME irm1);
+
+ei8 = (($eq ($loc spices) .ME) : ($say
+"The savory blend of spices and human wakes up the sleeping crocodiles who
+decide to have you for breakfast.
+") (exitg))
+      (($eq ($loc rupees) .ME) : ($say
+"The weight of the coins pulls you underwater and you eventually drown.
+") (exitg))
+      ($say "You manage to get across the river, just as the crocodiles
+begin to stir.
+")($move .ME irm9);
+
+wi12 = (($eq ($prop statue tlakst) 0) : (cg) ($exit 0))
+       ($move .ME irm14);
+
+ui16 = (($eq ($prop rope ropstf) 0) : (cg) ($exit 0))
+       ($say "You scramble up the rope and get to the ledge.
+") ($move .ME irm17);
+
+ui17 = ($say "Are you a rock climber? \n")
+       (($eq ($yorn) 0) : ($say "Then you better not try it.\n")
+               ($exit 0))
+       ($say "That climb is rated 5.11. Do you still want to try it?\n")
+       (($eq ($yorn) 0) : ($say "Wise move.\n") ($exit 0))
+       ($say "Half way up, you fall off a 1/32 inch wide ledge and
+plummet to your death.\n") (exitg);
+
+di19 = ($say "You magically get transported to the corner of Westwood and
+Broxton, where you are doomed to spend the rest of eternity surrounded by
+chanting Hare-Krishnas. (That'll teach you not to believe legends.)\n")
+       ($spec 3 0 0 0 0);
+
+ei20 = (($eq ($prop monkey fedmky) 0):(cg)($exit 0))
+       ($move .ME irm21);
+
+wi21 = (($eq ($loc peel) irm20) : ($say
+"As you leave the temple, you slip on a banana peel and break your neck.\n")
+       (exitg)) ($move .ME irm20);
+
+di22 = (($eq ($loc cobra) irm22) : ($say
+"The cobra takes a bite at your unprotected leg and injects an
+unhealthy dose of neurotoxin.  You start to lose your senses, your 
+cognitive abilities, an yer rekcogiskdfsdk.\n")
+(exitg))($move .ME irm23);
+
+sm5 = (($eq ($prop paper signed) 0) :
+       ($say "You bumped into the grate.\n")
+       ($exit 0))
+       ($move .ME prm1);
+
+dp2 = (($eq ($prop rope rtied) 0) :
+       ($say "It is too dangerous to climb down without a rope.\n")
+       ($exit 0))
+       (($and ($eq ($loc lamp) .ME) ($eq ($prop lamp onoff) 1)) :
+       ($say "Half-way down the rope, the carbide lamp burns through the
+rope above you and you plummet to your death.\n" )
+       (exitg))
+       ($say "You climb down the rope without any problems.\n")
+       ($move .ME prm3);
+
+ep5 = (($eq ($loc spear) .ME) :
+       ($say "You can't fit the spear you are carrying through that crack.\n")
+       ($exit 1))
+       ($move .ME prm6);
+
+ep8 = ($say "You fall off the cliff and plummet several hundred feet to your
+death.\n") (exitg);
+
+dp6 = (($eq ($prop smilo stond) 0) :
+       ($say "As soon as you reach the bottom of the pit, the sabre-tooth
+tiger tears you to shreads.\n") (exitg))
+       ($move .ME prm7);
+
+ep10 = ($say "You fall into the lake, which actually turns out to be a
+tar-pit covered with a thin layer of rain water.  You eventually sink and
+get fossilized.\n") (exitg);
+
+ep11 = (($eq ($prop feet wiped) 0) :
+       ($move .ME prm10) ($exit 1))
+       ($say "As you walk down the slab, your feet slip and you tumble
+off the slab.\n")(ep10);
+
+sp12 = ($say "You find your feet to be quite slippery as you walk.\n")
+       ($setp feet wiped 1)
+       ($move .ME prm11);
+
+sp14 = (($eq ($prop mammoth blokd) 0) :
+       ($say "The mammoth keeps you from going that way.\n")
+       ($exit 1))
+       ($move .ME prm15);
+
+np17 = (($and ($eq ($prop spear tooky) 1) ($eq ($prop spear abrad) 0)) :
+       ($say
+"The rubble keeps you from going in that direction.\n")($exit 1))
+       ($move .ME prm18);
+
+np19 = (($eq ($prop bear hitbr) 0) :
+       ($say "The bear keeps you from going that direction.\n")
+       ($exit 1))
+       ($move .ME prm20);
+
+wp22 = (($eq ($loc spear) .ME) :
+       ($say "The spear that you were carrying lodges in the tyranosaur's
+mouth.\n") ($move spear prm23)($move .ME prm23))
+       (($eq ($loc spear) prm23) :
+       ($move .ME prm23))
+       (($and ($ne ($loc spear) .ME) ($ne ($loc spear) prm23)) :
+       ($say "The tyranosaur crushes you in his jaw and then swallows you.\n")
+       (exitg));
+
+dp23 = ($say "You slide down the gullet of the tyranosaur and get 
+digested alive.\n") (exitg);
+
+dm6 = ($say "After wandering around in the forest for a while, you eventually
+find your way out.\n")($move .ME mrm1);
+
+darkq = (($or ($and ($ne ($loc .ME) ($loc lamp)) ($ne ($loc lamp) .ME))
+       ($eq ($prop lamp onoff) 0 )) :
+       ($say "It's too dark to see anything in here.\n")
+       ($exit 1));
+
+darkt = (($or ($and ($ne ($loc .ME) ($loc lamp)) ($ne ($loc lamp) .ME))
+       ($eq ($prop lamp onoff) 0)) :
+       (($pct 50) : ($say
+"While stumbling around in the darkness, you trip and impale yourself on a 
+stalagmite.\n")(exitg)));  
+
+onlmp = (($ne ($loc lamp) .ME) :
+       ($say "You don't have the lamp with you.\n")
+       ($exit 1))
+       (($eq ($prop lamp onoff) 0) :
+       ($say "A blue flame now flickers out of the lantern.\n")
+       ($setp lamp onoff 1)
+                 ($exit 1));
+
+{*** TRANSITIONS ***}
+
+mrm1(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME mrm6 mrm2 mrm6 mrm6 0 0 mrm2 0 0 0)
+               ($miss 0 0 0 0 cg cg 0 dumdir 0 0);
+
+mrm2(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME mrm1 mrm4 mrm3 mrm4 0 mrm5 0 0 0 0)
+               ($miss 0 0 0 0 cg 0 dumdir dumdir 0 0);
+
+mrm3(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 mrm2 0 0 0 0 0 0)
+               ($miss cg cg em3 0 cg cg dumdir dumdir 0 0);
+
+mrm4(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME mrm2 0 0 0 0 0 0 mrm2 0 0)
+               ($miss 0 cg cg cg cg cg cg 0 0 0);
+
+mrm5(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 mrm2 0 0 0 0 0)
+               ($miss cg sm5 cg cg 0 cg dumdir dumdir 0 0);
+
+mrm6(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 0 0 0 0 0 0)
+               ($miss dm6 dm6 dm6 dm6 cg cg dumdir dm6 0 0);
+
+irm1(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 mrm3 0 irm2 0 0 0 0)
+               ($miss cg cg cg 0 cg 0 dumdir dumdir 0 0);
+
+irm2(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 irm10 irm3 irm1 0 0 0 0 0)
+               ($miss cg cg 0 0 0 cg dumdir dumdir 0 0);
+
+irm3(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm4 0 irm2 0 0 0 0 0  0 0)
+               ($miss 0 cg 0 cg cg cg dumdir dumdir 0 0);
+
+irm4(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm3 0 0 0 irm5 0 irm3 0 0)
+               ($miss cg 0 cg cg cg 0 dumdir 0 0 0);
+
+irm5(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm6 irm7 irm8 0 0 0 0 0 0 0)
+               ($miss 0 0 0 cg tohigh cg dumdir dumdir 0 0);
+
+irm6(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm5 0 irm7 0 0 0 0 0 0)
+               ($miss tosml 0 cg 0 cg cg dumdir dumdir 0 0);
+
+irm7(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm5 0 irm6 0 0 0 0 0 0 0)
+               ($miss 0 cg 0 cg cg cg dumdir dumdir 0 0);
+
+irm8(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 irm5 0 0 0 irm5 0 0)
+               ($miss cg cg ei8 0 cg cg dumdir 0 0 0);
+
+irm9(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 irm8 irm10 0 0 irm10 0 0)
+               ($miss cg cg cg 0 0 cg dumdir 0 0 0);
+
+irm10(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm11 irm22 irm2 0 irm9 0 0 0 0)
+               ($miss cg 0 0 0 cg 0 dumdir dumdir 0 0);
+
+irm11(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm10 irm12 0 irm13 0 0 0 0 0 0)
+               ($miss 0 0 cg 0 cg cg cg cg 0 0);
+
+irm12(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm11 0 irm15 0 0 0 0 0 0 0)
+               ($miss 0 cg 0 wi12 cg cg dumdir dumdir 0 0);
+
+irm13(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm15 irm11 0 0 0 0 0 0 0)
+               ($miss cg 0 0 cg cg cg dumdir dumdir 0 0);
+
+irm14(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 irm12 0 0 0 0 irm12 0 0)
+               ($miss cg cg 0 cg cg cg dumdir 0 0 0);
+
+irm15(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm13 0 irm16 irm12 0 0 0 0 0 0)
+               ($miss 0 cg 0 0 cg cg dumdir dumdir 0 0);
+
+irm16(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm22 0 irm18 irm15 0 0 0 0 0 0)
+               ($miss 0 cg 0 0 ui16 cg dumdir dumdir 0 0);
+
+irm17(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 0 irm16 0 0 0 0)
+               ($miss cg cg cg cg ui17 0 dumdir dumdir 0 0);
+
+irm18(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm19 irm20 irm16 0 0 0 0 0 0)
+               ($miss cg 0 0 0 cg cg dumdir dumdir 0 0);
+
+irm19(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME irm18 0 0 0 0 0 0 irm18 0 0)
+               ($miss 0 cg cg tosml cg di19 dumdir 0 0 0);
+
+irm20(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 irm18 0 0 0 0 0 0)
+               ($miss cg cg ei20 0 cg cg dumdir dumdir 0 0);
+
+irm21(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 0 0 0 0 0 0)
+               ($miss cg cg cg wi21 cg cg dumdir wi21 0 0);
+
+irm22(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 irm16 0 irm10 0 0 0 0 0 0)
+               ($miss cg 0 cg 0 cg di22 di22 cg 0 0);
+
+irm23(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 irm22 0 0 irm22 0 0)
+               ($miss cg cg cg cg 0 cg dumdir 0 0 0);
+
+prm1(ACTION) = (darkt)
+       ($setv n s e w u d in out 0 0)
+       ($hit .ME mrm5 prm2 0 0 0 0 0 0 0 0)
+       ($miss 0 0 cg cg cg cg dumdir dumdir 0 0);
+
+prm2(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm1 0 0 0 0 0 0 0 0 0)
+               ($miss 0 cg cg cg cg dp2 dumdir dumdir 0 0);
+
+prm3(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 prm4 prm2 0 0 0 0 0)
+               ($miss cg cg cg 0 0 cg dumdir dumdir 0 0);
+
+prm4(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm5 prm3 prm9 0 0 prm5 0 0 0)
+               ($miss cg 0 0 0 cg cg 0 dumdir 0 0);
+
+prm5(ACTION) = (darkt) ($setv n s e w u d in out 0 0)
+               ($hit .ME prm4 0 0 0 0 0 0 prm4 0 0)
+               ($miss 0 cg ep5 cg cg cg dumdir 0 0 0);
+
+prm6(ACTION) = (darkt) ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 prm5 0 0 0 0 0 0)
+               ($miss cg cg cg 0 cg dp6 dumdir dumdir 0 0);
+
+prm7(ACTION) = (darkt) ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm8 0 0 prm6 0 0 0 0 0)
+               ($miss cg 0 cg cg 0 cg dumdir dumdir 0 0);
+
+prm8(ACTION) = (darkt) ($setv n s e w u d in out 0 0)
+               ($hit .ME prm7 0 0 0 0 0 0 0 0 0)
+               ($miss 0 cg ep8 cg cg cg dumdir dumdir 0 0);
+
+prm9(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm10 0 prm4 prm13 0 0 0 0 0 0)
+               ($miss 0 cg 0 0 cg cg dumdir dumdir 0 0);
+
+prm10(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm9 0 prm11 prm11 0 0 0 0 0)
+               ($miss cg 0 ep10 0 0 cg dumdir dumdir 0 0);
+
+prm11(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm12 0 0 0 0 0 0 0 0 0)
+               ($miss 0 cg ep11 cg cg ep11 dumdir dumdir 0 0);
+
+prm12(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 0 0 0 0 0 0)
+               ($miss cg  sp12 cg cg cg cg dumdir dumdir 0 0);
+
+prm13(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm14 prm9 prm16 0 0 0 0 0 0)
+               ($miss cg 0 0 0 cg cg dumdir dumdir 0 0);
+
+prm14(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm13 0 0 0 0 0 0 0 0 0)
+               ($miss 0 sp14 tosml cg cg cg dumdir dumdir 0 0);
+
+prm15(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm14 0 0 0 0 0 0 0 0 0)
+               ($miss 0 cg cg cg cg cg dumdir dumdir 0 0);
+
+prm16(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm17 0 prm13 0 0 prm21 0 0 0 0)
+               ($miss 0 cg 0 cg cg 0 dumdir dumdir 0 0);
+
+prm17(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm16 0 0 0 0 0 0 0 0)
+               ($miss np17 0 cg cg cg cg dumdir dumdir 0 0);
+
+prm18(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME prm19 prm17 0 0 0 0 0 0 0 0)
+               ($miss 0 0 cg cg cg cg dumdir dumdir 0 0);
+
+prm19(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm18 0 0 0 0 0 0 0 0)
+               ($miss np19 0 cg cg cg cg dumdir dumdir 0 0);
+
+prm20(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 prm19 0 0 0 0 0 prm19 0 0)
+               ($miss cg 0 cg cg cg cg dumdir 0 0 0);
+
+prm21(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 prm16 prm22 0 0 0 0)
+               ($miss cg cg cg cg 0 0 dumdir dumdir 0 0);
+
+prm22(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 0 0 prm21 0 0 0 0 0)
+               ($miss cg cg cg wp22 0 cg dumdir dumdir 0 0);
+
+prm23(ACTION) = ($setv n s e w u d in out 0 0)
+               ($hit .ME 0 0 prm22 0 0 0 0 prm22 0 0)
+               ($miss cg cg 0 cg cg dp23 dumdir 0 0 0);
+
+{*** CHEAT ROUTINES ***}
+
+chetr = (($eq ($prop .ME debug) 0) : ($exit 1));
+VERB BEAM;
+BEAM(ACTION) = (chetr) ($move .ME ($dobj))(LLOOK);
+VERB TRACTOR;
+TRACTOR(ACTION) = (chetr) ($move ($dobj) ($loc .ME))
+               ($say "The ")(($sdisc ($dobj)))($say
+" magically appears.\n");
+VERB DRIBBLE;
+DRIBBLE(ACTION) = (chetr) (ctake) (cdrop);
diff --git a/usr/src/games/ddl/doc/READ-ME b/usr/src/games/ddl/doc/READ-ME
new file mode 100644 (file)
index 0000000..66053cc
--- /dev/null
@@ -0,0 +1,17 @@
+
+This directory contains the following documentation files.
+
+doc.ms         Nroff -ms document describing DDL syntax
+builtins.ms    Nroff -ms document describing builtin routines
+       Use "tbl doc.ms builtins.ms|troff -ms" to typeset the manual.
+
+ddlcomp.6      Manual page for the DDL compiler
+ddlrun.6       Manual page for the DDL interpreter (runtime package)
+
+tiny.ddl       A minimal-size (nearly) ddl sample.
+demo.sc                Output from tiny.ddl
+
+wishlist       Plans for changes to DDL, including changes which
+               have been made to DDL since April '80 (which is
+               the date of the document most people have seen
+               as well as being the version that UCB distributes.
diff --git a/usr/src/games/ddl/doc/builtins.ms b/usr/src/games/ddl/doc/builtins.ms
new file mode 100644 (file)
index 0000000..6b90c66
--- /dev/null
@@ -0,0 +1,205 @@
+.NH
+Built-in Functions
+.PP
+The following functions are built-in functions available to the 
+\s-2DDL\s+2
+programmer.  These functions are the heart of the 
+\s-2DDL\s+2 
+system and are
+the means whereby the 
+\s-2DDL\s+2 
+routines manipulate all system data.  Thus,
+these functions completely describe the facilities of the 
+\s-2DDL\s+2 
+system.
+.NH 2
+Functions on objects
+.IP "\fB$loc    \fR" 8
+($loc \fIobj\fR) \(-> The container of \fIobj\fR.
+.IP "\fB$cont   \fR" 8
+($cont \fIobj\fR) \(-> First item contained in \fIobj\fR.
+.IP "\fB$link   \fR" 8
+($link \fIobj\fR) \(-> The next object in the same node as \fIobj\fR.
+.IP "\fB$ldisc  \fR" 8
+($ldisc \fIobj\fR) \(-> The routine ID for the long description of \fIobj\fR.
+.IP "\fB$sdisc  \fR" 8
+($sdisc \fIobj\fR) \(-> The routine ID for the short description of \fIobj\fR.
+.IP "\fB$rtn    \fR" 8
+($rtn \fIobj\fR) \(-> The ACTION routine for \fIobj\fR.
+.IP "\fB$prop   \fR" 8
+($prop \fIobj\fR \fIpropnum\fR) \(-> returns the value of the \fIpropnum\fR'th property
+of \fIobj\fR.
+.NH 2
+Arithmetic Funcions
+.IP "\fB$plus   \fR" 8
+($plus \fIarg1\fR \fIarg2\fR) \(-> \fIarg1\fR+\fIarg2\fR
+.IP "\fB$minus  \fR" 8
+($minus \fIarg1\fR \fIarg2\fR) \(-> \fIarg1\fR-\fIarg2\fR
+.IP "\fB$times  \fR" 8
+($times \fIarg1\fR \fIarg2\fR) \(-> \fIarg1\fR*\fIarg2\fR
+.IP "\fB$quotient \fR" 8
+($quotient \fInum den\fR) \(-> [\fInum\fR/\fIden\fR]
+.IP "\fB$remainder \fR" 8
+($remainder \fInum den\fR) \(-> \fInum\fB mod \fIden\fR
+.IP "\fB$rand \fR" 8
+($rand \fIarg\fR) \(-> Random integer between 1 and \fIarg\fR inclusive
+.NH 2
+Boolean Functions
+.IP "\fB$and    \fR" 8
+($and \fIa b\fR) \(-> \fIa\fB (bitwise AND) \fIb\fR
+.IP "\fB$or     \fR" 8
+($or \fIa b\fR) \(-> \fIa\fB (bitwise OR) \fIb\fR
+.IP "\fB$not    \fR" 8
+($not \fIx\fR) \(->  \s-2IF\s+2 \fIx\fR nonzero \s-2THEN\s+2 zero \s-2ELSE\s+2 one.
+.IP "\fB$yorn   \fR" 8
+($yorn) \(-> Waits for the Player to type a line of input.  Returns
+one if the Player types "yes" or "y" and zero otherwise.
+.IP "\fB$pct    \fR" 8
+($pct \fIprob\fR) \(-> Returns one, \fIprob\fR% of the time, zero otherwise.
+.IP "\fB$eq     \fR" 8
+($eq \fIarg1\fR \fIarg2\fR) \(-> 1 if \fIarg1\fR equals \fIarg2\fR, zero otherwise.
+.IP "\fB$ne     \fR" 8
+($ne \fIarg1\fR \fIarg2\fR) \(-> IF \fIarg1\fR ~= \fIarg2\fR THEN  one  ELSE  zero.
+.IP "\fB$lt     \fR" 8
+($lt \fIarg1\fR \fIarg2\fR) \(-> 1 if \fIarg1\fR < \fIarg2\fR, zero otherwise.
+.IP "\fB$gt     \fR" 8
+($gt \fIarg1\fR \fIarg2\fR) \(-> 1 if \fIarg1\fR > \fIarg2\fR, zero otherwise.
+.IP "\fB$le     \fR" 8
+($le \fIarg1\fR \fIarg2\fR) \(-> 1 if \fIarg1\fR <= \fIarg2\fR, zero otherwise.
+.IP "\fB$ge     \fR" 8
+($ge \fIarg1\fR \fIarg2\fR) \(-> 1 if \fIarg1\fR >= \fIarg2\fR, zero otherwise.
+.NH 2
+Builtin Procedures (no return value)
+.IP "\fB$setg    \fR" 8
+($setg \fIglobalnumber value\fR) \(-> No return value.  Sets the
+contents of global #\fIglobalnumber\fR to \fIvalue\fR.
+.IP "\fB$setp   \fR" 8
+($setp \fIobj propnum value\fR) \(-> No return value.  Sets the \fIpropnum\fR'th
+property of \fIobj\fR to \fIvalue\fR.  Note that properties 1-16 may only contain 0 or 1.
+.IP "\fB$move   \fR" 8
+($move \fIobj dest\fR) \(-> No return value.  Causes \fIobj\fR to be placed
+inside \fIdest\fR, and adjusts pointers accordingly.  \fBDanger\fR: No checking is
+performed to verify that $move is not being used to violate the tree structure
+of the object list (eg ($move obj obj)).
+Bad results are likely if this occurs.
+.IP "\fB$say    \fR" 8
+($say \fImsg\fR) \(-> No return value.  Types \fImsg\fR.
+.IP "\fB$name   \fR" 8
+($name \fIobj\fR) \(-> No return value.  Types the (5-letter) name of \fIobj\fR.
+.IP "\fB$num    \fR" 8
+($num \fIx\fR) \(-> No return value.  Types the number \fIx\fR.
+.IP "\fB$exit   \fR" 8
+($exit \fIn\fR) \(-> Leave present routine.  ($exit 1) causes the current
+"turn" to be prematurely terminated and the next turn to be initiated
+at the Demon phase.  ($exit 0) returns to the driver to begin the next phase.
+.IP "\fB$rtrn   \fR" 8
+($rtrn \fIn\fR) \(-> Exits to the calling routine, returning value '\fIn\fR' TO
+THE CALLING FUNCTION.
+.IP "\fB$spec   \fR" 8
+($spec \fIcode arg1 arg2 arg3 arg4\fR) \(-> Performs a special function as
+follows:
+.TS
+center box;
+c | c.
+code   function
+=
+3      Terminate this run of DDL
+_
+4      Save a game
+_
+5      Restore a game
+_
+7      Preserve unknown words in file \fIarg1\fR
+.TE
+.PP
+Functions 4 and 5 prompt for a file name in which the saved game is
+kept.  Function 7 causes any unknown words encountered by the parser
+to be preserved in a file for later perusal by the 
+\s-2DDL\s+2 
+programmer.  It
+would be used to learn about things players have tried unsuccessfully
+that should be dealt with.  The file must already exist, and must
+be specified as a string.
+.PP
+ALL arguments must be specified, even if zero.
+.NH 2
+Global-value functions
+.IP "\fB$glob   \fR" 8
+($glob \fIn\fR) \(-> Value of global \fIn\fR.  Equivalent to @\fIn\fR.
+.IP "\fB$verb   \fR" 8
+($verb) \(-> The ID of the verb returned by the parser (zero if none).
+Typically used in comparisons, it is equivalent to @Verb.
+.IP "\fB$dobj   \fR" 8
+($dobj) \(-> The ID of the direct object returned by the parser
+(zero if none).  Equivalent to @Dobj.
+.IP "\fB$iobj   \fR" 8
+($dobj) \(-> The ID of the indirect object returned by the parser
+(zero if none).  Equivalent to @Iobj.
+.NH 2
+Transition Procedures
+.IP "\fB$setv   \fR" 8
+($setv \fIv1 v2 v3 v4 v5 v6 v7 v8 v9 v10\fR) \(-> sets the values in
+the internal vector VECVERB to the values \fIv1\fR thru \fIv10\fR.  These are
+used by routines $hit and $miss.
+.IP "\fB$hit    \fR" 8
+($hit \fImover d1 d2 d3 d4 d5 d6 d7 d8 d9 d10\fR) \(-> No return value.
+Compares ($verb) with the values in builtin vector VECVERB.  When ($verb)
+is found to match the nth entry in VECVERB, ($move \fImover d[n]\fR) is executed.
+Note that \fImover\fR is what gets moved to d[n]; this argument is naturally
+absent from $setv and $miss.
+.IP "\fB$miss   \fR" 8
+($miss \fIr1 r2 r3 r4 r5 r6 r7 r8 r9 r10\fR) \(-> no return value.
+Compares ($verb) to VECVERB as $hit does.  When a match to the nth
+entry in VECVERB is found, routine \fIr\fR[n] is called.  An attempt to
+call routine 0 does nothing.
+.NH 2
+String Functions
+.PP
+There are two varieties of strings.  Constant strings defined
+by the DDL programmer are permanent, and have a numeric "value"
+greater than zero (which is in fact a table index).  Strings
+typed by the Player as a direct object, and strings produced
+by the functions $eqst and $read are temporary, have a numeric
+"value" less than zero (which allows the programmer to determine
+if the direct object is in fact a string), and are purged by
+having their index values recycled at the beginning of every turn.
+No more than 200 such strings may be generated on a given turn.
+.IP "\fB$eqst\fR" 8
+($eqst \fIarg1 arg2\fR) \)-> 1 iff the strings specified by the
+two \fIarg\fRs are equal, zero otherwise.
+.IP "\fB$subs\fR" 8
+($subs \fIstr index length\fR) \)-> a string consisting of the
+substring of \fIstr\fR, starting at character \fIindex\fR 
+(with an origin of Zero for the beginning of the string), for
+the specified \fIlength\fR.  A \fIlength\fR of zero causes
+all the remaining characters starting at \fIindex\fR to be
+taken.
+.IP "\fB$leng\fR" 8
+($leng \fIstr\fR) \)-> The length of string \fIstr\fR.
+.IP "\fB$read\fR" 8
+($read) \)-> Causes \s-2DDL\s+2 to pause and wait for input from
+the Player.  Returns the string the player typed, without the
+trailing newline.
+.NH 2
+Demons and Fuses
+.IP "\fB$sdem   \fR" 8
+($sdem n) \(-> Activates routine n as a Demon, to be executed every
+turn.  At least one such Demon should exist, to Look at the Player's
+current location, and to increment the turn counter
+.IP "\fB$ddem   \fR" 8
+($ddem n) \(-> Removes routine n from the active Demon list.  For
+example, ($ddem Kount) undoes the action of ($sdem Kount).
+.IP "\fB$sfus   \fR" 8
+($sfus rout n) \(-> Causes routine "rout" to be executed (one
+time only) after n turns.  Such a routine is called a Fuse.
+.IP "\fB$dfus   \fR" 8
+($dfus rout) \(-> Causes routine rout to be taken off the
+pending fuse list.
+.IP "\fB$itun   \fR" 8
+($itun) \(-> Increments the turn counter.  This is a builtin function
+because fuses depend upon the turn counter.  The 
+\s-2DDL\s+2 
+programmer has the
+option to "slow time" by refraining from incrementing the turn counter.
+.IP "\fB$gtun   \fR" 8
+($gtun) \(-> Returns the current turn counter value.
diff --git a/usr/src/games/ddl/doc/ddlcomp.6 b/usr/src/games/ddl/doc/ddlcomp.6
new file mode 100644 (file)
index 0000000..7ac09b7
--- /dev/null
@@ -0,0 +1,22 @@
+.TH DDLCOMP 6 UCLA 
+.SH NAME
+ddlcomp  \-  compile a DDL program
+.SH SYNOPSIS
+.B /usr/games/ddlcomp
+outfile
+.SH DESCRIPTION
+.I Ddlcomp
+reads a \s-2DDL\s+2 program from the standard input
+and produces an output file,
+.I outfile,
+which contains the tables and interpretive code necessary
+to play, using 
+.I ddlrun(6),
+the game described by the program.  Error messages
+and data summary are produced on standard output.
+.br
+.SH "SEE ALSO"
+ddlrun(6)
+.br
+Adler, Kostanick, Stein and Urban:
+.I "A Brief Introduction to UCLA Dungeon Definition Language"
diff --git a/usr/src/games/ddl/doc/ddlrun.6 b/usr/src/games/ddl/doc/ddlrun.6
new file mode 100644 (file)
index 0000000..f0c83b7
--- /dev/null
@@ -0,0 +1,28 @@
+.TH DDLRUN 6 UCLA 
+.SH NAME
+ddlrun  \-  run a DDL game
+.SH SYNOPSIS
+.B /usr/games/ddlrun
+infile
+.SH DESCRIPTION
+.I Ddlrun
+reads a datafile,
+.I infile,
+which contains tables and routines necessary to play 
+a generalized \fIAdventure(6)\fR-like game.  If the
+input file does not exist, the directory /usr/games/ddllib
+is searched.  The game is terminated either by a quit
+command recognized by the \s-2DDL\s+2 program, or by
+an interrupt.  
+.br
+.SH "EXAMPLE"
+.B "ddlrun aard"
+.br
+.SH "FILES"
+/usr/games/ddllib/*
+.br
+.SH "SEE ALSO"
+ddlcomp(6)
+.br
+Adler, Kostanick, Stein and Urban:
+.I "A Brief Introduction to UCLA Dungeon Definition Language"
diff --git a/usr/src/games/ddl/doc/demo.sc b/usr/src/games/ddl/doc/demo.sc
new file mode 100644 (file)
index 0000000..5163db3
--- /dev/null
@@ -0,0 +1,52 @@
+You are in a small but comfortable room.  You hardly want
+to leave, but there is a door leading east, if you insist.
+There is a blue pillow here.
+There is a red pillow here.
+
+> e
+
+You are in a brightly lit room.  The walls sparkle with
+scintillating lights.  There is a darker room to the west.
+There is a bar of platinum here!
+
+> w
+
+Comfortable room.
+There is a blue pillow here.
+There is a red pillow here.
+
+> take pillow
+You'll have to be more specific.
+
+Comfortable room.
+There is a blue pillow here.
+There is a red pillow here.
+
+> take red pillow
+Taken.
+
+Comfortable room.
+There is a blue pillow here.
+
+> e
+
+Bright room.
+There is a bar of platinum here!
+
+> drop pillow
+Dropped.
+
+Bright room.
+There is a red pillow here.
+There is a bar of platinum here!
+
+> take bar
+Taken.
+
+Bright room.
+There is a red pillow here.
+
+> drop bar
+The bar falls onto the red pillow, breaking it!  The symbolism
+impresses itself upon you, and you go back to work instead of
+playing these silly games!
diff --git a/usr/src/games/ddl/doc/doc.ms b/usr/src/games/ddl/doc/doc.ms
new file mode 100644 (file)
index 0000000..6892456
--- /dev/null
@@ -0,0 +1,584 @@
+.RS
+.ds CF "\(co 1981 UCLA Computer Club
+.TL
+A Brief Description of UCLA
+Dungeon Definition Language (DDL)
+.AU
+Bruce Adler
+Chris Kostanick
+Michael Stein
+Michael Urban
+.AI
+University of California
+Los Angeles, CA 90024
+.AB
+This document describes Dungeon Definition Language, a meta-adventure
+specification language.  It is designed primarily for the programmer
+who wishes to create a 
+\s-2DDL\s+2 
+"world", and secondarily for the programmer
+attempting to implement 
+\s-2DDL\s+2 
+on a new host machine.  
+.AE
+.bp 1
+.ds CF "\(co 1981 UCLA Computer Club
+.NH 
+Introduction.
+.PP
+\s-2DDL\s+2
+is a system of notation for the specification of "worlds".  Using
+\s-2DDL\s+2,
+a programmer may create Objects, Verbs to act upon those objects,
+and Routines to describe the behavior of Objects and Verbs.  The user
+of a 
+\s-2DDL\s+2
+program, known as the Player, types these verbs and the names of
+objects to manipulate those objects at a high level.  Thus, a Player's
+dialogue with a 
+\s-2DDL\s+2
+program will appear something like:
+.IP
+.DS
+.SM
+
+  You are standing outside the north entrance of a large
+  brick building.  Inscribed above the doorway, appear the
+  text: 'AARDVARK'S MUSEUM -- GATEWAY TO ADVENTURELAND'.
+  There is a coil of rope here.
+  There is a shovel here.
+  There is a carbide-flame lamp here.
+  There is a copy of a newspaper here.
+ >take rope
+  OK
+ >south
+  You are in a large rotunda of an old museum.  Doors lead
+  to the north, south, east, and west, and a narrow stairway
+  in the north-east corner of the room leads down.
+  There is a ball-point pen here.
+  There is a slip of paper here.
+ >take paper
+  OK
+ >take pen
+  OK
+ >e
+  You are in a dimly lit room containing an empty display case.
+  A portion of a vandalized sign above the case reads:
+  'ARTIFACTS OF ANCIENT INDIA -- Several of these items,
+  including the sacred rhinoceros horn, the deadly ...'.
+  The rest of the sign is unreadable.
+  To the west, you can look through a large door into the rotunda
+  of the museum. On the east wall of the hall there is an outline
+  of an arch.
+ >sign paper
+  In a blinding flash of light, a stone archway appears in the east wall!
+.NL
+.DE
+.PP
+This sort of behavior will be familiar to users of the celebrated programs,
+.I "Adventure" 
+and 
+.I "Dungeon" 
+(AKA 
+.I "Zork"
+), of Crowther, Woods, Anderson
+and Blank.
+While not as sophisticated in many ways as some of these programs,
+the primary function of 
+\s-2DDL\s+2 
+is to allow a number of interesting
+puzzles and games to be exchanged among users of disparate machines
+with a minimum of portability problem.
+.NH
+General Flow of Execution.
+.PP
+When the 
+\s-2DDL\s+2
+program begins execution, a special routine which has been
+coded by the 
+\s-2DDL\s+2
+programmer is executed.  This routine must be given the
+name START.  START will normally initialize demons and set certain initial
+values.  Execution then proceeds in the cyclic fashion described below.
+.PP
+When a 
+\s-2DDL\s+2
+scenario is running,
+execution proceeds in a series of cycles known as "turns".  On
+each turn, a number of actions takes place.
+.IP "(1) Demons: " 10
+Each of the Demon routines currently active is run in order
+of activation.
+Demon routines are specified and activated by the 
+\s-2DDL\s+2
+program by executing
+the $sdem function.
+.B Note: 
+The normal action of Looking (executing description routines) which
+one expects to occur on each turn must be coded by the 
+\s-2DDL\s+2
+programmer
+as a Demon.
+.IP "(2) Fuses: " 10
+All active Fuse routines are checked to see if they
+are to be executed on this turn.  Those Fuses which have thus "burned down"
+are then executed (in reverse order of activation) and removed.
+.IP "(3) Parse: " 10
+The player types a line of input,
+and an attempt is made to resolve that input into a Verb, an Indirect Object,
+and a Direct Object, by means of attendant Prepositions, Articles,
+and Adjectives.  Unambiguous abbreviations for words are recognized
+by the parser.
+If an input Noun is ambiguous (because of two objects distinguished by only
+adjectives), 
+\s-2DDL\s+2
+routines called DWIMD and DWIMI are used to disambiguate
+direct and indirect objects respectively.  DWIMD and DWIMI each return
+nonzero if the direct or indirect object is "possibly the one he means"
+(e.g. if it is in the room, etc)); only if exactly one such object
+exists with the given Noun name can the parse complete successfuly.
+any of the input components are found to be missing, the value zero is
+assumed for that object (and no associated routines are executed).
+.PP
+If a syntax error or unknown word is detected, a hopefully informative
+error message is printed.  In addition, unknown words encountered
+in the input
+may be saved in a file for perusal by the DDL programmer.
+.PP
+The direct object may be enclosed in double-quotes by the Player.
+Such a direct object is returned as a String to the program.  Strings
+may be detected by the program as having "numeric values" less than
+zero.  Strings may be operated on with the $eqst, $subs, and $leng
+functions, and the $say procedure.
+.IP "(4) Pre-action: " 10
+The PREACT routine (if any)
+that the 
+\s-2DDL\s+2
+programmer has associated
+with the input Verb is executed.  These routines typically will check
+for the availability of the object in question, and so on.
+.IP "(5) Indirect Object: " 10
+The ACTION routine associated with the Indirect Object
+that the Player typed (if any) is executed.
+.IP "(6) Direct Object: " 10
+The ACTION routine associated with the Direct Object
+that the Player typed (if any) is executed.
+For most specialized actions (like "rub lamp") the particular code
+is frequently attached to the object.
+If the Direct Object is a String, the ACTION routine (if any)
+associated with the object STRING (if such is defined by the
+programmer) is executed.
+.IP "(7) Room Action: " 10
+The ACTION routine associated with the room the Player is
+in (actually, the LOC of .ME) is executed.  Normally, this will be
+a "transition" routine which will check if the verb is "north", and so on.
+.B Note:
+This is the ONLY aspect of "built-in" action which depends in ANY
+WAY upon the actual state of variables within the "dungeon" itself.
+.IP "(8)  Verb: " 10
+The ACTION routine associated with the input Verb (if any)
+is executed.  ACTION routines for most Verbs will often be
+default routines.  For example the Action routine for the Verb "rub"
+might print "Rubbing that object is not useful."
+.LP
+If any of these routines terminates with an ($exit 1), the remainder of
+the current turn is skipped.  Furthermore, the 
+\s-2DDL\s+2
+programmer is responsible
+for incrementing the Turn Counter (normally in a Demon routine) if Fuses
+are to be used.
+.NH
+Data types.
+.NH 2
+Objects.
+.PP
+Player machinations are in terms of Objects.  All Objects are nodes in
+a tree, the root node of which is labelled ".ALL".  A second special
+object, ".ME" is considered to represent the Player.  Objects will
+normally be treated either as rooms or portable-type objects, but 
+\s-2DDL\s+2
+itself
+does not distinguish these functions; all objects are stored and treated
+uniformly.  It is therefore possible, in principal, to write a 
+\s-2DDL\s+2
+scenario in which the Player may pick up a room, carry it, and
+later enter it.  Each object possesses the following attributes.  If
+any of these is not specified, it is given the default value of zero.
+.IP "LOC: " 6
+The object ID of the parent (location) of the object.
+.IP "CONT: " 6
+The object ID of the first child (contents) of the object.
+.IP "LINK: " 6
+The object ID of the next sibling (others in the same place) of the
+object
+.IP "ADJ: " 6
+The Adjective ID which uniquely distinguishes this object from others
+of the same name (if any).
+.IP "OTHERS: " 6
+The Object ID of another object with the same name as this object,
+though with a different adjective.
+.IP "NAME: " 6
+The unqualified Noun by which the Player names the object.
+.IP "PROPS: " 6
+Up to
+25
+numeric values can be arbitrarily associated with an object by the 
+\s-2DDL\s+2
+programmer.  Properties
+1-16
+may only possess the values 0 or 1.  The others may range in value from
+-32768 to +32767.
+The last three of these properties have special usages.  Their indices
+are predefined by the compiler.
+.IP "LDESC (23)" 6
+The Routine ID of a "Long Description" routine
+.IP "SDESC (24)" 6
+The Routine ID of a "Short Description" routine
+.IP "ACTION (25)" 6
+The Routine ID of a "Action" routine, to be called if the Player
+either attempts to do something with that object (specifies it as a
+Direct or Indirect Object), or while inside that object.
+.NH 2
+Verbs.
+.PP
+The "commands" typed by the Player must name Verbs which have been
+defined by the 
+\s-2DDL\s+2
+programmer.  Each Verb is associated with two Routine
+ID's:
+.IP "PREACT: " 6
+The Routine ID of a routine to execute when the verb has been
+recognized and the remaining input identified, but before any "Action"
+routines associated with the Objects in that input have been executed.
+For example, the PREACT routine of "take" might check to see if
+the direct object is in the room.
+.IP "ACTION: " 6
+The Routine ID of a routine to execute after all input object action
+routines have been called.
+Our experience has been that such routines end up being "default" routines
+that typically only say things like "Rubbing that object does nothing."
+.NH 2
+Strings.
+.PP
+Simple strings may be defined by the 
+\s-2DDL\s+2
+programmer to be printed.  Strings
+may be up to 255 bytes in length, delimited by double-quote marks.
+Carriage returns may be embedded in strings freely, or the sequence \\n
+may be used to represent a carriage return at any point.
+.NH 2
+Numbers.
+.PP
+\s-2DDL\s+2
+programers may only specify nonnegative integers up to 32767.
+However, a routine may compute any integer value from -32768 to +32767.
+.NH 2
+Adjectives.
+.PP
+Adjectives possess no data, but are uniquely numbered by the 
+\s-2DDL\s+2
+compiler
+so as to have unique internal IDs (which begin at the value 1).
+Adjectives are normally only used to distinguish various objects which
+have the same Noun name (eg the "red book" and the "blue book").
+.NH 2
+Routines
+.PP
+Routines represent the actual logical behavior of the Dungeon.  A routine
+consists of one or more calls to builtin or user-defined functions.
+Internally, a routine may be stored as an interpretive program for a
+very simple stack machine.  The internal representation is up to the
+implementer.
+Routines may call one another, and a single
+routine may call itself recursively.
+.NH 2
+Globals
+.PP
+50
+globals (numbered
+0-49)
+are available to the 
+\s-2DDL\s+2
+programmer and may contain any integer value.  They are named by
+numeric constants.  Such constants are conveniently assigned
+symbolic names by means of the VAR declaration described below.
+The last three globals are set each turn to contain the Indirect
+Object, Direct Object, and Verb typed by the player.  The constants
+Iobj, Dobj, and Verb are predefined by the compiler to refer to those
+globals.
+.NH
+\s-2DDL\s+2
+Programs
+.PP
+.B Note:
+In the syntactic descriptions below, metavariables such as
+.I varname
+refer to user-defined identifiers.  These identifiers consist
+of a string of alphameric characters of arbitrary length.
+A 
+\s-2DDL\s+2
+specification consists of one or more 
+\s-2DDL\s+2 
+statements, each terminated
+by a semicolon.  The following statements exist:
+.sp
+.IP "VAR \fIvarname, varname\fR,..." 8
+.PP
+Declares each 
+.I varname
+as a new symbol.  The symbol
+is defined as a constant with a value different from each
+previously declared <varname>.  <varname> must not
+be previously declared.
+.PP
+.B "Example:  "
+VAR strength, intell, wisdom;
+.sp
+.IP "VERB \fIverbname, verbname\fR,..." 8
+.PP
+Declares each 
+.I verbname 
+as a new verb.  
+.I verbname
+must
+not be previously assigned.
+.PP
+.B "Example:  "
+VERB north,south,east,west;
+.sp
+.IP "ADJEC \fIadjectivename, adjectivename\fR,..." 8
+.PP
+Creates a new adjective with name 
+.I adjectivename,
+which must not be previously assigned.
+.PP
+.B Example: 
+ADJEC red,green,blue;
+.sp
+.IP "NOUN \fInoun\fR[(\fIcontainer\fR)]" 8
+.PP
+Creates a new object named 
+.I noun
+whose
+initial location is 
+.I 
+container.  noun 
+.R
+may not
+be previously assigned; 
+.I container
+must be of
+type NOUN.  If the (\fIcontainer\fR) clause is omitted,
+the new object is placed in object .ALL .
+the 
+.I noun
+may actually be a adjective-noun pair.
+.PP
+.B Examples: 
+.DS
+NOUN red book, blue book;
+NOUN worm(red book);
+.DE
+.sp
+.IP "ROUTINE \fIroutinename, routinename, ...\fR" 8
+Declares that the \fIroutinename\fRs listed will be used
+for Routines later in the program.  This is to allow \s-2DDL\s+2,
+which is intended to be easily implementable, to deal with
+recursive routines (which have not yet been declared at the
+time of their definitions).  Only routines which are used
+before being defined need to be declared with this statement.
+.sp
+.IP "ARTICLE \fIarticle, article,\fR..." 8
+.PP
+Creates each \fIarticle\fR as an article.  Articles are recognized
+by the run-time parser, but are basically "noise" words.
+.PP
+.B Example: 
+ARTICLE the;
+.IP "PREP \fIprep, prep\fR,..." 8
+.PP
+Creates each 
+.I prep
+as a preposition.  Prepositions are basically
+noise words, but are used by the parser to recognize the presence of
+indirect objects in the Player's input.
+.PP
+.B Example: 
+PREP into,on,using,to,at;
+.sp
+.IP "\fInoun\fR (\fInumexp\fR) = \fIexp2\fR" 8
+.PP
+Property \fInumexp\fR of \fInoun\fR is set to the
+value of \fIexp2\fR.
+.I exp2
+may be a number, a string, a routine name, or a new routine;
+the numeric value or ID of
+.I exp2
+is always placed into the specified property.
+.PP
+.B Examples: 
+.DS
+gem(11)=0;             { 11 == Luminous }
+gem(LDESC) = ($say "There is a bright gem here!");
+gem(SDESC) = ($say "a bright gem");
+gem(ACTION) = GmAct;
+.DE
+.sp
+.IP "\fIverb\fR (PREACT | ACTION) = \fIroutine\fR" 8
+.PP
+Assigns \fIroutine\fR as the pre-object action or default action of
+the given \fIverb\fR.  The routine may be a predefined routine name or
+an actual routine.
+.PP
+.B Example: 
+.DS
+rub(ACTION) =  ($say "Rubbing ")
+               ($sdisc ($dobj))
+               ($say " seems silly.\\n");
+.DE
+.sp
+.IP "\fIname\fR = \fInumber\fR" 8
+.PP
+Assigns \fIname\fR as equivalent to \fInumber\fR.  \fIname\fR
+must not be previously assigned.
+.PP
+.B Example: 
+OPEN=11; TRUE=1;
+.IP "\fIname1\fR = \fIname2\fR" 8
+.PP
+Assigns 
+.I name1
+as a synonym for 
+.I name2.
+.PP
+.B Example: 
+n=north;s=south;se=southeast;
+.IP "(\fInumexp\fR) = \fInumexp2\fR" 8
+.PP
+Assigns the global (or VAR) named by \fInumexp\fR to the value
+given by \fInumexp2\fR.
+.PP
+.B Example: 
+(Maxpt)=450;
+.IP "\fIname\fR = "
+"\fIstring\fR"
+.PP
+Assigns 
+.I name
+as equivalent to "\fIstring\fR".
+.B Note:
+This seems to be rarely, if ever, used.  Usually it's just
+as easy to assign a routine to Say the given string.
+However, there are other string functions, such as $eqst
+and $substr, for which it may be useful to predefine strings.
+.PP
+.B Example: 
+err="Nothing happens.\\n";
+MagicWord = "ShaZam";
+.IP "\fIname\fR = \fIroutine\fR" 8
+.PP
+Assigns 
+.I name
+as equivalent to 
+.I routine
+.PP
+.B Example: 
+sayer=($say "Nothing happens.\\n");
+.IP "INCLUDE ""\fIfilename\fR""" 8
+.PP
+.B
+(\s-2UNIX\s+2 implementation only)
+.R
+Causes input to be read from the named file.
+.RE
+.NH 
+Routines
+.PP
+A routine is a list of one or more "forms".  Forms are of three types:
+.RS
+.IP "(\fIform1\fB : \fIform, form\fR ... [: \fIelseform, elseform\fR ...])" 8
+.PP
+Conditional expression.  If 
+.I form1
+evaluates to
+nonzero, the subsequent \fIform\fRs are executed in
+sequence.  Otherwise, the list of \fIelseform\fRs is executed in sequence.
+.B Note:
+The second colon, and the subsequent \fIelseform\fRs, are optional.
+.PP
+.B Example: 
+.PP
+.DS
+(TRUE : ($say "Always do me") : ($say "Never do me"))
+.DE
+.IP "(WHILE \fIform1\fR : \fIform, form ... \fR)" 8
+.PP
+Simple looping construct.  If \fIform1\fR evaluates
+to nonzero, the subsequent \fIform\fRs are evaluated
+in sequence.  This process is repeated until such
+a time as \fIform1\fR is found to evaluate to zero.
+.PP
+.B Example:
+.PP
+.DS
+(WHILE ($eq ($loc .ME) JewlRoom) : (TRYmv .ME Prison))
+.DE
+.IP "(\fIfunction arg1 arg2\fR ...)" 8
+.PP
+Function call (note that all builtin functions
+begin with the character $).  The \fIfunction\fR is applied
+to the \fIarg\fRs.  An argument may be a number,
+string, declared name, or another form.  However, the function must
+be a simple identifier, or a form which evaluates to a function
+identifier (
+.I 
+e.g.
+.R
+($ldisc xxx)).
+In addition, three special argument types are recognized:
+.PP
+An argument such as "@\fInumber\fR" is interpreted as 
+"contents of global \fInumber\fR".
+.PP
+An argument such as "%\fInumber\R" is interpreted as "the value of the \fInumber\R
+argument to this function".
+.PP
+An argument such as "[\fIadj noun\fR]" must be used if the programmer wishes to
+refer to an object with an associated adjective.
+.RE
+.PP
+.B Examples:
+.DS
+.SM
+VERB north,south,east,west,ne,nw,se,sw,up,down;
+n=north; s=south; e=east; w=west; u=up; d=down;
+
+NOUN rm001,rm002,rm003,rm004,rm005,rm006;
+NOUN .ME(rm001);
+
+ADJECTIVE red,blue;
+NOUN red ball(rm002),blue ball(rm003);
+
+red ball(LDESC) = ($say "There is a red ball here.");
+red ball(SDESC) = ($say "Red ball.");
+
+VAR score;
+(score) = 0;
+
+TAKBT = 16;
+TRUE = 1; FALSE=0;
+red ball(TAKBT) = TRUE;
+
+ROUTINE takeR;                 { Declared later }
+
+VERB take;
+take(ACTION) =         ( ($and ($prop ($dobj) TAKBT)
+                       ($eq ($loc .ME)($loc ($dobj)))):
+                               (takeR ($dobj))
+               );
+takeR =        ($move %1 .ME)
+               (($eq %1 [red ball]):
+                       ($say "The ball is glowing!")
+                       ($setg score ($plus 10 @score)));
+.NL
+.DE
diff --git a/usr/src/games/ddl/doc/tiny.ddl b/usr/src/games/ddl/doc/tiny.ddl
new file mode 100644 (file)
index 0000000..40c3c03
--- /dev/null
@@ -0,0 +1,142 @@
+NOUN startrm;
+NOUN brightroom;
+
+NOUN .ME(startrm);
+
+VAR Obj;
+SEEN = 1;
+
+Looker = (($ldisc ($loc .ME)))         { CALL Ldisc of room }
+        ($setg Obj ($cont ($loc .ME))) { start with first obj in room }
+        (WHILE @Obj :
+               (($ldisc @Obj) :        { If it has a description, }
+                       (($ldisc @Obj)) {  then say it. }
+               )
+               ($setg Obj ($link @Obj))        { Continue with sibling }
+        )
+       ;
+
+
+Slook =  (($sdisc ($loc .ME)))         { CALL Ldisc of room }
+        ($setg Obj ($cont ($loc .ME))) { start with first obj in room }
+        (WHILE @Obj :
+               (($ldisc @Obj) :        { If it has a description, }
+                       (($ldisc @Obj)) {  then say it. }
+               )
+               ($setg Obj ($link @Obj))        { Continue with sibling }
+        )
+       ;
+
+Rdesc =                        { Room description }
+       ($say "\n")
+       (($prop ($loc .ME) SEEN) :              { Have I been here? }
+                       (Slook)                 { Yes, be brief. }
+       :{else}         (Looker)                { Otherwise, do the spiel, }
+                       ($setp ($loc .ME) SEEN 1)       { but only once. }
+       )
+       ($say "\n> ")   { Prompt player }
+       ;
+
+VERB look;
+look(ACTION) = Looker;
+
+VERB inventory;
+inven = inventory;
+
+inven(ACTION) = (($not ($cont .ME)):   { Null "contents" field }
+                       ($say "You are empty-handed.\n")
+               :{else}
+                       ($say "You are carrying:\n")
+                       ($setg Obj ($cont .ME))
+                       (WHILE @Obj :
+                               (($sdisc @Obj))
+                               ($say "\n")
+                               ($setg Obj ($link @Obj))
+                       )
+               )
+               ;
+
+VERB take;
+VERB drop;
+get=take;
+
+take(PREACT) = (($ne ($loc .ME) ($loc ($dobj))):       { Dobj in same room? }
+               ($say "I don't see ")           { No, report the fact }
+               (($sdisc ($dobj)))
+               ($say " here.\n")
+               ($exit 1));                     { and end the turn. }
+
+drop(PREACT) = (($ne ($loc ($dobj)) .ME) :     { Must be carrying the dobj }
+               ($say "You aren't carrying it!\n")
+               ($exit 1));
+
+take (ACTION) = ($move ($dobj) .ME)
+               ($say "Taken.\n")
+               ;
+
+drop(ACTION) = ($move ($dobj) ($loc .ME))
+               ($say "Dropped.\n")
+               ;
+
+DWIMD = (($and ($eq ($verb) take)
+              ($ne ($loc ($dobj)) ($loc .ME))):
+                       ($rtrn 0))
+       (($and ($eq ($verb) drop)
+              ($ne ($loc ($dobj)) .ME)):
+                       ($rtrn 0))
+       ($rtrn 1);
+startrm (LDESC) =
+               ($say 
+"You are in a small but comfortable room.  You hardly want
+to leave, but there is a door leading east, if you insist.\n")
+               ;
+startrm (SDESC) =
+               ($say "Comfortable room.\n");
+
+brightroom(LDESC) =
+               ($say
+"You are in a brightly lit room.  The walls sparkle with
+scintillating lights.  There is a darker room to the west.\n");
+
+brightroom(SDESC) = ($say "Bright room.\n");
+
+
+ADJECTIVE red, blue;
+NOUN red pillow(startrm);
+NOUN blue pillow(startrm);
+red pillow(LDESC) = ($say "There is a red pillow here.\n");
+red pillow(SDESC) = ($say "A red pillow");
+blue pillow(LDESC) = ($say "There is a blue pillow here.\n");
+blue pillow(SDESC) = ($say "A blue pillow");
+
+
+NOUN platinum(brightroom); bar=platinum;
+platinum(LDESC) = ($say "There is a bar of platinum here!\n");
+platinum(SDESC) = ($say "Platinum bar");
+platinum(ACTION) = 
+               (($eq ($verb) drop) :
+                       (($eq ($loc .ME) ($loc [red pillow])):
+                               ($say 
+"The bar falls onto the red pillow, breaking it!  The symbolism
+impresses itself upon you, and you go back to work instead of
+playing these silly games!\n")
+                               ($spec 3 0 0 0 0)
+                       )
+               );
+
+VERB north, south, east, west;
+n=north; s=south; e=east; w=west;
+
+cg = ($say "You can't go that way.\n");
+n(ACTION) = cg;
+s(ACTION) = cg;
+e(ACTION) = cg;
+w(ACTION) = cg;
+
+startrm(ACTION) =  (($eq ($verb) east) : 
+                               ($move .ME brightroom)
+                               ($exit 1)               { bypass default }
+                       );
+brightroom(ACTION) = (($eq ($verb) west) : ($move .ME startrm)($exit 1));
+
+START = ($sdem Rdesc);
diff --git a/usr/src/games/ddl/doc/wishlist b/usr/src/games/ddl/doc/wishlist
new file mode 100644 (file)
index 0000000..800e9e2
--- /dev/null
@@ -0,0 +1,166 @@
+Date: 25 Apr 1980 1546-PST (Friday)
+From: mike at UCLA Computer Science VAX (Mike Urban)
+Subject: ATTN: DDL Implementors
+To: cc (UCLA Computer Club)
+
+   I would like the following changes made in DDL:
+
+1) Friendlier Parsing.  You should be able to say 
+       give troll the knife
+   and get away with it (with "knife" as Dobj and "troll" as Iobj).  You
+   should get messages like "I don't know how to tke" in the event
+   of a bad verb, and "I think 'north' is a verb" in the event
+   of a weird parse like "push north wall".  You should be able
+   to say things like "e.s.s.take thing. eat thing. look" and have
+   the parser treat the "." as equivalent to and end-of-line.  
+               /* ACCOMPLISHED 6/13/80.  Syntax errors are now
+               of the form "I don't know how to xxx" if an unknown
+               word is encountered (the whole word, not just 5 letters
+               is printed); "I don't know the word 'xxxxxx'" for other
+               unknown words; and "I don't understand, because I 
+               think 'xxxxxx' is a [noun/verb/adjective/etc]" for
+               other syntax errors.  The separator was already
+               built into the lexer, but it's a comma, not a period.
+               And VERB IOBJ DOBJ is a legal syntax now, but 
+               VERB PREP IOBJ DOBJ isn't (tho it's easy to add) */
+       MAYBE
+   (if it isn't hard), you should be able to say "take this, that, the other"
+   and have a more sophisticated control loop which causes it to act
+   like "take this.  take that.  take the other" with the EXCEPTION that
+   no daemon/fuse processing is performed (no turn increment) and that
+   the whole thing can be short-circuited by an appropriate Exit code.
+
+2) Generalized routine and object handling.  The routines associated with
+   objects should be properties of that object just like the others.  The
+   constants that tell WHICH property is, say, the Action property should
+   be predefined.  So ($setp room1 LDESC Rubbl) would set the long 
+   description of room1 to the routine Rubbl (which describes the rubble
+   left by the explosion you just triggered...).   
+
+       /*** ACCOMPLISHED 6/6/80 ***/
+
+3) Improved global handling.  The programmer shouldn't have to know the
+   "address" of his globals.  Instead, a construct like 
+       VAR score
+   would be the equivalent of saying "score = xxx" where xxx is one less
+   than the last VAR done.  
+
+       /*** ACCOMPLISHED 5/29/80 ***/
+
+
+4) Improved grammeme access.  There should be predefined VARs which
+   contain the values of ($verb) ($dobj) and ($iobj).  You should
+   be able to re-assign these.  SO, you should be able to say
+       turn off lamp   
+   and the PreVerb routine for "turn" might contain something like
+       (($eq @Iobj off):
+               ($setg Verb douse)
+               ($setg Iobj 0)
+       )
+               /*** Accomplished 6/12/80; Only change in
+                       ddlrun is #defines for verbtodo, etc */
+
+   Because verbs don't have properties, we may wish for functions
+   to access their preverb and action routines as well.
+
+5) String handling:  It'd sure be nice to have someone type
+       incant "abra ca dabra" 
+   and be able to talk about ($subs Dobj @var 1) or ($indx @Dobj "abra")
+   or whatever.  I don't know exactly how to implement it yet.
+               /*** Accomplished 7/28/80;  STRINGs are negative-valued
+               objects.  If the lexer gets a string, it puts it into
+               a temporary string area (that is flushed every turn) and
+               returns an index (not pointer) into that are as a negative
+               number.  The parser knows about these and can handle
+               verb string  and  verb string prep iobj   sentences.
+               (the latter being for "Incant "rise" over seed".)
+
+               If the dobj or iobj of an input is a string, the dobj
+               and iobj routines called are the ones associated with
+               the object STRING (if such is defined by the DDL
+               programmer).  At present, the functions $substr, $length
+               and $eqst  are defined.  $substr returns a negative
+               pointer into the temp string area; this can be stored
+               in a global, for example.  A permanent string area
+               is available, but I haven't written the function 
+               ($sets glbl string) which would move the string to the
+               permanent area and put its index therein into glbl.
+                               Mike            ***/
+               /*** On 8/20/80, I added a new function (which, mirable dictu,
+               will allow coding of the "echo" room!), ($read), which
+               pauses, gets a line of input, and returns the line as
+               a string!  Gee, if we code up ($pars str verb dobj iobj)...
+
+6) Ctrl-D should terminate the program.  Ctrl-C should interrupt whatever
+   is happening and begin a new turn.
+   Note that this may leave things in a bad state.
+
+7) New language construct: (WHILE condexp : formlist) is essentially
+   equivalent to (condexp : formlist ($____ formlist+condexp)) where
+   "($____ formlist+condexp)" is a new operator, JUMPB (jump back),
+   which is just like the current $.... jump forward instruction, but
+   (obviously) negative, and unconditional.  It goes back exactly to
+   the beginning of the test.
+               /*** ACCOMPLISHED 8/18/80 --Mike ***/
+
+8) New routine ($rand n) produces a somewhat random number in the range
+   1..n .      /*** ACCOMPLISHED 8/18/80 ***/
+
+9) DDLRUN sources should be reorganized so as to enable recompilation
+   of less than the entire program if some less global change (such
+   as the addition of a new routine, or a bug fix in the parser) is
+   made.
+               /*** Somewhat accomplished 10/80.  Still needs 
+                    work.  In particular, changes in extvars.c must
+                    be reflected in extvars.h ***/
+
+10) The symbol table, and the hash routine, are simple-minded.  The
+   5-character limitation on names is a real pain for some people.
+   For example, you can't even fake the Zork puzzle room by allowing
+   someone to say "push northern wall".  
+   These changes don't have to go together.
+
+               /*** ACCOMPLISHED(!!) 11/80.  Identifiers are pretty
+                       much as long as you like.  The symbol table,
+                       now alphabetized, contains indices (not pointers)
+                       into a pool of identifiers that starts at
+                       sbrk(0).  A binary search algorithm is used.
+                       This will enable a future version to respond
+                       correctly to unambiguous abbreviations for
+                       things at runtime (like news for the aard
+                       newspaper, for a cogent example).  This
+                       hasn't been tested for portability to a
+                       PDP-11 under V7, so beware. As of 11/18,
+                       the symbol table is still unencrypted ***/
+               /*** The runtime parser recognizes unambiguous 
+                       abbreviations.  The symbol table is still
+                       unencrypted.  1/81 ***/
+
+11) It should be available on a micro.
+                       /* Not yet.  But the thinking has begun! */
+                       /* This will necessitate some rearchitecture
+                          especially wrt buffering of routines/strings */
+
+12) The ACTION routine for verbs should execute AFTER the action 
+    routine for your room; this enables east(ACTION) to correctly
+    default to ($say "Can't go that way.") and allow one to generally
+    live without $hit and $miss, crocky routines that they are.
+    See ../sample (espec. transit.ddl) for a specimen of how this works.
+
+                       /* 11/80 */
+
+13) Routines that get the action and preaction routines for verbs
+    should be made available.  
+
+14) Fuses and daemons aren't QUITE right (fuses go off after your daemon
+       has typed a prompt, for a real-world example).  Maybe they
+       shd be on a homogenized priority queue?
+
+15) It should be frozen real soon.
+                       /* As of 1/81, we're STILL thinking in terms
+                          of "just this ONE more feature..."  Damn. */
+
+
+
+       Mike
+
diff --git a/usr/src/games/ddl/sample/READ_ME b/usr/src/games/ddl/sample/READ_ME
new file mode 100644 (file)
index 0000000..eb26511
--- /dev/null
@@ -0,0 +1,19 @@
+   Caveat Ludor (or something like that).
+
+   The sample DDL dungeon in this directory cannot even remotely
+be considered a complete scenario.  At every turn, there are
+pointless areas of terrain, objects with no use, and verbs that
+don't work.  The scenario is intended primarily to demonstrate
+(originally to TEST) some of the things that can be done in DDL,
+and some of the features of the system, like fuses and DWIMming.
+   This is not to discourage play; there are one or two very
+nice stunts in the scenario.  Some ideas for extending the
+scenario are in sample.ideas.  The prospective DDL programmer
+is encouraged to examine the DDL sources for this scenario,
+and initially experiment with adding stunts and scenery to 
+its many dead-ends, rather than attempting to create an entire
+original world from scratch.  DDL's purpose is to allow
+people's ingenious ideas to be conveniently realized.  
+New scenarios, or additions to this sample, should be sent
+electronically to ucla-vax!mike (via UCB's uucp hookup) or
+mike@ucla-security (via the Arpanet).
diff --git a/usr/src/games/ddl/sample/constants.ddl b/usr/src/games/ddl/sample/constants.ddl
new file mode 100644 (file)
index 0000000..f3c663c
--- /dev/null
@@ -0,0 +1,40 @@
+
+{  *** Intrinsic Properties *** }
+
+VISIT = 1;             { I've been here / seen this }
+OPENS = 2;             { This can be opened }
+LOCKS = 3;             { This can be locked }
+OPEN  = 4;             { This is opened }
+LOCKD = 5;             { This is locked }
+TRANS = 6;             { This is transparent }
+LIGHT = 7;             { This gives off light }
+FLAME = 8;             { This is on fire }
+CONTS = 9;             { Printed contents for the object (Look Kludge) }
+SHRNK = 10;            { Has it been shrunk? }
+CRYST = 11;            { Is it one of our magic thingies? }
+
+MISC1 = 16;            { Miscellaneous Property (Semantics per object) }
+HOLED = MISC1;
+
+RDLOC = 17;            { Location on Highway 8 }
+WEIGH = 18;
+HOLDS = 19;
+HAS   = 20;
+POINT = 21;
+
+{ Constants }
+TRUE = 1; FALSE = 0;
+CAPAC = 250;           { More than I can carry }
+
+Shazm = "ShaZam";      { The Wizard's incantation }
+
+{ Globals }
+VAR DARKG ;
+VAR HWY8  ;
+VAR LOOKP ;
+VAR SCORE ;
+VAR Tempr ;            { Dragon's Upset? }
+VAR Cel6x ;            { Where he came from to enter Cel06 }
+VAR WASDK ;
+VAR Wizrd ;            { Wizardly Ability }
+VAR GO;                        { Did he move OK? }
diff --git a/usr/src/games/ddl/sample/locales.ddl b/usr/src/games/ddl/sample/locales.ddl
new file mode 100644 (file)
index 0000000..2622136
--- /dev/null
@@ -0,0 +1,323 @@
+.ALL(LDESC) = ($say "You shouldn't be here at all.  This is THE COSMIC ALL.\n")
+               ($exit 1);
+.ALL(SDESC) = ($say "THE COSMIC ALL");
+
+road1(SDESC) = rdsc;
+road1(LDESC) = ($say "You're on a dirt road going east-west.  Tall stalks of
+corn grow on either side of the road.\n");
+
+road2(SDESC) = rdsc;            road2(LDESC) = rdsc;
+road3(SDESC) = rdsc;            road3(LDESC) = rdsc;
+road4(SDESC) = rdsc;            road4(LDESC) = rdsc;
+road5(SDESC) = rdsc;            road5(LDESC) = rdsc;
+road6(SDESC) = rdsc;            road6(LDESC) = rdsc;
+
+road7(LDESC) = ($say "A road from the west forks north and south here.
+To the east is a dense-looking forest; cornfields are seen on the
+west.\n");
+
+road7(SDESC) = ($say "You're at the fork in the road.\n");
+
+road8(SDESC) = rdsc;
+road8(LDESC)=($say
+"The road stretches a long way east-west.  A short fence divides the
+road from the cornfields beyond.  Please don't tresspass.\n");
+
+
+ROUTINE dump8; ROUTINE get8;    ROUTINE entr8;  ROUTINE east8; ROUTINE west8;
+
+
+
+gard1(SDESC) = gdsc;            gard1(LDESC) = gdsc;
+gard2(SDESC) = gdsc;            gard2(LDESC) = gdsc;
+gard3(SDESC) = gdsc;            gard3(LDESC) = gdsc;
+gard4(SDESC) = gdsc;            gard4(LDESC) = gdsc;
+gard5(SDESC) = gdsc;            gard5(LDESC) = gdsc;
+gard6(SDESC) = gdsc;            gard6(LDESC) = gdsc;
+gard7(SDESC) = gdsc;            gard7(LDESC) = gdsc;
+gard8(SDESC) = gdsc;            gard8(LDESC) = gdsc;
+
+frst1(SDESC) = fdsc;            frst1(LDESC) = fdsc;
+frst2(SDESC) = fdsc;            frst2(LDESC) = fdsc;
+frst3(SDESC) = fdsc;            frst3(LDESC) = fdsc;
+frst4(SDESC) = fdsc;            frst4(LDESC) = fdsc;
+
+farm1(SDESC) = ($say "Entrance to farm.\n");
+farm1 (LDESC) = ($say
+"You are at the entrance on the south side of a rundown
+farmhouse.  Someone has painted 'DIE, HEATHENS' on the
+front door, which barely stays on its hinges.  Marks of
+smoke and flame are visible.  A road runs to the south,
+and you may walk around the farmhouse by going east or west.\n");
+
+farm2(LDESC) = ($say
+"You are in the entry hall of a long-deserted old farmhouse.
+The floor is covered with the dust of years of disuse.  The
+front door to the south is open, and there is another room
+to the north.  A stairway on the east side of the room goes up.\n");
+farm2(SDESC) = ($say "Entry hall\n");
+
+
+farm3(LDESC) = ($say
+"You are on the east side of the farmhouse.  To the east, a forest
+stretches away into the distance.  The entrance to the farmhouse
+is to the south.\n");
+farm3(SDESC) = ($say "East side of the farmhouse\n");
+
+farm4(LDESC) = ($say
+"You are on the west side of the farmhouse.  The cornfields
+stretch away forever to the west.  The entrance to the house
+is to the south.\n");
+farm4(SDESC) = ($say "West side of the farmhouse\n");
+
+farm5(LDESC) = ($say
+"You are on the north side of the farmhouse.  A high fence
+separates you from the cornfields to the north.");
+farm5(SDESC) = ($say "North side of the farmhouse\n");
+
+
+farm6(LDESC) = ($say
+"You are in an old, empty farmhouse kitchen.  All the
+cupboards and cabinets are bare (unless you can eat the
+thick layer of dust which covers everything).")
+              (($prop farm6 VISIT):($say "\n"));
+farm6(SDESC) = ($say "Farmhouse kitchen\n");
+
+farm7(LDESC) = ($say
+"You are in the upstairs bedroom of the farmhouse.  All the
+windows are boarded up, and nobody has slept here for years.
+To the east is an exit leading to the entry hall below.\n")
+
+       (($prop bed OPEN ) :
+               ($say
+"In the middle of the room is an old, rickety bed.   The west
+wall ")
+               (($prop panel OPEN) :
+                       ($say
+     "has a panel missing, revealing a secret stairway down.\n")
+       {else}:         ($say
+     "seems to have a loose panel.\n")
+               )
+ {else} :
+               ($say
+"Against the west wall is an old, rickety bed (which may be
+why nobody has slept here for years).\n")
+       );
+farm7(SDESC) = ($say "Upstairs bedroom\n");
+
+PanL =                  { Try to go through panel }
+       (($prop panel OPEN):
+               ($move .ME cel01)
+               ($say "You descend into the gloom...\n")
+       {else}: (($eq ($loc .ME) farm7):(cg))
+       );
+
+
+town1(SDESC) = ($say "One horse town.\n");
+town1(LDESC) =  ($say
+"You are at the northern end of a one-horse town.  Although the buildings
+are in good shape, all seem deserted.  You can't even find one horse.
+To the east is an old smithy.  On the west side of the street is an
+abandoned hotel.  The street runs north and south.\n");
+
+town2(SDESC) = ($say "One horse business district.\n");
+town2(LDESC) = ($say
+"You are at the southern end of a one-horse town.  This is the
+business district.  On the east side of the street is an old
+building with a tastefully lettered sign, 'Arpa-Citizen's Savings'.
+To the west is the legendary 'Packet Inn'.  The street runs north-south.\n");
+
+town3(SDESC) = ($say "Blacksmith's Shop.\n");
+town3(LDESC) = ($say
+"You're in what is left of a once-thriving blacksmith's shop.
+Long ago abandoned, nothing much of interest remains.\n");
+
+town4(SDESC) = ($say "Flophouse.\n");
+town4(LDESC) = ($say
+"You're in the Flophouse hotel.  Never worth the visit even in
+its heyday, a quick search reveals nothing but a lot of dusty rooms.\n");
+
+town5(SDESC) = ($say "Arpa-Citizen's Savings.\n");
+town5(LDESC) = ($say
+"You are in the ancient and venerable institution of Arpa-Citizen's
+Savings (there's a branch in your town).  The lobby is tastefully
+decorated in marble.  The only feature is a strange sweet-smelling
+well in the center of the room.  A mysterious plaque on the side ")
+               ($say
+"reads:
+       'Drop your bits here!'
+");
+TWN5x =
+       (($eq ($verb) drop): (TWN5y));
+TWN5y =         
+               (cdrop)                 { Do the right thing }
+               ($say
+"A strange glowing network of lights appears, and you can read:\n")
+               (($prop ($dobj) POINT):
+                       ($setg SCORE ($plus @SCORE ($prop ($dobj) POINT)))
+                       ($move ($dobj) .ALL)
+                       ($say "   Your account is now at $")($num @SCORE)
+($say ".\n   Thank you for letting Arpa-Citizen's be your host.\n")
+               {else}:
+                       ($say "   Your deposit is worthless")
+                       (($pct 25):
+                               ($say ", but thanks for the trinket!\n")
+                               ($move ($dobj) .ALL)
+                       {else}:
+                               ($say "!  Keep it!\n")
+                       )
+               )
+               ($say "The Arpa network mercifully disappears.\n")
+               ($exit 1)                       { Short circuit the verb }
+               ;
+
+town6(SDESC)  = ($say "The Packet Inn.\n");
+town6(LDESC)  =
+       ($say
+"You are at that famous old saloon, the Packet Inn.  Thousands
+of the local adventurers drank 'till they were totally zorked in
+this colorful old haunt.  A little wandering convinces you that
+nothing much is to be seen.\n");
+
+{*** DUNGEON PROPER ***}
+cel01(LDESC) = ($say
+"You are in a secret cellar below the farmhouse.  In the
+corner of one wall is a strange insignia composed of red
+and green squares, joined at the corners.  Passages
+lead to north, west and south.  An old stairway leads up and out.\n")
+($move insignia cel01);
+cel01(SDESC) = ($say "Secret cellar.\n")
+              ($move insignia cel01);
+
+cel02(LDESC) = ($say
+"You are in a cool cave, once used for the storage of rare
+wines.  A cool breeze from the caves to the north keeps this cave
+at an even temperature the year round.  Exits can be seen
+to the south and east.\n");
+cel02(SDESC) = ($say "Cool cave.\n");
+
+{ cel03 was moved to after cel08 }
+
+
+cel04(LDESC) = ($say
+"This is a small temple to Elbereth, Queen of the Stars.  The walls
+glow with a warm iridescence of their own.  They are covered
+with murals depicting the kindling of the stars at the Beginning of
+Days.  In one corner, someone has added a strange insignia composed
+of red and white squares, joined at the corners.  Passages lead
+east and west, and a stairway to the north leads down into darkness.\n")
+($move insignia cel04);
+cel04(SDESC) = ($say "Temple to Elbereth.\n")
+              ($move insignia cel04);
+cel04(LIGHT)=TRUE;
+
+
+cel05(LDESC) = ($say
+"You are in an icy cave.  All the walls are covered with thick
+layers of ice.  The cave continues north and south, and there
+are side tunnels leading to the northeast and northwest.\n");
+cel05(SDESC) = ($say "Ice Cave.\n");
+
+cel06(LDESC) = ($say
+"You have reached a large cavern of ice.  You cannot see
+the roof, but you are sure it is covered with icicles.
+There are exits east and west.\n");
+cel06(SDESC) = ($say "Great Ice Cavern.\n");
+
+
+cel07(LDESC) = ($say
+"You are in a tiny side room where the ice dragon keeps his
+single prize treasure.  You may leave through a western doorway.\n");
+cel07(SDESC) = ($say "Dragon's Treasure Room.\n");
+
+cel08(LDESC) = ($say
+"You are in an old abandoned room, once the resident of a frustrated
+artist.  A huge mural depicting a barren wasteland covers the west
+wall.  A dim glow comes from the corridor to the east.\n");
+cel08(SDESC) = ($say "Artist's Retreat.\n");
+
+cel03(LDESC) = ($say
+"You are standing on the north bank of a frozen underground
+river.  The source of the river seems to have been to the
+west, and you can walk that way on the ice.  However, to
+the northeast, the river forms a frozen waterfall you can
+slide down.\n");
+cel03(SDESC) = ($say "Top of frozen fall.\n");
+
+cel09(LDESC) = ($say
+"You are at the southern end of a dry river gorge.  The source
+of the river was once a waterfall to the south, but for some reason
+it seems frozen solid.  The riverbed continues north.\n");
+cel09(SDESC) = ($say "Southern gorge.\n");
+
+cel10(LDESC) = ($say
+"You are in a dark cave.  The low-hanging stalactites and tall
+stalagmites cast eerily human-like shadows on the craggy walls.
+A roughly-hewn stairway to the south is lit by a dim illumination
+from above, while a slimy pit in the middle of the room leads
+down into even inkier blackness.  The system of caverns continues
+to the west.\n");
+cel10(SDESC) = ($say "Shadowy cave.\n");
+CELdL =
+(($and   (See [clear crystal] ($cont ($loc .ME)) )
+             ($prop [clear crystal] LIGHT)):
+
+                       ($say
+"You are in an impossibly dark cave.  Only the light from your
+magic crystal makes it possible to see, even dimly, here.  You
+can make out a tunnel leading north, and another leading east.
+No other exits are visible.\n")
+                    :  ($say "It's mighty dark in here!")
+                       ((See globe ($cont ($loc .ME))):
+                               (($prop globe LIGHT):
+                                       ($say
+"  Even your glowing globe is barely visible!")
+                               )
+                       )
+                       ($say "\n")
+                       ($setg DARKG TRUE)
+               );
+cel11(LDESC) = CELdL;
+CELdS =
+              ($say "DARK cave.\n")
+              (($and   (See [clear crystal] ($cont ($loc .ME)) )
+                       ($prop [clear crystal] LIGHT)):
+                       ($exit 0):($setg DARKG TRUE));
+cel11(SDESC) = CELdS;
+
+cel12(LDESC) = CELdL;
+cel12(SDESC) = CELdS;
+
+cel13(LDESC) = ($say
+"You are on a large underground lake of ice, thick enough
+to walk on.  To the west you can dimly make out a cavern
+entrance; to the east is an icy river you can walk on.\n")
+               (($prop cel13 HOLED):
+                       ($say
+"In the middle of the lake is a hole; icy water sloshes about
+two feet below the ice.\n")
+               );
+cel13(SDESC) = ($say "Icy lake.\n");
+
+cel14(LDESC) = (($ge ($prop .ME HAS) ($prop globe WEIGH)):
+                       ($say
+"Whatever it is you're carrying drags you down into the icy depths!\n")
+                       (die)
+               )
+               ($say
+"You are swimming beneath the ice.  There seems to be light to the
+west, but you can't hold your breath for long...\n")
+               ;
+cel14(SDESC) = ($say "Back in the icy lake.\n");
+
+cel15(LDESC) = ($say
+"You are on a sandy beach in a small cave.  A small pool of water
+comes up to the beach, and a quick survey of the place shows that it
+is completely covered by the stony roof.  You can walk up to the
+back of the cave, but the pool seems to be the only other exit.\n");
+cel15(SDESC) = ($say "Sandy beach.");
+
+cel16(LDESC) = ($say 
+"You are at the back of a small cave.  A sandy shore slopes down
+to a blue pool of water.  To the west is a small crawlway.\n");
+cel16(SDESC) = ($say "Back of cave.\n");
diff --git a/usr/src/games/ddl/sample/locnames.ddl b/usr/src/games/ddl/sample/locnames.ddl
new file mode 100644 (file)
index 0000000..5531169
--- /dev/null
@@ -0,0 +1,53 @@
+NOUN .road;     rdsc =  ($say "You're on the road.\n");
+NOUN .gard;     gdsc =  ($say "You're somewhere in a cornfield.\n");
+NOUN .frst;     fdsc =  ($say "You're in the forest.\n");
+NOUN .dsrt;     dsrt =  ($say "You're in the middle of the desert.\n");
+NOUN .farm;
+NOUN .town;
+
+NOUN road1(.road);      road1(LIGHT) = TRUE;
+NOUN road2(.road);      road2(LIGHT) = TRUE;
+NOUN road3(.road);      road3(LIGHT) = TRUE;
+NOUN road4(.road);      road4(LIGHT) = TRUE;
+NOUN road5(.road);      road5(LIGHT) = TRUE;
+NOUN road6(.road);      road6(LIGHT) = TRUE;
+NOUN road7(.road);      road7(LIGHT) = TRUE;
+NOUN road8(.road);      road8(LIGHT) = TRUE;
+NOUN roadx;     { Where things on Highway 8 get held }
+
+NOUN gard1(.gard);      gard1(LIGHT) = TRUE;
+NOUN gard2(.gard);      gard2(LIGHT) = TRUE;
+NOUN gard3(.gard);      gard3(LIGHT) = TRUE;
+NOUN gard4(.gard);      gard4(LIGHT) = TRUE;
+NOUN gard5(.gard);      gard5(LIGHT) = TRUE;
+NOUN gard6(.gard);      gard6(LIGHT) = TRUE;
+NOUN gard7(.gard);      gard7(LIGHT) = TRUE;
+NOUN gard8(.gard);      gard8(LIGHT) = TRUE;
+
+NOUN frst1(.frst);      frst1(LIGHT) = TRUE;
+NOUN frst2(.frst);      frst2(LIGHT) = TRUE;
+NOUN frst3(.frst);      frst3(LIGHT) = TRUE;
+NOUN frst4(.frst);      frst4(LIGHT) = TRUE;
+
+NOUN farm1(.farm);      farm1(LIGHT) = TRUE;
+NOUN farm2(.farm);      farm2(LIGHT) = TRUE;
+NOUN farm3(.farm);      farm3(LIGHT) = TRUE;
+NOUN farm4(.farm);      farm4(LIGHT) = TRUE;
+NOUN farm5(.farm);      farm5(LIGHT) = TRUE;
+NOUN farm6(.farm);      farm6(LIGHT) = TRUE;
+NOUN farm7(.farm);      farm7(LIGHT) = TRUE;
+
+NOUN town1(.town);      town1(LIGHT) = TRUE;
+NOUN town2(.town);      town2(LIGHT) = TRUE;
+NOUN town3(.town);      town3(LIGHT) = TRUE;
+NOUN town4(.town);      town4(LIGHT) = TRUE;
+NOUN .bank;
+NOUN town5(.bank);      town5(LIGHT) = TRUE;
+NOUN town6(.town);      town6(LIGHT) = TRUE;
+
+NOUN cel01;
+NOUN cel02,cel03,cel04,cel05,cel06;
+NOUN cel07,cel08,cel09,cel10;
+NOUN cel11,cel12,cel13,cel14,cel15,cel16,cel19,cel20;
+NOUN cel21,cel22,cel23,cel24,cel25,cel26,cel29,cel30;
+NOUN cel31,cel32,cel33,cel34,cel35,cel36,cel39,cel40;
diff --git a/usr/src/games/ddl/sample/objects.ddl b/usr/src/games/ddl/sample/objects.ddl
new file mode 100644 (file)
index 0000000..1e39e16
--- /dev/null
@@ -0,0 +1,596 @@
+ADJECTIVE red,green,blue,clear;
+ADJECTIVE glass;
+
+NOUN red message(road2);        { It's red so there can be others elsewhere }
+red message(WEIGH) = CAPAC;
+red message(LDESC) = ($say "There is a message scratched in the dirt.\n");
+red message(SDESC) = ($say "a message in the dirt");
+red message(ACTION) = (($eq ($verb) read):
+                       ($say "'in' is a preposition.  'enter' is a verb.\n")
+                       ($exit 1)
+                  );
+
+NOUN keys (town4);
+keys(WEIGH) = 2;
+keys(LDESC) = ($say "There's a set of keys here.\n");
+keys(SDESC) = ($say "a set of keys");
+
+NOUN toolbox (farm5);
+toolbox(WEIGH) = CAPAC;
+toolbox(HOLDS) = 50;
+toolbox(OPENS) = TRUE;
+toolbox(LOCKS) = TRUE;
+toolbox(LOCKD) = TRUE;
+toolbox(LIGHT) = TRUE;
+toolbox(LDESC) = (($eq ($loc .ME) toolbox):
+                       ($say
+"You are in a huge wooden structure, towering up at least 80 feet
+above your head, with wooden walls formed of immense 10-foot by 50-foot
+boards.  Everything here, even the grains of dust which cover the wooden
+floor, seems immense.  ")
+                       (($prop toolbox OPEN):
+                               ($say
+                     "Above your head, the top of the structure is open,
+and sunlight streams in.\n")
+               :               ($say
+                    "The structure is closed at the top, but
+enough light comes in from between the boards to enable you to see.\n")
+                       )
+       : {else} ($say
+                                              "  Against
+the house is a heavy ")
+               (($prop toolbox OPEN):
+                       ($say "toolbox with the lid open.\n")
+       {               (($cont toolbox) :
+                               ($say "In the toolbox, you see:\n")
+                               ($setp toolbox CONTS TRUE)
+                               (Slook 1 ($cont toolbox))
+                               ($setp toolbox CONTS FALSE)
+                       )}
+               :{else} (($prop toolbox LOCKD) :
+                               ($say "toolbox with a rusty lock, painted
+with an insignia composed of blue and green squares, joined at
+their corners.\n") :
+                               ($say "toolbox, the lid of which is ajar.\n")
+                       )
+               )
+       );
+
+toolbox(SDESC) =
+               (($eq ($loc .ME) toolbox):
+                       ($say   "Inside huge box.\n")
+               :{else} ($say "a toolbox"));
+
+toolbox(ACTION) =
+       (($eq ($loc .ME) toolbox) :
+               (($or ($eq ($verb) drop)
+                     ($eq ($verb) throw)):
+                       ($say "You just lost ")(($sdisc ($dobj)))
+                       ($say " in a crack between the wooden floorboards!\n")
+                       ($move ($dobj) .ALL)
+               )
+               ($miss cg cg cg cg cg cg cg cg cg cg)
+
+       {else} :
+               (($eq ($verb) lock):
+                   (Lockup toolbox keys "The toolbox seals with a CLICK!\n"))
+               (($eq ($verb) unlock):
+                   (Ulock toolbox keys
+"One of the keys fits!  The toolbox can be opened now.\n")
+               )
+       );
+
+NOUN signpost(roadx);
+signpost(RDLOC)=10;
+signpost(WEIGH)=CAPAC;
+signpost(LDESC)=($say "There is a signpost by the side of the road.\n");
+signpost(SDESC)=($say "a signpost");
+signpost(ACTION) = (($eq ($verb) read):
+                       ($say
+"Pointing east, it says: 'Unuchevala: 10 miles'\n")
+                       ($exit 1)
+                   );
+NOUN globe(toolbox);
+globe(WEIGH) = 20;
+globe(LDESC) = (($prop globe LIGHT):
+                       ($say "A globe of stone glows brightly here.\n")
+               {else}:
+                 ($say "There is a strange globe of polished stone here.\n")
+               );
+globe(SDESC) = (($prop globe LIGHT): ($say "a glowing globe of stone")
+                                  :  ($say "a stone globe"));
+globe(ACTION) = (($eq ($verb) rub):
+                   (($prop globe LIGHT):
+                       ($say "The light from the stone globe fades away.\n")
+                       ($setp globe LIGHT FALSE)
+                  {else}:
+                       ($say "The stone globe glows brightly!\n")
+                       ($setp globe LIGHT TRUE)
+                   )
+                   ($setg LOOKP TRUE)
+                   ($exit 1)
+               )
+               ;
+
+
+NOUN crowbar (town3);
+crowbar(WEIGH) = 100;
+crowbar(LDESC) = ($say "There is a long crowbar here.\n");
+crowbar(SDESC) = ($say "a crowbar");
+
+crydie =
+                       ($say
+"What POWER!  The magic crystal releases a flood of energy in
+a split-second!  Unfortunately, you were a little close...\n")
+                       (die);
+
+
+
+     { Dragon Stuff }
+       AWAKE=MISC1;
+
+NOUN dragon (cel06);
+
+
+white=clear;
+NOUN green crystal(cel07);
+NOUN red crystal(cel08);
+NOUN blue crystal(cel10);
+NOUN clear crystal(cel09);
+
+{NOUN diamond  { = clear crystal;
+{NOUN sapphire{=  blue crystal;
+{NOUN ruby (cel08){= red crystal;
+{NOUN emerald (cel07){= green crystal;}
+
+
+green crystal(WEIGH)=15;
+green crystal(POINT)=25;
+green crystal(LDESC) = ($say "There is a beautiful green crystal here!\n");
+green crystal(SDESC) = ($say "a green crystal");
+
+green crystal(ACTION) =
+       (($eq ($verb) take):
+              (($eq ($loc .ME) cel07):
+                       (($not ($prop dragon AWAKE)):
+                               ($say "You hear a stirring in the Ice Cavern.\n")
+                               ($setg Tempr ($plus @Tempr 2))
+                               ($setp dragon AWAKE TRUE)
+                               ($setp cel06 VISIT FALSE)
+
+                       :{else} ($setg Tempr 0)
+                       )
+               )
+       )
+       (($eq ($verb) drop):
+              (($eq ($loc .ME) cel07):
+                       ($setg Tempr ($minus @Tempr 2))
+                       (($le @Tempr 0) :
+                               ($setp dragon AWAKE FALSE)
+                               ($say
+"You hear a deep  Y A W N  from the Cavern.\n"))
+                       ($setp cel06 VISIT FALSE)
+               )
+       )
+       (($eq ($verb) touch):
+               (($eq ($dobj) [red crystal]) :
+                       ($say "The red and green crystals flare briefly!\n")
+                       (Grow)
+                       ($move .ME cel01)
+                       ($setg LOOKP TRUE)
+                       ($exit 1)
+               )
+               (($eq ($dobj) [blue crystal]) :
+                       ($say "The blue and green crystals flare briefly!\n")
+                       ($move .ME toolbox)
+                       (Shrink)
+                       ($setg LOOKP TRUE)
+                       ($exit 1)
+               )
+       )
+       (($eq ($verb) break):
+               (($eq ($dobj) [green crystal]):
+                       (crydie)
+               )
+       );
+ROUTINE CRout;
+WORKD = MISC1;                 { Has Clear crystal shed its light? }
+red crystal(WEIGH)=15;
+red crystal(POINT)=25;
+red crystal(LDESC) = ($say "There is a beautiful red crystal here!\n");
+red crystal(SDESC) = ($say "a red crystal");
+red crystal(ACTION) =
+       (($eq ($verb) touch):
+               (($eq ($dobj) [clear crystal]) :
+                   (($not ($prop [clear crystal] WORKD)):
+                       ($say "The red and clear crystals flare briefly!\n")
+                       ($setp [clear crystal] WORKD TRUE)
+                       ($setp [clear crystal] LIGHT TRUE)
+                       ($say
+"The clear crystal blazes forth with a magical incandescence brilliant
+enough to penetrate even the deepest darkness!!\n\n")
+                       ($sfus CRout 4)
+                       ($setg LOOKP TRUE)
+                       ($exit 1)
+            {else} :
+                       ($say
+"The clear crystal seems curiously inert now.\n")
+                       ($exit 1)
+                   )
+               )
+               (($eq ($dobj) [green crystal]) :
+                       ($say "The red and green crystals flare briefly!\n")
+                       (Grow)
+                       ($move .ME cel01)
+                       ($setg LOOKP TRUE)
+                       ($exit 1)
+               )
+       )
+       (($eq ($verb) break):
+               (($eq ($dobj) [red crystal]):
+                       (crydie)
+               )
+       );
+
+
+blue crystal(WEIGH)=15;
+blue crystal(POINT)=25;
+blue crystal(LDESC) = ($say "There is a beautiful blue crystal here!\n");
+blue crystal(SDESC) = ($say "a blue crystal");
+blue crystal(ACTION) =
+       (($eq ($verb) touch):
+               (($eq ($dobj) [red crystal]) :
+                       ($say "The red and blue crystals flare briefly!\n")
+                       ($exit 1)
+               )
+               (($eq ($dobj) [green crystal]) :
+                       ($say "The blue and green crystals flare briefly!\n")
+                       ($move .ME toolbox)
+                       (Shrink)
+                       ($setg LOOKP TRUE)
+                       ($exit 1)
+               )
+       )
+       (($eq ($verb) break):
+               (($eq ($dobj) [blue crystal]):
+                       (crydie)
+               )
+       );
+
+
+CRout = ($say "The glowing magical crystal seems to have gone dark.\n> ")
+       ($setp [clear crystal] LIGHT FALSE)
+       ;
+clear crystal(WEIGH)=15;
+clear crystal(POINT)=25;
+clear crystal(LDESC) = ($say "There is a beautiful clear crystal here")
+                      (($prop [clear crystal] LIGHT): ($say " (GLOWING!)"))
+                      ($say "!\n");
+clear crystal(SDESC) = ($say "a clear crystal")
+                      (($prop [clear crystal] LIGHT): ($say " (GLOWING!)"))
+                      ;
+clear crystal(ACTION) =
+       (($eq ($verb) touch):
+               (($eq ($dobj) [red crystal]) :
+                   (($not ($prop [clear crystal] WORKD)):
+                       ($say "The red and clear crystals flare briefly!\n")
+                       ($setp [clear crystal] WORKD TRUE)
+                       ($setp [clear crystal] LIGHT TRUE)
+                       ($say
+"The clear crystal blazes forth with a magical incandescence brilliant
+enough to penetrate even the deepest darkness!!\n\n")
+                       ($setg LOOKP TRUE)
+                       ($sfus CRout 4)
+                       ($exit 1)
+            {else} :
+                       ($say
+"The clear crystal seems curiously inert now.\n")
+                       ($exit 1)
+                   )
+               )
+       )
+       (($eq ($verb) break):
+               (($eq ($dobj) [red crystal]):
+                       (crydie)
+               )
+       );
+
+
+
+ROUTINE DRdem;          { Dragon Daemon.  Increases temper in .my presence }
+DRdem=  (($not ($prop dragon AWAKE)): ($exit 0))
+       (($eq ($loc .ME) ($loc dragon)):
+               (($eq ($loc [green crystal]) .ME):      { even worse! }
+                       ($setg Tempr ($plus @Tempr 1)))
+               ($setg Tempr ($plus @Tempr 1))  )
+{       ($say "His temper is now at ")($num @Tempr)($say "\n")  }
+       (($ge @Tempr 7):
+               ($say
+"Jeez, I didn't know ice dragons could reach their boiling point!
+In a final flare of rage, he opens his mouth and breathes his frigid
+breath in a blast in your direction.  It's a bit much for you.\n")
+               (die)
+        )
+       (($ge @Tempr 6) :
+               ($say "Gee, he looks like he's really at the edge!\n")
+               ($exit 0))
+       (($ge @Tempr 5) :
+               ($say "This is one upset dragon!  Be careful!\n")
+               ($exit 0))
+       (($ge @Tempr 3) :
+               ($say "He's getting angrier...\n")($exit 0))
+               ;
+
+dragon(WEIGH)=CAPAC;
+dragon(LDESC)=
+               (($prop dragon AWAKE):
+                       ($say
+"There is a fierce ice dragon glaring balefully in your direction.\n")
+               :{else}
+                       ($say
+"There is a large white dragon sleeping peacefully in the middle
+of the cavern floor.\n")
+               )
+               (DRdem);
+dragon(SDESC)=
+               (($prop dragon AWAKE): ($say "a fierce dragon")
+                                    : ($say "a somnolent dragon")
+               )
+               (@LOOKP: ($say "\n") (DRdem))
+               ;
+
+dragon(ACTION)=                 { Man, the things you can try here... }
+       (($prop dragon AWAKE):          { This is the harder stuff }
+               (($eq ($verb) strike):
+                       ($say "This just seems to get him angrier!\n")
+                       ($setg Tempr ($plus @Tempr 1))
+                       ($exit 1))
+               (($eq ($verb) throw):
+                       (($eq ($iobj) dragon):
+                               (($gt ($prop ($dobj) WEIGH) 75):
+                                       ($say
+                       "This just bruises him!  Now he's getting mad!\n")
+                                       ($setg Tempr ($plus @Tempr 1))
+                                       ($exit 1) :
+                               {else}
+                                       ($say
+                       "That object is just too light to hurt him.\n")
+                                       ($exit 1)
+                               )
+                       :       ($say "This amuses the dragon no end!\n")
+                               ($exit 1)
+                       ))              { end of Throw  case}
+       :{else}
+                                       { he's snoozing}
+               (($eq ($verb) wake):
+                       ($say "You manage to waken him.  He's not happy.\n")
+                       ($setg Tempr 1)
+                       ($setp dragon AWAKE TRUE)
+                       ($exit 1))
+               (($eq ($verb) strike):
+                       ($say "Now you woke him up!  He's upset, too!\n")
+                       ($setg Tempr 2)
+                       ($setp dragon AWAKE TRUE)
+                       ($exit 1))
+               (($eq ($verb) throw):
+                       (($eq ($iobj) dragon):
+                               (($gt ($prop ($dobj) WEIGH) 75):
+                                       ($say
+       "It's just heavy enough to waken him.  The bruise doesn't help
+his temper any either.\n")
+                                       ($setp dragon AWAKE TRUE)
+                                       ($setg Tempr 3)
+                                       ($exit 1) :
+                               {else}
+                                       ($say
+                       "That object is just too light to wake him.\n")
+                                       ($exit 1)
+                               )
+                       :       ($say "Don't hurt yourself trying!\n")
+                               ($exit 1)
+                       ))              { end of Throw  case}
+               );
+
+
+
+
+NOUN bed (farm7);
+bed(WEIGH) = CAPAC;
+bed(SDESC) = ($say "an old, rickety bed");
+
+bed(ACTION) =
+       (($eq ($verb) move):
+               (($prop bed OPEN) :
+                       ($say "Stop messing with the bed, it's fragile!\n")
+                       ($exit 1)
+               )
+               ($say
+"Moving the bed seems to have loosened one of the wall panels
+on the west wall.\n")
+               ($setp bed OPEN TRUE)
+               ($exit 1)
+       );
+
+NOUN panel (farm7);
+panel(OPENS) = TRUE;
+panel(WEIGH) = CAPAC;
+panel(ACTION) =
+       (($or ($eq ($verb) open)
+             ($eq ($verb) pry) ):
+               (($and ($eq ($iobj) crowbar)
+                  ($eq ($loc crowbar) .ME)):
+                       (($not ($prop bed OPEN)):
+                               ($say "There aren't any loose enough.\n")
+                               ($exit 1))
+                       ($say
+"The loose panel comes away, revealing a secret stairway down, down...\n")
+                       ($setp panel OPEN TRUE)
+         {else}:
+                       ($say "You can't seem to get the panel open.\n")
+               )
+               ($exit 1)
+
+       );
+
+NOUN knife (farm6);
+knife(LDESC)=
+       (($prop farm6 VISIT):
+               ($say "There is a carving knife here.\n")
+       :{else} ($say "However,
+on the table is a large carving knife (suitable for blind mice).\n")
+       );
+knife(SDESC)=($say "a carving knife");
+
+
+
+NOUN bottle(town6);
+bottle (LDESC) = ($say "There is a bottle here.\n");
+bottle (SDESC) = ($say "a bottle");
+bottle (TRANS) = TRUE;
+bottle (ACTION) =
+               (($eq ($verb) open):
+                       ($say "Hm, the bottle is somehow sealed shut.\n")
+                       ($exit 1))
+               (($eq ($verb) break):
+                       ($say "Wow, is that heavy glass!  It won't break!\n")
+                       ($exit 1))
+               (($eq ($verb) strike):
+                       (($eq ($iobj) bottle):
+                          ($say "Weird thing to do with it.\n")
+                    :     ($say "Nice try, but it isn't even scratched.\n")
+                       )
+                       ($exit 1));
+
+NOUN ship(bottle);
+ship (LDESC) = ($say "There is a model ship here.\n");
+ship (SDESC) = ($say "a model ship");
+ship (POINT) = 50;
+
+ROUTINE TWN5y;
+NOUN well(town5);
+well (WEIGH) = CAPAC;
+well (ACTION) =
+       (($eq ($iobj) well):
+               (($eq ($verb) put):
+                       (cdrop)
+                       (TWN5y)
+                       ($exit 1)
+               )
+       );
+
+NOUN insignia;
+insignia (WEIGH) = CAPAC;
+insignia (ACTION) = ($say "There's nothing useful to do with the insignia.\n")
+                   ($exit 1);
+square=insignia;
+
+NOUN glass box(cel08);
+glass box(HOLDS)=1;
+glass box(TRANS)=TRUE;
+glass box(OPENS)=TRUE;
+glass box(OPEN)=FALSE;
+glass box(SHRNK)=TRUE;          { First seen as a tiny box }
+glass box(LDESC) =
+               (($eq ($prop .ME SHRNK) ($prop [glass box] SHRNK)):
+                       ($say "There is a big glass case here.\n")
+                       ($setp [glass box] WEIGH CAPAC)
+                       ($setp [glass box] HOLDS 50)
+
+               {else}:
+                       (($prop .ME SHRNK):
+                               ($say
+"Before you looms a huge glass wall, inscribed with the words,
+       'program error!'\n")
+                       {else} :
+                               ($say
+"There is a tiny glass box with a snap lid here.\n")
+                               ($setp [glass box] WEIGH 5)
+                               ($setp [glass box] HOLDS 1)
+
+                       )
+               );
+glass box(SDESC) =
+               (($eq ($prop .ME SHRNK) ($prop [glass box] SHRNK)):
+                       ($say "a glass case")
+                       ($setp [glass box] WEIGH CAPAC)
+                       ($setp [glass box] HOLDS 50)
+
+               {else}:
+                       (($prop .ME SHRNK):
+                               ($say
+"a huge glass wall, inscribed with the words,
+       'program error'")
+                       {else} :
+                               ($say "a tiny glass box")
+                               ($setp [glass box] WEIGH 5)
+                               ($setp [glass box] HOLDS 1)
+
+                       )
+               );
+case=glass box;
+
+NOUN sand(glass box);
+sand(SHRNK)=TRUE;
+sand(WEIGH)=1;
+sand(LDESC)=(($and ($prop sand SHRNK)
+                  ($not ($prop .ME SHRNK))):
+                       ($setp sand POINT 0)
+                       ($say "There is a grain of sand here.\n")
+
+               {else}: ($say "There is a beautiful porcelain statue here!\n")
+                       ($setp sand POINT 50)
+               );
+sand(SDESC)=(($and ($prop sand SHRNK)
+                  ($not ($prop .ME SHRNK))):
+                       ($setp sand POINT 0)
+                       ($say "a grain of sand") :
+                       ($say "a porcelain statue")
+                       ($setp sand POINT 50)
+               );
+statue=sand;
+sand(ACTION)=(($eq ($verb) take):
+                     (($and ($prop sand SHRNK)
+                            ($not ($prop .ME SHRNK))):
+           ($say "You fumble the grain of sand and lose it on the ground.\n")
+                                       ($move sand .ALL)
+                                       ($exit 1)
+                       )
+               );
+
+NOUN hole;
+
+
+NOUN rock(road5);
+rock(LDESC)=($say "There is a plain-looking rock here.\n");
+rock(SDESC)=($say "an ordinary rock");
+rock(ACTION)=
+               (($and ($eq ($verb) take)
+                      ($eq ($dobj) rock)):
+                               ($say "Mmph!  Heavy!\n"));
+rock(WEIGH)=100;
+{
+{NOUN saw(toolbox);
+{saw(WEIGH) = 20;
+{saw(LDESC) = ($say "There is a saw here.\n");
+{saw(SDESC) = ($say "a saw");
+{saw(ACTION) = (($eq ($verb) cut):
+{                      (($eq ($dobj) hole):
+{                              (($eq ($loc .ME) cel13):
+{                                      (($prop cel13 HOLED):
+{                                              ($say "There's already one here!\n")
+{                                              ($exit 1)
+{                              :{else}
+{                                              ($say
+{"You cut a hole in the thick ice; icy water sloshes about two feet down.\n")
+{                                              ($setp cel13 HOLED TRUE)
+{                                              ($move hole cel13)
+{                                              ($exit 1)
+{                                      )
+{                              )
+{                         { cutting a hole somewhere else }
+{                         ($say "There's nowhere to cut a hole.\n")
+{                         ($exit 1)
+{                      )
+{                      ($say "The saw isn't used that way.\n")
+{                      ($exit 1)
+{              );      /* I Know A better way to make a Hole */}
diff --git a/usr/src/games/ddl/sample/routines.ddl b/usr/src/games/ddl/sample/routines.ddl
new file mode 100644 (file)
index 0000000..a090812
--- /dev/null
@@ -0,0 +1,223 @@
+ROUTINE VisP;
+VisP =                          { (Visp List Propno) => True IFF an object }
+(($eq %1 0) : ($rtrn FALSE))   {       is visible on List that has Propno }
+(($prop %1 %2) :
+       ($rtrn TRUE))                   { Found one! }
+(($or ($prop %1 OPEN)
+      ($prop %1 TRANS)):                { Look inside...}
+       ( (VisP ($cont %1) %2): ($rtrn TRUE) ))
+($rtrn (VisP ($link %1) %2))
+;
+
+ROUTINE Reach;                  { (Reach obj loc) => True IFF the obj   }
+Reach =                         {       IS the loc or can be reached    }
+(($eq %2 0) : ($rtrn FALSE))    {       by the loc }
+(($eq %1 %2): ($rtrn TRUE))
+                       { Still explore inside }
+(($prop %2 OPEN):
+       ((Reach %1 ($cont %2)): ($rtrn TRUE))
+)
+($rtrn  (Reach %1 ($link %2)))
+
+;
+
+ROUTINE See;                  { (See obj loc) => True IFF the obj   }
+See   =                         {       IS the loc or can be seen       }
+(@DARKG: ($rtrn FALSE))                { Can't see in a dark room! }
+(($eq %2 0) : ($rtrn FALSE))
+(($eq %1 %2): ($rtrn TRUE))
+(($or  ($prop %2 TRANS)                 { Still explore inside }
+       ($prop %2 OPEN)):
+       ((See   %1 ($cont %2)): ($rtrn TRUE))
+)
+($rtrn  (See   %1 ($link %2)))
+;
+
+Avail =
+       (($eq ($loc %1) .ME) : ($rtrn TRUE))    { shd be closure, really }
+       (($not %1):($say "The what?\n")($exit 1))
+       (($not (See %1 ($cont ($loc .ME)))):
+               ($say "I can't see that item here.\n")
+               ($exit 1)
+         )
+       (($not (Reach %1 ($cont ($loc .ME)))):
+               ($say "I can't get at that item.\n")
+               ($exit 1)
+         )
+       (($and ($prop .ME SHRNK)
+              ($not ($prop %1 SHRNK))  ):
+                      (($ne ($loc %1) .ME):
+                               ($say
+"Right now, ")(($sdisc %1))($say " is too big for you to deal with.\n")
+                               ($exit 1)
+                       )
+         )
+       ($rtrn TRUE)
+;
+
+ROUTINE LitP;
+LitP =                          { (LitP Room) => True IFF Room is lit }
+(($prop %1 LIGHT) : ($rtrn TRUE))
+(($or (VisP ($cont %1) LIGHT)
+      (VisP ($cont %1) FLAME)): ($rtrn TRUE))
+
+(($or (VisP ($cont .ME) LIGHT)                  { Check .ME 'cause invisibl }
+      (VisP ($cont .ME) FLAME)): ($rtrn TRUE))
+($rtrn FALSE)
+;
+
+ROUTINE Blank;
+Blank =                         { Blank n => Type n blanks }
+(($gt %1 0):
+       ($say "  ")
+       (Blank ($minus %1 1)));
+
+ROUTINE Llook; ROUTINE Slook;
+Llook =                         { (Llook Level Object) describes Object }
+(($eq %2 0) : ($exit 0))
+(($eq %1 0) :                   { Level 0 == This is a room.  Check lighting }
+       ((LitP %2):
+               ($setg DARKG FALSE)
+               (($ldisc %2))           { Talk about the room }
+               (($not @DARKG):
+                       (Llook 1 ($cont %2))    { Talk about its contents }
+               )
+       {else}:
+               ($say "It's mighty dark in here!\n")
+               ($setg DARKG TRUE)
+       )
+
+{else} :                        { Level > 0 == This is a list of objs }
+       ( ($ldisc %2)   :       { Talk (only) about the visible }
+               (Blank %1)                      { Indent }
+               (($ldisc %2))           { Blurb the object }
+
+               ( ($cont %2):      { something inside it...}
+                       (($or ($prop %2 OPEN)($prop %2 TRANS)):
+                               (Blank %1)
+                               ($say "It contains:\n")
+                               ($setp %2 CONTS TRUE)
+                               (Slook ($plus %1 1) ($cont %2))
+                                       { Short descriptions for contents }
+                       )
+               )
+        )
+       (Llook %1 ($link %2))
+);
+
+
+Slook =                         { (Llook Level Object) describes Object }
+(($eq %2 0) : ($exit 0))
+(($eq %1 0) :                   { Level 0 == This is a room.  Check lighting }
+       ((LitP %2):
+               ($setg DARKG FALSE)
+               (($sdisc %2))           { Talk about the room }
+               (($not @DARKG):
+                       ($setp %2 CONTS FALSE)
+                       (Slook 1 ($cont %2))    { Talk about its contents }
+               )
+       {else}:
+               ($say "It's mighty dark in here!\n")
+               ($setg DARKG TRUE)
+       )
+
+{else} :                        { Level > 0 == This is a list of objs }
+       (($sdisc %2) :          { Talk (only) about the visible }
+               (($not ($prop ($loc %2) CONTS)):
+                       (Blank ($minus %1 1))
+                       ($say "You can see:\n")
+                       ($setp ($loc %2) CONTS TRUE)
+               )
+               (Blank %1)                      { Indent }
+               (($sdisc %2))           { Blurb the object }
+               (($and ($ne ($cont %2) 0)       { something inside it...}
+                      ($or ($prop %2 OPEN)     {...and you can see it }
+                           ($prop %2 TRANS)
+                       )
+                 ):
+
+                       ($setp %2 CONTS TRUE)
+                       ($say ", containing:\n")
+                       (Slook ($plus %1 1) ($cont %2))
+                                       { Short descriptions for contents }
+                  :    ($say "\n")
+
+               )
+       )
+       ( Slook %1 ($link %2))
+
+);
+
+
+
+
+LOOK =
+
+
+
+       ($setg WASDK @DARKG)
+       (@LOOKP :
+               (($prop ($loc .ME) VISIT):
+                       (Slook 0 ($loc .ME))
+                {else} :
+                       (Llook 0 ($loc .ME))
+                       ($setp ($loc .ME) VISIT TRUE)
+               )
+               (@DARKG : ($setp ($loc .ME) VISIT FALSE))
+       )
+       ($setg LOOKP FALSE)
+       ($itun)
+       ($say "\n> ")
+;
+
+ROUTINE GrowX; ROUTINE ShrnX;
+GrowX = (($prop %1 SHRNK):
+               ($setp %1 SHRNK FALSE)
+               (($cont %1):
+                       (GrowX ($cont %1)))
+               (($link %1):
+                       (GrowX ($link %1)))
+       )
+       ;
+
+Grow = (($prop .ME SHRNK):
+               ($setp .ME SHRNK FALSE)
+               (($cont .ME):
+                       (GrowX ($cont .ME)))
+       )
+;
+
+ShrnX = (($not ($prop %1 SHRNK)):
+               ($setp %1 SHRNK TRUE)
+               (($cont %1):
+                       (ShrnX ($cont %1)))
+               (($link %1):
+                       (ShrnX ($link %1)))
+{else}  :
+               ($say "You hear a tiny POP as ")(($sdisc %1))
+               ($say " vanishes completely!\n")
+               (($link %1):
+                       (ShrnX ($link %1)))
+               ($move %1 .ALL)
+       )
+
+;
+
+Shrink = (($not ($prop .ME SHRNK)):
+               ($setp .ME SHRNK TRUE)
+               (($cont .ME):
+                       (ShrnX ($cont .ME)))
+       )
+;
+
+WzTgl =                        { Toggle the Wizard flag }
+       ($setg Wizrd ($not @Wizrd))
+       (@Wizrd:
+               ($say
+"You hear a low rumble of thunder, shaking the very ground on
+which you stand.  Suddenly, there is a blazing flash of light!!
+You are unharmed, but feal great power flowing in your body.\n")
+       {else}:
+               ($say
+"Your wizardly powers unceremoniously fade away.\n")
+       );
diff --git a/usr/src/games/ddl/sample/sample.ddl b/usr/src/games/ddl/sample/sample.ddl
new file mode 100644 (file)
index 0000000..ef877d5
--- /dev/null
@@ -0,0 +1,26 @@
+
+INCLUDE "constants.ddl";
+
+PREP with;
+PREP to;
+PREP into,  in;
+PREP at;
+
+INCLUDE "locnames.ddl";
+
+NOUN .ME (road1);
+.ME(OPEN) = TRUE;
+.ME(HOLDS) = CAPAC;
+
+INCLUDE "routines.ddl";
+
+INCLUDE "verbs.ddl";
+
+START = ($sdem LOOK)
+       ($setg LOOKP TRUE)
+       ($setv n s e w ne nw se sw u d)
+       ;
+
+INCLUDE "objects.ddl";
+INCLUDE "locales.ddl";
+INCLUDE "transit.ddl";
diff --git a/usr/src/games/ddl/sample/sample.ideas b/usr/src/games/ddl/sample/sample.ideas
new file mode 100644 (file)
index 0000000..772ecb9
--- /dev/null
@@ -0,0 +1,89 @@
+Things to add to sample DDL dungeon:
+
+       A point to the whole thing.
+
+       A redressing of the Temple to Elbereth.  The Tolkien reference
+       is pointless.  There should be more motifs of paganism
+       throughout the area (which is why the locals burned the place).
+
+       In fact, depending on your philosophical/political bent, you
+       could have the original owner of the house being held prisoner
+       by the local Calvinists in the church up the road.  Your
+       mission is to rescue him.  Your "score" can be used to
+       purchase some useful item rather than being an end in itself.
+
+       The forest and cornfields are pointless.  Something should
+       be done about that.
+
+       The sandy beach should lead to some caverns which ultimately
+       get you to a large lake.  Somehow, the ship should be
+       removed from the Bottle for transit on this lake. (I'd hate
+       to Shrink again, tho).  For example, maybe the innocent-looking
+       lake is really filled with deadly acid, which even burns
+       through the Bottle.  So you toss the bottle into the lake
+       and suddenly freed, the magic ship grows, extends a gangplank...
+       Of course, there may be something else aboard, too.
+
+       Getting the Globe into those caves should be problematical.
+
+       The Glowing crystal shouldn't be the only one that only works
+       a limited number of times.
+
+       Another mechanism for getting that hole into the ice would
+       be nice.  The Saw is too general a tool.
+               (DONE.  Present version has you dropping a heavy
+                object onto the ice.  A useless heavy object is
+                available)
+
+       Speaking of general tools, what's the knife for?
+
+       Beyond the icy lake lives a cavebear.  When you leave
+       your junk lying around for too long on the lake, he comes
+       by and swipes stuff (driven by a fuse).  He leaves footprints,
+       but finding him and subduing him should be another problem.  
+       Some fillip should be added for him to be more than just 
+       a recostuming of the Pirate.
+
+       The riverbed should go somewhere.  There's that deadly lake,
+       of course.
+
+       The caverns above the really DARK caverns probably adjoin
+       the Sandy Beach system somehow.
+
+       The Dark Caves should have some point.
+
+       The mural really leads to a desert (under some circumstances).
+       In the desert, the "hwy8" trick can be extended for 2-d movement.
+       Crossing before thirst sets in should be the problem.  A
+       water-detector (you're getting warmer...colder...right here!)
+       should be available in the basement.  Crossing the desert
+       should lead to a ruined city, with some stuff, then a road,
+       back to ... highway 8 ( a *long* way down the road).
+
+       More treasure!  More treasure!  Greed!!!
+
+       Player should have to SAY something somewhere, to demonstrate
+       that feature.  Better be simple, tho.
+               (DONE.  Current incantation is "ShaZam")
+
+       For elegance, the BEAM and GRAB (and maybe a new PROP command
+       to turn on some object property) should only work if you do
+       some simple Wizardly trick.  It should let you know you've
+       done this.  This trick should be revealed within the game
+       to cognescenti.
+               (DONE.  Say Shazam.  Also, the GLOW and Open tricks
+                have been added)
+
+       While each crystal is worth $25, there should be some stunt
+       that involves using the explosive power of destroying a crystal.
+       Say, an indestructible chamber in which one of the crystals
+       is placed.  Push a button, and the contents are normally reduced
+       to powder.  Put a crystal in, and the power of the explosion drives
+       some kind of mechanism/magic that provides more treasure.  Or,
+       now that the crystal can be broken harmlessly, maybe a small
+       fragment remaining can be placed into some small aperture
+       that obviously requires a crystal, thus triggering some mechanism.
+       Some harmless stone or something should be made available to
+       the player to demonstrate the crusher's use.  It's a crock in
+       even Zork that you sometimes have to die or destroy treasure
+       to test things out.
diff --git a/usr/src/games/ddl/sample/transit.ddl b/usr/src/games/ddl/sample/transit.ddl
new file mode 100644 (file)
index 0000000..87bda96
--- /dev/null
@@ -0,0 +1,439 @@
+{*** TRANSITIONS ***}
+       hitms = (($eq ($verb) %1) :
+                       (%2 : ($move .ME %2))
+                       ($setg GO TRUE)
+                       (%3: (($parm 3)))
+               )
+               ;
+       synvb = (($eq ($verb) %1) :
+                       ($setg Verb %2));
+road1(ACTION) = ($setv n s e w ne nw se sw u d)
+               (hitms n gard1 0)
+               (hitms s gard5 0)
+               (hitms e road2 0)
+               (hitms w road3 0)
+               (hitms ne gard2 0)
+               (hitms nw gard3 0)
+               (hitms se gard6 0)
+               (hitms sw gard7 0)
+               ;
+
+road2(ACTION) = 
+               (hitms n gard2 0)
+               (hitms s gard6 0)
+               (hitms e road7 0)
+               (hitms w road1 0)
+               (hitms ne gard2 0)
+               (hitms nw gard1 0)
+               (hitms se gard6 0)
+               (hitms sw gard5 0)
+               ;
+
+road3(ACTION) = 
+               (hitms n gard3 0)
+               (hitms s gard7 0)
+               (hitms e road1 0)
+               (hitms w road8 entr8)
+               (hitms ne gard1 0)
+               (hitms nw gard3 0)
+               (hitms se gard5 0)
+               (hitms sw gard7 0)
+               ;
+
+road4(ACTION) = 
+               (hitms n farm1 0)
+               (hitms s road7 0)
+               (hitms e frst1 0)
+               (hitms w gard2 0)
+               (hitms ne frst1 0)
+               (hitms nw gard2 0)
+               (hitms se frst1 0)
+               (hitms sw gard2 0)
+               ;
+
+road5(ACTION) = 
+               (hitms n road7 0)
+               (hitms s road6 0)
+               (hitms e frst1 0)
+               (hitms w gard6 0)
+               (hitms ne frst1 0)
+               (hitms nw gard6 0)
+               (hitms se frst1 0)
+               (hitms sw gard6 0)
+               ;
+
+road6(ACTION) = 
+               (hitms n road5 0)
+               (hitms s town1 0)
+               (hitms e frst1 0)
+               (hitms w gard6 0)
+               (hitms ne frst1 0)
+               (hitms nw gard6 0)
+               (hitms se frst1 0)
+               (hitms sw gard6 0)
+               ;
+
+road7(ACTION) = 
+               (hitms n road4 0)
+               (hitms s road5 0)
+               (hitms e frst1 0)
+               (hitms w road2 0)
+               (hitms ne frst1 0)
+               (hitms nw gard2 0)
+               (hitms se frst1 0)
+               (hitms sw gard6 0)
+               ;
+
+road8(ACTION) = ($miss tress tress east8 west8 0 0 0 0 0 0);
+
+east8 = 
+       ($setg GO TRUE)
+       ( ($eq @HWY8 0) : ($move .ME road3)
+      { ELSE } :        (dump8 ($cont road8))
+                       ($setg HWY8 ($minus @HWY8 1))
+                       (get8 ($cont roadx))
+                       (Slook 0 ($loc .ME))
+                       ($setg LOOKP FALSE)
+               );
+
+west8 =
+               ($setg GO TRUE)
+                       (dump8 ($cont road8))
+                       ($setg HWY8 ($plus @HWY8 1))
+                       (get8 ($cont roadx))
+                       (Slook 0 ($loc .ME))
+                       ($setg LOOKP FALSE);
+
+dump8 = (($link %1) : (dump8 ($link %1)))       { start at bottom }
+       (($ne %1 .ME) :                 { Everything else leaves }
+               ($setp %1 RDLOC @HWY8)  { Retain its location on HWY 8 }
+               ($move %1 roadx)        { Put it in the box }
+       );
+
+get8 =  ( %1 :
+               (get8 ($link %1))
+               (($eq ($prop %1 RDLOC) @HWY8) :
+                       ($move %1 road8)
+               )
+       );
+
+entr8 =         (dump8 ($cont road8))
+               ($setg HWY8 0)
+               (get8 ($cont roadx));
+
+
+
+
+
+
+gard1(ACTION) = 
+               (hitms n gard4 0)
+               (hitms s road1 0)
+               (hitms e gard2 0)
+               (hitms w gard3 0)
+               ;
+
+gard2(ACTION) = 
+               (hitms n gard4 0)
+               (hitms s road2 0)
+               (hitms e gard2 0)
+               (hitms w gard1 0)
+               ;
+
+gard3(ACTION) = 
+               (hitms n gard4 0)
+               (hitms s road3 0)
+               (hitms e gard1 0)
+               (hitms w gard3 0)
+               ;
+
+gard4(ACTION) = 
+               (hitms n gard4 0)
+               (hitms s gard1 0)
+               (hitms e gard2 0)
+               (hitms w gard3 0)
+               ;
+
+
+gard5(ACTION) = 
+               (hitms n road1 0)
+               (hitms s gard8 0)
+               (hitms e gard6 0)
+               (hitms w gard7 0)
+               ;
+
+gard6(ACTION) = 
+               (hitms n road2 0)
+               (hitms s gard8 0)
+               (hitms e gard6 0)
+               (hitms w gard5 0)
+               ;
+
+gard7(ACTION) = 
+               (hitms n road3 0)
+               (hitms s gard8 0)
+               (hitms e gard5 0)
+               (hitms w gard7 0)
+               ;
+
+gard8(ACTION) = 
+               (hitms n gard5 0)
+               (hitms s gard8 0)
+               (hitms e gard6 0)
+               (hitms w gard7 0)
+               ;
+
+
+
+
+frst1(ACTION) = 
+               (hitms n frst3 0)
+               (hitms s frst1 0)
+               (hitms e frst2 0)
+               (hitms w frst2 0)
+               ;
+
+frst2(ACTION) = 
+               (hitms n frst1 0)
+               (hitms s frst2 0)
+               (hitms e frst2 0)
+               (hitms w frst1 0)
+               ;
+
+frst3(ACTION) = 
+               (hitms n frst1 0)
+               (hitms s frst4 0)
+               (hitms e frst2 0)
+               (hitms w frst2 0)
+               ;
+
+frst4(ACTION) = 
+               (hitms n frst3 0)
+               (hitms s frst2 0)
+               (hitms e frst1 0)
+               (hitms w road7 0)
+               ;
+
+
+farm1 (ACTION) =
+               (synvb enter north)
+               
+               (hitms n farm2 0)
+               (hitms s road4 0)
+               (hitms e farm3 0)
+               (hitms w farm4 0)
+               (hitms ne farm3 0)
+               (hitms nw farm4 0)
+               ;
+
+farm2 (ACTION) =
+               (synvb out s)
+               (synvb enter n)
+               (synvb east up)
+
+               (hitms n farm6 0)
+               (hitms s farm1 0)
+               (hitms up farm7 0)
+               ;
+
+farm3 (ACTION) =
+               (hitms n farm5 0)
+               (hitms s farm1 0)
+               (hitms e frst1 0)
+               (hitms nw farm5 0)
+               (hitms sw farm1 0)
+               ;
+
+farm4 (ACTION) =
+               (hitms n farm5 0)
+               (hitms s farm1 0)
+               (hitms w gard4 0)
+               (hitms ne farm5 0)
+               (hitms se farm1 0)
+               ;
+
+farm5 (ACTION) =
+               (hitms e farm3 0)
+               (hitms w farm4 0)
+               (hitms se farm3 0)
+               (hitms sw farm4 0)
+               ;
+
+farm6 (ACTION) =
+               (hitms out farm2 0)
+               (hitms s farm2 0)
+               ;
+farm7 (ACTION) =
+               (hitms e farm2 0)
+               (hitms d farm2 PanL)
+                ;
+
+
+town1 (ACTION) =
+               (hitms n road6 0)
+               (hitms s town2 0)
+               (hitms e town3 0)
+               (hitms w town4 0)
+               ;
+
+town2 (ACTION) =
+               (hitms n town1 0)
+               (hitms e town5 0)
+               (hitms w town6 0)
+               ;
+
+town3 (ACTION) =
+               (hitms out town1 0)
+               (hitms w town1 0)
+               ;
+
+town4 (ACTION) =
+               (hitms e town1 0)
+               (hitms out town1 0)
+               ;
+
+town5 (ACTION) =
+               (hitms w town2 0)
+               (hitms out town2 0)
+               (TWN5x);
+
+town6 (ACTION) =
+               (hitms e town2 0)
+               (hitms out town2 0)
+               ;
+
+
+cel01 (ACTION) = 
+
+               (hitms n cel02 0)
+               (hitms s 0 ny)
+               (hitms w cel04 0)
+               (hitms u farm7 0)
+               ;
+cel02 (ACTION) =
+               (hitms n cel05 0)
+               (hitms s cel01 0)
+               (hitms e 0 ny)
+               ;
+
+cel03 (ACTION) =
+               (hitms s cel05 0)
+               (hitms w cel13 0)
+               (hitms ne cel09 0)
+               (hitms d cel09 0)
+               ;
+
+cel04 (ACTION) =
+               (synvb down north)
+               (hitms n cel10 0)
+               (hitms e cel01 0)
+               (hitms w cel08 0)
+               ;
+
+
+MV56=($setg Cel6x 5);
+MV76=($setg Cel6x 7);
+MV67=( ($and ($ne @Cel6x 7)
+            ($prop dragon AWAKE)): ($say
+"The ice dragon blocks your attempt to cross!\n\n")
+               :         ($move .ME cel07) );
+
+MV65=( ($and ($ne @Cel6x 5)
+            ($prop dragon AWAKE)): ($say
+"The ice dragon blocks your attempt to leave!\n")
+               :         ($move .ME cel05) );
+
+
+cel05 (ACTION) =
+               (hitms n cel03 0)
+               (hitms s cel02 0)
+               (hitms ne cel06 MV56)
+               ;
+
+cel06 (ACTION) =
+               (hitms e 0 MV67)
+               (hitms w 0 MV65)
+               (($eq ($loc .ME) cel06) {still here}:
+                       ($setg LOOKP TRUE)
+               )
+                 ;
+
+cel07 (ACTION) =
+               (synvb out west)
+               (hitms w cel06 MV76)
+               ;
+
+cel08 (ACTION) =
+               (hitms e cel04 0)
+               (hitms w 0 ny)
+               ;
+
+cel09 (ACTION) =
+               (hitms n 0 ny)
+               ;
+
+cel10 (ACTION) =
+               (hitms s cel04 0)
+               (hitms d cel11 0)
+               ;
+
+cel11 (ACTION) =
+               (hitms e cel12 0)
+               (hitms n 0 ny)
+               ;
+
+cel12 (ACTION) =
+               (hitms n cel11 0)
+               (hitms e 0 ny)
+               ;
+
+cel13 (ACTION) = (($eq ($verb) down):
+                       (($prop cel13 HOLED):
+                               ($say "You plunge into the icy waters!\n")
+                               ($move .ME cel14)
+                               ($exit 1)
+                       )
+                 )
+                 (($eq ($verb) drop):
+                   (cdrop)
+                   (($not ($prop cel13 HOLED)):
+                       (($ge ($prop ($dobj) WEIGH)
+                             ($prop [red crystal] WEIGH)
+                        ):
+                               ($say 
+"You have broken the ice!  You watch helplessly as ")
+                               (($sdisc ($dobj)))
+                               ($say "
+sinks swiftly into the dark and frigid depths.\n")
+                               ($setp cel13 HOLED TRUE)
+                               ($move hole cel13)
+                               ($move ($dobj) .ALL)
+                               ($exit 1)
+                       {else}:                 {give him a hint}
+                               ($say
+"The icy floor chips a little, but remains intact.\n")
+                       )
+                  )
+                  ($exit 1)
+               )
+               (hitms e cel03 0)
+               (hitms w 0 ny)
+               ;
+
+cel14 (ACTION) =
+               (($eq ($verb) up):
+                       (($prop cel13 HOLED):
+                           ($say "You pop out through a hole in the ice!\n")
+                           ($move .ME cel13)
+                           ($exit 1)
+               :{else}
+                           ($say  "You are blocked by an icy roof above!\n")
+                        )
+                )
+               (hitms w cel15 0)
+               
+               (($eq ($loc .ME) cel14):        { Poor sap didn't move.}
+                               ($say
+"Your breath expires.  The last thing you feel is the odd sensation
+of water filling your lungs.  ") (die)
+               );
diff --git a/usr/src/games/ddl/sample/verbs.ddl b/usr/src/games/ddl/sample/verbs.ddl
new file mode 100644 (file)
index 0000000..9844d4d
--- /dev/null
@@ -0,0 +1,355 @@
+cg = ($say "Can't go that way.\n");
+ny = ($say "That exit seems impassable today!?\n");
+
+die = ($say "You are dead.  Better luck next time.\n")
+      ($spec 3 0 0 0 0);
+
+VERB n,s,e,w,ne,se,nw,sw;
+VERB up,down;
+VERB enter,out;
+
+u=up; d=down;
+north=n; south=s; east=e; west=w;
+
+Looks = ($setg LOOKP TRUE)(($dobj): ($say "Huh?\n")($exit 1));
+ccg =  (($not @GO) :
+               (cg)
+       )
+       ($setg GO FALSE)
+       ;
+
+
+n (PREACT) = Looks; n (ACTION) = ccg;
+s (PREACT) = Looks; s (ACTION) = ccg;
+e (PREACT) = Looks; e (ACTION) = ccg;
+w (PREACT) = Looks; w (ACTION) = ccg;
+
+nw(PREACT) = Looks; nw(ACTION) = ccg;
+ne(PREACT) = Looks; ne(ACTION) = ccg;
+sw(PREACT) = Looks; sw(ACTION) = ccg;
+se(PREACT) = Looks; se(ACTION) = ccg;
+
+u (PREACT) = Looks; u (ACTION) = ccg;
+d (PREACT) = Looks; d (ACTION) = ccg;
+
+out (PREACT) = Looks;  out(ACTION) = ccg;
+enter (PREACT) = Looks; enter(ACTION) = ccg;
+
+VERB say;
+say (PREACT) =
+       (($not ($dobj)):
+               ($say "Type just what you want to say: ")
+               ($setg Dobj ($read)))
+       (($ge ($dobj) 0) :
+               ($say "You want to make ")
+               (($sdisc ($dobj)))
+               ($say " a linguistic artifact??  Strange!\n")
+               ($exit 1));
+say (ACTION) = 
+       (($eqst ($dobj) Shazm) :
+               (WzTgl)
+       :{else}
+               ($say "Very well.  '")($say ($dobj))($say "'.\n"));
+incant = say; chant = say; shout = say; yell = say;
+
+VERB take; VERB drop;
+take(PREACT) = (Avail ($dobj))
+       (($eq ($prop ($dobj) WEIGH) CAPAC):
+               ($say "You can't take that!\n")
+               ($exit 1)
+       )
+       (($ge ($plus ($prop .ME HAS)
+                    ($prop ($dobj) WEIGH))
+             ($prop .ME HOLDS)):
+               ($say "You can't carry that much more!\n")
+               ($exit 1)
+       );
+drop(PREACT) = 
+               (($ne ($loc ($dobj)) .ME) :
+               ($say "You don't have it with you.\n")($exit 1));
+ROUTINE ctake; ROUTINE cdrop;
+
+
+DWIMD = (($not (See ($dobj) ($cont ($loc .ME)))):
+               ($rtrn 0)
+         )
+       (($not (Reach ($dobj) ($cont ($loc .ME)))):
+               ($rtrn 0)
+         )
+       (($and ($eq ($verb) take) ($eq ($loc ($dobj)) .ME)):
+               ($rtrn 0)
+         )
+       (($and ($eq ($verb) drop) ($ne ($loc ($dobj)) .ME)):
+               ($rtrn 0)
+         )
+       ($rtrn 1)
+;
+
+DWIMI = (($not (See ($iobj) ($cont ($loc .ME)))):
+               ($rtrn 0)
+         )
+       (($not (Reach ($iobj) ($cont ($loc .ME)))):
+               ($rtrn 0)
+         )
+       (($and ($eq ($verb) take) ($eq ($loc ($iobj)) .ME)):
+               ($rtrn 0)
+         )
+       (($and ($eq ($verb) drop) ($ne ($loc ($iobj)) .ME)):
+               ($rtrn 0)
+         )
+
+       ($rtrn 1)
+;
+
+
+
+
+
+take(ACTION) = (ctake);
+ctake =
+       ($setp .ME HAS ($plus ($prop .ME HAS) ($prop ($dobj) WEIGH) ) )
+       {($say "You are holding ")($num ($prop .ME HAS))($say " lbs.\n")}
+       ($say "Taken.\n") ($move ($dobj) .ME)
+       ;
+
+drop(ACTION) = (cdrop);
+cdrop = 
+       ($say "Dropped.\n") ($move ($dobj) ($loc .ME))
+       ($setp .ME HAS ($minus ($prop .ME HAS)($prop ($dobj) WEIGH)))
+       ;
+
+VERB put;
+put (PREACT) =
+       (($ne ($loc ($dobj)) .ME) :
+               ($say "You don't have it with you.\n")($exit 1))
+       (Avail ($iobj));
+put(ACTION) =
+       (($not ($and ($prop ($iobj) OPEN)
+                    ($prop ($iobj) OPENS))):
+               ($say "You can't seem to manage that trick.\n")($exit 0))
+       (($gt ($plus ($prop ($iobj) HAS)
+                    ($prop ($dobj) WEIGH))
+             ($prop ($iobj) HOLDS)):
+               ($say "It won't fit!\n")($exit 0))
+       ($say "OK\n") ($move ($dobj) ($iobj))
+       ($setp ($iobj) HAS ($plus ($prop ($iobj) HAS) ($prop ($dobj) WEIGH)))
+       ;
+
+
+
+
+
+
+
+
+
+VERB open; VERB close;
+open(PREACT) = (Avail ($dobj))(($iobj):(Avail ($iobj)));
+close(PREACT) = (Avail ($dobj))(($iobj):(Avail ($iobj)));
+open(ACTION) =
+       (($not ($prop ($dobj) OPENS)):
+               ($say "I don't know how to open that!\n")($exit 0))
+       (($and ($prop ($dobj) LOCKS)
+              ($prop ($dobj) LOCKD)):
+               ($say "I can't open it, it's locked!\n")($exit 0))
+       (($prop ($dobj) OPEN):
+               ($say "It's already open!\n")($exit 0))
+       ($setp ($dobj) OPEN TRUE)
+       ($say "Opened.\n")
+       (($and  ($ne 0 ($cont ($dobj)))  ($not ($prop ($dobj) TRANS))):
+               (Llook 1 ($cont ($dobj)))
+       )
+       ;
+
+close (ACTION) =
+       (($not ($prop ($dobj) OPENS)):
+               ($say "I don't know how to close that!\n")($exit 0))
+       (($not ($prop ($dobj) OPEN)):
+               ($say "It's already closed!\n")($exit 0))
+       ($setp ($dobj) OPEN FALSE)
+       ($say "Closed\n")
+       ;
+
+
+VERB lock; VERB unlock;
+lock(PREACT) = (Avail ($dobj))(($iobj):(Avail ($iobj)));
+unlock(PREACT) = (Avail ($dobj))(($iobj):(Avail ($iobj)));
+
+Lockact =
+       (($prop ($dobj) LOCKS) :
+               ($say "Hm, you don't seem to have the right key.\n")
+       {else}:
+               ($say "I don't know how to lock or unlock such a thing.\n")
+       );
+
+lock(ACTION) = Lockact;
+unlock(ACTION) = Lockact;
+
+Lockup =
+       (($prop %1 OPEN):
+               ($say "You must close it first.\n")($exit 1))
+       (($prop %1 LOCKD):
+               ($say "It's already locked!\n")($exit 1))
+       (($not ($prop %1 LOCKS)):($exit 0))
+       (($eq ($loc %2) .ME):
+               ($say %3)
+               ($setp %1 LOCKD TRUE)
+               ($exit 1))
+               ;
+Ulock  =
+       (($not($prop %1 LOCKD)):
+               ($say "It's already unlocked!\n")($exit 1))
+       (($not ($prop %1 LOCKS)):($exit 0))
+       (($eq ($loc %2) .ME):
+               ($say %3)
+               ($setp %1 LOCKD FALSE)
+               ($exit 1))
+               ;
+
+
+
+
+VERB move;
+move(PREACT) = (Avail ($dobj));
+move(ACTION) =
+($say "Nothing seems to happen.\n");
+push=move;
+pull=move;
+lift=move;
+
+VERB break;
+break(PREACT) = (Avail ($dobj));
+break(ACTION) =
+($say "It seems to be unbreakable.\n");
+
+VERB wake;
+wake(PREACT) = (Avail ($dobj));
+wake(ACTION) = ($say "I don't know how to wake ")(($sdisc ($dobj)))
+               ($say ".\n");
+
+VERB strike; hit=strike; kill=strike;
+strike(PREACT) = (Avail ($dobj))
+                (($iobj):
+                       (($ne ($loc ($iobj)) .ME):
+                               ($say "You don't have it with you.\n")
+                               ($exit 1)
+                        )
+                 );
+strike(ACTION) = ($say "Hitting ")(($sdisc ($dobj)))($say
+ " doesn't seem to do anything.");
+
+VERB touch;  feel=touch;
+touch(PREACT) = (Avail ($dobj))
+               (($iobj):
+                      (($ne ($loc ($iobj)) .ME):
+                               ($say "You don't have it with you.\n")
+                               ($exit 1)
+                       )
+               );
+touch(ACTION) = ($say "Touching ")(($sdisc ($dobj)))
+               ($say " doesn't seem too useful.\n");
+
+
+
+
+
+
+VERB rub;
+rub(PREACT) = (Avail ($dobj));
+rub(ACTION) = ($say "Nothing happens when you rub ")
+               (($sdisc ($dobj)))($say ".\n");
+
+VERB cut;
+cut(PREACT) = (($not ($iobj)): ($say "You need tools to do that.\n")
+                              ($exit 1))
+             (Avail ($iobj));
+
+VERB pry;
+pry(PREACT) =  (Avail ($dobj))
+              (($not ($iobj)): ($say "You need tools to do that.\n")
+                               ($exit 1))
+              (Avail ($iobj));
+
+pry(ACTION) =  ($say "I can't seem to manage that.\n");
+
+VERB throw;
+throw(PREACT) = (($ne ($loc ($dobj)) .ME): ($say "You aren't holding it!\n")
+                                          ($exit 1));
+throw(ACTION) = ($move ($dobj) ($loc .ME))
+               ($say "Thrown.\n");
+
+VERB read;
+read(PREACT) = (Avail ($dobj));
+read(ACTION) = ($say "It doesn't have anything on it to read.\n");
+
+VERB light;
+light(PREACT) = (Avail ($dobj));
+
+tress = ($say "You were warned about trespassing! The fence is electrified!\n")
+       (die);
+
+
+
+VERB look;
+VERB quit;
+VERB inven;
+VERB score;
+VERB save;
+VERB restore;
+
+look(ACTION) = (Llook 0 ($loc .ME))
+                     ;
+inven(ACTION) = (($not ($cont .ME)):
+                       ($say "You are empty-handed.\n")
+                       ($exit 1))
+               ($setp .ME CONTS TRUE)
+               ($say "You are carrying:\n")
+               (Slook 1 ($cont .ME))
+                       ;
+quit(ACTION) = ($spec 3 0 0 0 0);
+
+score(ACTION) =
+       (($eq ($loc .ME) town5):
+               ($say
+"A mysterious glowing network of lights appears, and you can
+just make out the words:
+   Your account is now at $")
+               ($num @SCORE)
+               ($say ".
+   Thank you for letting Arpa-Citizen's be your host.\n")
+               ($say
+"The network then disappears.\n")
+       {else}:
+               ($say
+"Hmm, you'll have to check at the local bank.\n"));
+
+
+save(ACTION) = ($spec 4 0 0 0 0);
+restore(ACTION) = ($spec 5 0 0 0 0);
+
+VERB Debug, BEAM, JOIN, Open, GLOW,GRAB;
+WizP = (($not @Wizrd) :
+               ($say "Only a real Wizard can do that!\n")
+               ($exit 1)
+       );
+Debug(PREACT) = WizP;
+BEAM(PREACT) = WizP;
+GRAB(PREACT) = WizP;
+JOIN(PREACT) = WizP;
+Open(PREACT) = WizP;
+GLOW(PREACT) = WizP;
+
+Debug(ACTION) = ($spec 8 8 0 0 0);
+BEAM(ACTION) = ($move .ME ($dobj))
+               ($setg LOOKP TRUE);
+JOIN(ACTION) = ($move .ME ($loc ($dobj)))
+               ($setg LOOKP TRUE);
+Open(ACTION) = ($setp ($dobj) OPEN TRUE)($say "Opened.\n");
+GLOW(ACTION) = ($setp .ME LIGHT ($not ($prop .ME LIGHT)))
+               (($prop .ME LIGHT) : ($say 
+"Your body begins to radiate a strong but gentle white light!\n")
+               :       ($say
+"The light from your body fades away.\n"));
+GRAB(ACTION) = ($say "You have the ")($name ($dobj))($say ", Boss!\n")
+               ($move ($dobj) .ME);
+
diff --git a/usr/src/games/monop/:rofix b/usr/src/games/monop/:rofix
new file mode 100644 (file)
index 0000000..cd5fa24
--- /dev/null
@@ -0,0 +1,3 @@
+g/^[   ]*\.data/s//.text/
+w
+q
diff --git a/usr/src/games/monop/cards.c b/usr/src/games/monop/cards.c
new file mode 100644 (file)
index 0000000..b61d50d
--- /dev/null
@@ -0,0 +1,170 @@
+# include      "monop.ext"
+
+/*
+ *     These routine deal with the card decks
+ */
+
+# define       GOJF    'F'     /* char for get-out-of-jail-free cards  */
+
+# ifndef DEV
+static char    *cardfile       = "/usr/games/lib/cards.pck";
+# else
+static char    *cardfile       = "cards.pck";
+# endif
+
+static FILE    *deckf;
+
+/*
+ *     This routine initializes the decks from the data file,
+ * which it opens.
+ */
+init_decks() {
+
+       if ((deckf=fopen(cardfile, "r")) == NULL) {
+file_err:
+               perror(cardfile);
+               exit(1);
+       }
+       if (fread(deck, sizeof (DECK), 2, deckf) != 2)
+               goto file_err;
+       set_up(&CC_D);
+       set_up(&CH_D);
+}
+/*
+ *     This routine sets up the offset pointers for the given deck.
+ */
+set_up(dp)
+DECK   *dp; {
+
+       reg int r1, r2;
+       int     i;
+
+       dp->offsets = (long *) calloc(sizeof (long), dp->num_cards);
+       if (fread(dp->offsets, sizeof(long), dp->num_cards, deckf) != dp->num_cards) {
+               perror(cardfile);
+               exit(1);
+       }
+       dp->last_card = 0;
+       dp->gojf_used = FALSE;
+       for (i = 0; i < dp->num_cards; i++) {
+               reg long        temp;
+
+               r1 = roll(1, dp->num_cards) - 1;
+               r2 = roll(1, dp->num_cards) - 1;
+               temp = dp->offsets[r2];
+               dp->offsets[r2] = dp->offsets[r1];
+               dp->offsets[r1] = temp;
+       }
+}
+/*
+ *     This routine draws a card from the given deck
+ */
+get_card(dp)
+DECK   *dp; {
+
+       reg char        type_maj, type_min;
+       reg int         num;
+       int             i, per_h, per_H, num_h, num_H;
+       OWN             *op;
+
+       do {
+               fseek(deckf, dp->offsets[dp->last_card], 0);
+               dp->last_card = ++(dp->last_card) % dp->num_cards;
+               type_maj = getc(deckf);
+       } while (dp->gojf_used && type_maj == GOJF);
+       type_min = getc(deckf);
+       num = getw(deckf);
+       printmes();
+       switch (type_maj) {
+         case '+':             /* get money            */
+               if (type_min == 'A') {
+                       for (i = 0; i < num_play; i++)
+                               if (i != player)
+                                       play[i].money -= num;
+                       num = num * (num_play - 1);
+               }
+               cur_p->money += num;
+               break;
+         case '-':             /* lose money           */
+               if (type_min == 'A') {
+                       for (i = 0; i < num_play; i++)
+                               if (i != player)
+                                       play[i].money += num;
+                       num = num * (num_play - 1);
+               }
+               cur_p->money -= num;
+               break;
+         case 'M':             /* move somewhere       */
+               switch (type_min) {
+                 case 'F':             /* move forward */
+                       num -= cur_p->loc;
+                       if (num < 0)
+                               num += 40;
+                       break;
+                 case 'J':             /* move to jail */
+                       goto_jail();
+                       return;
+                 case 'R':             /* move to railroad     */
+                       spec = TRUE;
+                       num = (int)((cur_p->loc + 5)/10)*10 + 5 - cur_p->loc;
+                       break;
+                 case 'U':             /* move to utility      */
+                       spec = TRUE;
+                       if (cur_p->loc >= 12 && cur_p->loc < 28)
+                               num = 28 - cur_p->loc;
+                       else {
+                               num = 12 - cur_p->loc;
+                               if (num < 0)
+                                       num += 40;
+                       }
+                       break;
+                 case 'B':
+                       num = -num;
+                       break;
+               }
+               move(num);
+               break;
+         case 'T':                     /* tax                  */
+               if (dp == &CC_D) {
+                       per_h = 40;
+                       per_H = 115;
+               }
+               else {
+                       per_h = 25;
+                       per_H = 100;
+               }
+               num_h = num_H = 0;
+               for (op = cur_p->own_list; op; op = op->next)
+                       if (op->sqr->type == PRPTY)
+                               if (op->sqr->desc->houses == 5)
+                                       ++num_H;
+                               else
+                                       num_h += op->sqr->desc->houses;
+               num = per_h * num_h + per_H * num_H;
+               printf("You had %d Houses and %d Hotels, so that cost you $%d\n", num_h, num_H, num);
+               if (num == 0)
+                       lucky("");
+               else
+                       cur_p->money -= num;
+               break;
+         case GOJF:            /* get-out-of-jail-free card    */
+               cur_p->num_gojf++;
+               dp->gojf_used = TRUE;
+               break;
+       }
+       spec = FALSE;
+}
+/*
+ *     This routine prints out the message on the card
+ */
+printmes() {
+
+       reg char        c;
+
+       printline();
+       fflush(stdout);
+       while ((c = getc(deckf)) != '\0')
+               putchar(c);
+       printline();
+       fflush(stdout);
+}
diff --git a/usr/src/games/monop/cards.inp b/usr/src/games/monop/cards.inp
new file mode 100644 (file)
index 0000000..1867e87
--- /dev/null
@@ -0,0 +1,122 @@
+FF
+>> GET OUT OF JAIL FREE <<
+Keep this card until needed or sold
+%%
+++25
+Receive for Services $25.
+%%
+++200
+Bank Error in Your Favor.
+Collect $200.
+%%
+++20
+Income Tax Refund.
+Collect $20.
+%%
+--100
+Pay Hospital $100
+%%
+++100
+Life Insurance Matures.
+Collect $100
+%%
+++45
+From sale of Stock You get $45.
+%%
+TX
+You are Assessed for street repairs.
+       $40 per House
+       $115 per Hotel
+%%
+++100
+X-mas Fund Matures.
+Collect $100.
+%%
+++11
+You have won Second Prize in a Beauty Contest
+Collect $11
+%%
+MF0
+Advance to GO
+(Collect $200)
+%%
+++100
+You inherit $100
+%%
+--150
+Pay School Tax of $150.
+%%
+MJ
+               >> GO TO JAIL <<
+Go Directly to Jail. Do not pass GO  Do not collect $200.
+%%
++A50
+               >> GRAND OPERA OPENING <<
+Collect $50 from each player for opening night seats.
+%%
+--50
+Doctor's Fee:  Pay $50.
+%-
+FF
+>> GET OUT OF JAIL FREE <<
+Keep this card until needed or sold
+%%
+MR
+Advance to the nearest Railroad, and pay owner
+Twice the rental to which he is otherwise entitled.
+If Railroad is unowned you may buy it from the bank
+%%
+MU
+Advance to the nearest Utility.
+If unowned, you may buy it from the bank.
+If owned, throw dice and pay oner a total of ten times
+the amount thrown.
+%%
+MB3
+Go Back 3 Spaces
+%%
+MR
+Advance to the nearest Railroad, and pay owner
+Twice the rental to which he is otherwise entitled.
+If Railroad is unowned you may buy it from the bank
+%%
+MJ
+    >> GO DIRECTLY TO JAIL <<
+Do not pass GO, Do not Collect $200.
+%%
+MF5
+Take a Ride on the Reading.
+If you pass GO, collect $200.
+%%
+MF39
+Take a Walk on the Board Walk.
+    (Advance To Board Walk)
+%%
+MF24
+Advance to Illinos Ave.
+%%
+MF0
+Advance to Go
+%%
+MF11
+Advance to St. Charles Place.
+If you pass GO, collect $200.
+%%
+TX
+Make general repairs on all of your Property.
+For Each House pay $25.
+For Each Hotel pay $100.
+%%
+-A50
+You have been elected Chairman of the Board.
+Pay each player $50.
+%%
+--15
+Pay Poor Tax of $15
+%%
+++50
+Bank pays you Dividend of $50.
+%%
+++150
+Your Building and Loan Matures.
+Collect $150.
diff --git a/usr/src/games/monop/deck.h b/usr/src/games/monop/deck.h
new file mode 100644 (file)
index 0000000..3363612
--- /dev/null
@@ -0,0 +1,13 @@
+# define       bool    char
+
+# define       CC_D    deck[0]
+# define       CH_D    deck[1]
+
+struct dk_st {                 /* deck description structure           */
+       int     num_cards;              /* number of cards in deck      */
+       int     last_card;              /* number of last card picked   */
+       bool    gojf_used;              /* set if gojf card out of deck */
+       long    *offsets;               /* offests for start of cards   */
+};
+
+typedef struct dk_st   DECK;
diff --git a/usr/src/games/monop/getinp.c b/usr/src/games/monop/getinp.c
new file mode 100644 (file)
index 0000000..838f589
--- /dev/null
@@ -0,0 +1,79 @@
+# include      <stdio.h>
+# include      <ctype.h>
+
+# define       reg     register
+
+# define       LINE    70
+
+static char    buf[257];
+
+getinp(prompt, list)
+char   *prompt, *list[]; {
+
+       reg int i, n_match, match;
+       char    *sp;
+       int     plen;
+
+
+       for (;;) {
+inter:
+               printf(prompt);
+               for (sp = buf; (*sp=getchar()) != '\n'; )
+                       if (*sp == -1)  /* check for interupted system call */
+                               goto inter;
+                       else if (sp != buf || *sp != ' ')
+                               sp++;
+               if (buf[0] == '?' && buf[1] == '\n') {
+                       printf("Valid inputs are: ");
+                       for (i = 0, match = 18; list[i]; i++) {
+                               if ((match+=(n_match=strlen(list[i]))) > LINE) {
+                                       printf("\n\t");
+                                       match = n_match + 8;
+                               }
+                               if (*list[i] == '\0') {
+                                       match += 8;
+                                       printf("<RETURN>");
+                               }
+                               else
+                                       printf(list[i]);
+                               if (list[i+1])
+                                       printf(", ");
+                               else
+                                       putchar('\n');
+                               match += 2;
+                       }
+                       continue;
+               }
+               *sp = '\0';
+               for (sp = buf; *sp; sp++)
+                       if (isupper(*sp))
+                               *sp = tolower(*sp);
+               for (i = n_match = 0; list[i]; i++)
+                       if (comp(list[i])) {
+                               n_match++;
+                               match = i;
+                       }
+               if (n_match == 1)
+                       return match;
+               else if (buf[0] != '\0')
+                       printf("Illegal response: \"%s\".  Use '?' to get list of valid answers\n", buf);
+       }
+}
+
+static
+comp(s1)
+char   *s1; {
+
+       reg char        *sp, *tsp, c;
+
+       if (buf[0] != '\0')
+               for (sp = buf, tsp = s1; *sp; ) {
+                       c = isupper(*tsp) ? tolower(*tsp) : *tsp;
+                       tsp++;
+                       if (c != *sp++)
+                               return 0;
+               }
+       else if (*s1 != '\0')
+               return 0;
+       return 1;
+}
diff --git a/usr/src/games/monop/houses.c b/usr/src/games/monop/houses.c
new file mode 100644 (file)
index 0000000..8f525b8
--- /dev/null
@@ -0,0 +1,230 @@
+# include      "monop.ext"
+
+static char    *names[N_MON+2],
+               cur_prop[80];
+
+static MON     *monops[N_MON];
+
+/*
+ *     These routines deal with buying and selling houses
+ */
+buy_houses() {
+
+       reg int num_mon;
+       reg MON *mp;
+       reg OWN *op;
+       bool    good,got_morg;
+       int     i,p;
+
+over:
+       num_mon = 0;
+       good = TRUE;
+       got_morg = FALSE;
+       for (op = cur_p->own_list; op && op->sqr->type != PRPTY; op = op->next)
+               continue;
+       while (op)
+               if (op->sqr->desc->monop) {
+                       mp = op->sqr->desc->mon_desc;
+                       names[num_mon] = (monops[num_mon]=mp)->name;
+                       num_mon++;
+                       got_morg = good = FALSE;
+                       for (i = 0; i < mp->num_in; i++) {
+                               if (op->sqr->desc->morg)
+                                       got_morg++;
+                               if (op->sqr->desc->houses != 5)
+                                       good++;
+                               op = op->next;
+                       }
+                       if (!good || got_morg)
+                               --num_mon;
+               }
+               else
+                       op = op->next;
+       if (num_mon == 0) {
+               if (got_morg)
+                       printf("You can't build on mortgaged monopolies.\n");
+               else if (!good)
+                       printf("You can't build any more.\n");
+               else
+                       printf("But you don't have any monopolies!!\n");
+               return;
+       }
+       if (num_mon == 1)
+               buy_h(monops[0]);
+       else {
+               names[num_mon++] = "done";
+               names[num_mon--] = 0;
+               if ((p=getinp("Which property do you wish to buy houses for? ", names)) == num_mon)
+                       return;
+               buy_h(monops[p]);
+               goto over;
+       }
+}
+
+buy_h(mnp)
+MON    *mnp; {
+
+       reg int i;
+       reg MON *mp;
+       reg int price;
+       shrt    input[3],temp[3];
+       int     tot;
+       PROP    *pp;
+
+       mp = mnp;
+       price = mp->h_cost * 50;
+blew_it:
+       list_cur(mp);
+       printf("Houses will cost $%d\n", price);
+       printf("How many houses do you wish to buy for\n");
+       for (i = 0; i < mp->num_in; i++) {
+               pp = mp->sq[i]->desc;
+over:
+               if (pp->houses == 5) {
+                       printf("%s (H):\n", mp->sq[i]->name);
+                       input[i] = 0;
+                       temp[i] = 5;
+                       continue;
+               }
+               sprintf(cur_prop, "%s (%d): ", mp->sq[i]->name, pp->houses);
+               input[i] = get_int(cur_prop);
+               temp[i] = input[i] + pp->houses;
+               if (temp[i] > 5) {
+                       printf("That's too many.  The most you can buy is %d\n",
+                               5 - pp->houses);
+                               goto over;
+                       }
+       }
+       if (mp->num_in == 3 && (abs(temp[0] - temp[1]) > 1 ||
+           abs(temp[0] - temp[2]) > 1 || abs(temp[1] - temp[2]) > 1)) {
+err:           printf("That makes the spread too wide.  Try again\n");
+               goto blew_it;
+       }
+       else if (mp->num_in == 2 && abs(temp[0] - temp[1]) > 1)
+               goto err;
+       for (tot = i = 0; i < mp->num_in; i++)
+               tot += input[i];
+       if (tot) {
+               printf("You asked for %d houses for $%d\n", tot, tot * price);
+               if (getyn("Is that ok? ", yn) == 0) {
+                       cur_p->money -= tot * price;
+                       for (tot = i = 0; i < mp->num_in; i++)
+                               mp->sq[i]->desc->houses = temp[i];
+               }
+       }
+}
+
+/*
+ *     This routine sells houses.
+ */
+sell_houses() {
+
+       reg int num_mon;
+       reg MON *mp;
+       reg OWN *op;
+       bool    good;
+       int     p;
+
+over:
+       num_mon = 0;
+       good = TRUE;
+       for (op = cur_p->own_list; op; op = op->next)
+               if (op->sqr->type == PRPTY && op->sqr->desc->monop) {
+                       mp = op->sqr->desc->mon_desc;
+                       names[num_mon] = (monops[num_mon]=mp)->name;
+                       num_mon++;
+                       good = 0;
+                       do
+                               if (!good && op->sqr->desc->houses != 0)
+                                       good++;
+                       while (op->next && op->sqr->desc->mon_desc == mp
+                           && (op=op->next));
+                       if (!good)
+                               --num_mon;
+               }
+       if (num_mon == 0) {
+               printf("You don't have any houses to sell!!\n");
+               return;
+       }
+       if (num_mon == 1)
+               sell_h(monops[0]);
+       else {
+               names[num_mon++] = "done";
+               names[num_mon--] = 0;
+               if ((p=getinp("Which property do you wish to sell houses from? ", names)) == num_mon)
+                       return;
+               sell_h(monops[p]);
+               notify();
+               goto over;
+       }
+}
+
+sell_h(mnp)
+MON    *mnp; {
+
+       reg int i;
+       reg MON *mp;
+       reg int price;
+       shrt    input[3],temp[3];
+       int     tot;
+       PROP    *pp;
+
+       mp = mnp;
+       price = mp->h_cost * 25;
+blew_it:
+       printf("Houses will get you $%d apiece\n", price);
+       list_cur(mp);
+       printf("How many houses do you wish to sell from\n");
+       for (i = 0; i < mp->num_in; i++) {
+               pp = mp->sq[i]->desc;
+over:
+               if (pp->houses == 0) {
+                       printf("%s (0):\n", mp->sq[i]->name);
+                       input[i] = temp[i] = 0;
+                       continue;
+               }
+               if (pp->houses < 5)
+                       sprintf(cur_prop,"%s (%d): ",mp->sq[i]->name,pp->houses);
+               else
+                       sprintf(cur_prop,"%s (H): ",mp->sq[i]->name,pp->houses);
+               input[i] = get_int(cur_prop);
+               temp[i] = pp->houses - input[i];
+               if (temp[i] < 0) {
+                       printf("That's too many.  The most you can sell is %d\n", pp->houses);
+                               goto over;
+                       }
+       }
+       if (mp->num_in == 3 && (abs(temp[0] - temp[1]) > 1 ||
+           abs(temp[0] - temp[2]) > 1 || abs(temp[1] - temp[2]) > 1)) {
+err:           printf("That makes the spread too wide.  Try again\n");
+               goto blew_it;
+       }
+       else if (mp->num_in == 2 && abs(temp[0] - temp[1]) > 1)
+               goto err;
+       for (tot = i = 0; i < mp->num_in; i++)
+               tot += input[i];
+       if (tot) {
+               printf("You asked to sell %d houses for $%d\n",tot,tot * price);
+               if (getyn("Is that ok? ", yn) == 0) {
+                       cur_p->money += tot * price;
+                       for (tot = i = 0; i < mp->num_in; i++)
+                               mp->sq[i]->desc->houses = temp[i];
+               }
+       }
+}
+
+list_cur(mp)
+reg MON        *mp; {
+
+       reg int         i;
+       reg SQUARE      *sqp;
+
+       for (i = 0; i < mp->num_in; i++) {
+               sqp = mp->sq[i];
+               if (sqp->desc->houses == 5)
+                       printf("%s (H) ", sqp->name);
+               else
+                       printf("%s (%d) ", sqp->name, sqp->desc->houses);
+       }
+       putchar('\n');
+}
diff --git a/usr/src/games/monop/initdeck.c b/usr/src/games/monop/initdeck.c
new file mode 100644 (file)
index 0000000..d0c7a3c
--- /dev/null
@@ -0,0 +1,140 @@
+# include      <stdio.h>
+# include      "deck.h"
+
+/*
+ *     This program initializes the card files for monopoly.
+ * It reads in a data file with Com. Chest cards, followed by
+ * the Chance card.  The two are seperated by a line of "%-".
+ * All other cards are seperated by lines of "%%".  In the front
+ * of the file is the data for the decks in the same order.
+ * This includes the seek pointer for the start of each card.
+ * All cards start with their execution code, followed by the
+ * string to print, terminated with a null byte.
+ */
+
+# define       TRUE    1
+# define       FALSE   0
+
+# define       bool    char
+# define       reg     register
+
+char   *infile         = "cards.inp",          /* input file           */
+       *outfile        = "cards.pck";          /* "packed" file        */
+
+long   ftell();
+
+DECK   deck[2];
+
+FILE   *inf, *outf;
+
+main(ac, av)
+int    ac;
+char   *av[]; {
+
+       getargs(ac, av);
+       if ((inf = fopen(infile, "r")) == NULL) {
+               perror(infile);
+               exit(1);
+       }
+       count();
+       /*
+        * allocate space for pointers.
+        */
+       CC_D.offsets = calloc(CC_D.num_cards + 1, sizeof (long));
+       CH_D.offsets = calloc(CH_D.num_cards + 1, sizeof (long));
+       fseek(inf, 0L, 0);
+       if ((outf = fopen(outfile, "w")) == NULL) {
+               perror(outfile);
+               exit(0);
+       }
+
+       fwrite(deck, sizeof (DECK), 2, outf);
+       fwrite(CC_D.offsets, sizeof (long), CC_D.num_cards, outf);
+       fwrite(CH_D.offsets, sizeof (long), CH_D.num_cards, outf);
+       putem();
+
+       fclose(inf);
+       fseek(outf, 0, 0L);
+       fwrite(deck, sizeof (DECK), 2, outf);
+       fwrite(CC_D.offsets, sizeof (long), CC_D.num_cards, outf);
+       fwrite(CH_D.offsets, sizeof (long), CH_D.num_cards, outf);
+       fclose(outf);
+       printf("There were %d com. chest and %d chance cards\n", CC_D.num_cards, CH_D.num_cards);
+       exit(0);
+}
+
+getargs(ac, av)
+int    ac;
+char   *av[]; {
+
+       if (ac > 2) {
+               infile = av[2] ? av[2] : infile;
+               if (ac > 3)
+                       outfile = av[3];
+       }
+}
+/*
+ * count the cards
+ */
+count() {
+
+       reg bool        newline;
+       reg DECK        *in_deck;
+       reg char        c;
+
+       newline = TRUE;
+       in_deck = &CC_D;
+       while ((c=getc(inf)) != EOF)
+               if (newline && c == '%') {
+                       newline = FALSE;
+                       in_deck->num_cards++;
+                       if (getc(inf) == '-')
+                               in_deck = &CH_D;
+               }
+               else
+                       newline = (c == '\n');
+       in_deck->num_cards++;
+}
+/*
+ *     put strings in the file
+ */
+putem() {
+
+       reg bool        newline;
+       reg DECK        *in_deck;
+       reg char        c;
+       reg int         num;
+
+       in_deck = &CC_D;
+       CC_D.num_cards = 1;
+       CH_D.num_cards = 0;
+       CC_D.offsets[0] = ftell(outf);
+       putc(getc(inf), outf);
+       putc(getc(inf), outf);
+       for (num = 0; (c=getc(inf)) != '\n'; )
+               num = num * 10 + (c - '0');
+       putw(num, outf);
+       newline = FALSE;
+       while ((c=getc(inf)) != EOF)
+               if (newline && c == '%') {
+                       putc('\0', outf);
+                       newline = FALSE;
+                       if (getc(inf) == '-')
+                               in_deck = &CH_D;
+                       while (getc(inf) != '\n')
+                               continue;
+                       in_deck->offsets[in_deck->num_cards++] = ftell(outf);
+                       if ((c=getc(inf)) == EOF)
+                               break;
+                       putc(c, outf);
+                       putc(c = getc(inf), outf);
+                       for (num = 0; (c=getc(inf)) != EOF && c != '\n'; )
+                               num = num * 10 + (c - '0');
+                       putw(num, outf);
+               }
+               else {
+                       putc(c, outf);
+                       newline = (c == '\n');
+               }
+       putc('\0', outf);
+}
diff --git a/usr/src/games/monop/jail.c b/usr/src/games/monop/jail.c
new file mode 100644 (file)
index 0000000..c1309bc
--- /dev/null
@@ -0,0 +1,90 @@
+# include      "monop.ext"
+
+/*
+ *     This routine uses a get-out-of-jail-free card to get the
+ * player out of jail.
+ */
+card() {
+
+       if (cur_p->loc != JAIL) {
+               printf("But you're not IN Jail\n");
+               return;
+       }
+       if (cur_p->num_gojf == 0) {
+               printf("But you don't HAVE a get out of jail free card\n");
+               return;
+       }
+       ret_card(cur_p);
+       cur_p->loc = 10;                        /* just visiting        */
+       cur_p->in_jail = 0;
+}
+/*
+ *     This routine returns the players get-out-of-jail-free card
+ * to a deck.
+ */
+ret_card(plr)
+reg PLAY       *plr; {
+
+       plr->num_gojf--;
+       if (CC_D.gojf_used)
+               CC_D.gojf_used = FALSE;
+       else
+               CH_D.gojf_used = FALSE;
+}
+/*
+ *     This routine deals with paying your way out of jail.
+ */
+pay() {
+
+       if (cur_p->loc != JAIL) {
+               printf("But you're not IN Jail\n");
+               return;
+       }
+       cur_p->loc = 10;
+       cur_p->money -= 50;
+       cur_p->in_jail = 0;
+       printf("That cost you $50\n");
+}
+/*
+ *     This routine deals with a move in jail
+ */
+move_jail(r1, r2)
+reg int        r1, r2; {
+
+       if (r1 != r2) {
+               printf("Sorry, that doesn't get you out\n");
+               if (++(cur_p->in_jail) == 3) {
+                       printf("It's your third turn and you didn't roll doubles.  You have to pay $50\n");
+                       cur_p->money -= 50;
+moveit:
+                       cur_p->loc = 10;
+                       cur_p->in_jail = 0;
+                       move(r1+r2);
+                       r1 = r2 - 1;    /* kludge: stop new roll w/doub */
+                       return TRUE;
+               }
+               return FALSE;
+       }
+       else {
+               printf("Double roll gets you out.\n");
+               goto moveit;
+       }
+}
+printturn() {
+
+       if (cur_p->loc != JAIL)
+               return;
+       printf("(This is your ");
+       switch (cur_p->in_jail) {
+         case 0:
+               printf("1st");
+               break;
+         case 1:
+               printf("2nd");
+               break;
+         case 2:
+               printf("3rd (and final)");
+               break;
+       }
+       printf(" turn in JAIL)\n");
+}
diff --git a/usr/src/games/monop/misc.c b/usr/src/games/monop/misc.c
new file mode 100644 (file)
index 0000000..064be01
--- /dev/null
@@ -0,0 +1,322 @@
+# include      "monop.ext"
+# include      <ctype.h>
+# include      <signal.h>
+
+# define       execsh(sh)      execl(sh, shell_name[roll(1, num_names)-1], 0)
+
+static char    *shell_def      = "/bin/csh",
+               *shell_name[]   = {
+                       ".Hi Mom!",
+                       ".Kick Me",
+                       ".I'm really the next process down",
+                       ".Hi Kids!",
+                       ".This space for rent",
+                       ".Singin' in the rain....",
+                       ".I am but a Cog in the Wheel of Life",
+                       ".Look out!!! Behind you!!!!!",
+                       ".Looking for a good time, sailor?",
+                       ".I don't get NO respect...",
+                       ".Augghh!  You peeked!"
+               };
+
+static int     num_names       = sizeof shell_name / sizeof (char *);;
+
+char   *shell_in();
+
+/*
+ *     This routine executes a truncated set of commands until a
+ * "yes or "no" answer is gotten.
+ */
+getyn(prompt)
+reg char       *prompt; {
+
+       reg int com;
+
+       for (;;)
+               if ((com=getinp(prompt, yn)) < 2)
+                       return com;
+               else
+                       (*func[com-2])();
+}
+/*
+ *     This routine tells the player if he's out of money.
+ */
+notify() {
+
+       if (cur_p->money < 0)
+               printf("That leaves you $%d in debt\n", -cur_p->money);
+       else if (cur_p->money == 0)
+               printf("that leaves you broke\n");
+       else if (fixing && !told_em && cur_p->money > 0) {
+               printf("-- You are now Solvent ---\n");
+               told_em = TRUE;
+       }
+}
+/*
+ *     This routine switches to the next player
+ */
+next_play() {
+
+       player = ++player % num_play;
+       cur_p = &play[player];
+       num_doub = 0;
+}
+/*
+ *     This routine gets an integer from the keyboard after the
+ * given prompt.
+ */
+get_int(prompt)
+reg char       *prompt; {
+
+       reg int         num;
+       reg char        *sp;
+       char            buf[257];
+
+       for (;;) {
+inter:
+               printf(prompt);
+               num = 0;
+               for (sp = buf; (*sp=getchar()) != '\n'; sp++)
+                       if (*sp == -1)  /* check for interrupted system call */
+                               goto inter;
+               if (sp == buf)
+                       continue;
+               for (sp = buf; isspace(*sp); sp++)
+                       continue;
+               for (; isdigit(*sp); sp++)
+                       num = num * 10 + *sp - '0';
+               if (*sp == '\n')
+                       return num;
+               else
+                       printf("I can't understand that\n");
+       }
+}
+/*
+ *     This routine sets the monopoly flag from the list given.
+ */
+set_ownlist(pl)
+int    pl; {
+
+       reg int num;            /* general counter              */
+       reg MON *orig;          /* remember starting monop ptr  */
+       reg OWN *op;            /* current owned prop           */
+       OWN     *orig_op;               /* origianl prop before loop    */
+
+       op = play[pl].own_list;
+#ifdef DEBUG
+       printf("op [%d] = play[pl [%d] ].own_list;\n", op, pl);
+#endif
+       while (op) {
+#ifdef DEBUG
+               printf("op->sqr->type = %d\n", op->sqr->type);
+#endif
+               switch (op->sqr->type) {
+                 case UTIL:
+#ifdef DEBUG
+                       printf("  case UTIL:\n");
+#endif
+                       for (num = 0; op && op->sqr->type == UTIL; op = op->next)
+                               num++;
+                       play[pl].num_util = num;
+#ifdef DEBUG
+                       printf("play[pl].num_util = num [%d];\n", num);
+#endif
+                       break;
+                 case RR:
+#ifdef DEBUG
+                       printf("  case RR:\n");
+#endif
+                       for (num = 0; op && op->sqr->type == RR; op = op->next) {
+#ifdef DEBUG
+                               printf("iter: %d\n", num);
+                               printf("op = %d, op->sqr = %d, op->sqr->type = %d\n", op, op->sqr, op->sqr->type);
+#endif
+                               num++;
+                       }
+                       play[pl].num_rr = num;
+#ifdef DEBUG
+                       printf("play[pl].num_rr = num [%d];\n", num);
+#endif
+                       break;
+                 case PRPTY:
+#ifdef DEBUG
+                       printf("  case PRPTY:\n");
+#endif
+                       orig = op->sqr->desc->mon_desc;
+                       orig_op = op;
+                       num = 0;
+                       while (op && op->sqr->desc->mon_desc == orig) {
+#ifdef DEBUG
+                               printf("iter: %d\n", num);
+#endif
+                               num++;
+#ifdef DEBUG
+                               printf("op = op->next ");
+#endif
+                               op = op->next;
+#ifdef DEBUG
+                               printf("[%d];\n", op);
+#endif
+                       }
+#ifdef DEBUG
+                       printf("num = %d\n");
+#endif
+                       if (orig == 0) {
+                               printf("panic:  bad monopoly descriptor: orig = %d\n", orig);
+                               printf("player # %d\n", pl+1);
+                               printhold(pl);
+                               printf("orig_op = %d\n", orig_op);
+                               printf("orig_op->sqr->type = %d (PRPTY)\n", op->sqr->type);
+                               printf("orig_op->next = %d\n", op->next);
+                               printf("orig_op->sqr->desc = %d\n", op->sqr->desc);
+                               printf("op = %d\n", op);
+                               printf("op->sqr->type = %d (PRPTY)\n", op->sqr->type);
+                               printf("op->next = %d\n", op->next);
+                               printf("op->sqr->desc = %d\n", op->sqr->desc);
+                               printf("num = %d\n", num);
+                       }
+#ifdef DEBUG
+                       printf("orig->num_in = %d\n", orig->num_in);
+#endif
+                       if (num == orig->num_in)
+                               is_monop(orig, pl);
+                       else
+                               isnot_monop(orig);
+                       break;
+               }
+       }
+}
+/*
+ *     This routine sets things up as if it is a new monopoly
+ */
+is_monop(mp, pl)
+reg MON        *mp;
+int    pl; {
+
+       reg char        *sp;
+       reg int         i;
+
+       mp->owner = pl;
+       mp->num_own = mp->num_in;
+       for (i = 0; i < mp->num_in; i++)
+               mp->sq[i]->desc->monop = TRUE;
+       mp->name = mp->mon_n;
+}
+/*
+ *     This routine sets things up as if it is no longer a monopoly
+ */
+isnot_monop(mp)
+reg MON        *mp; {
+
+       reg char        *sp;
+       reg int         i;
+
+       mp->owner = -1;
+       for (i = 0; i < mp->num_in; i++)
+               mp->sq[i]->desc->monop = FALSE;
+       mp->name = mp->not_m;
+}
+/*
+ *     This routine gives a list of the current player's routine
+ */
+list() {
+
+       printhold(player);
+}
+/*
+ *     This routine gives a list of a given players holdings
+ */
+list_all() {
+
+       reg int pl;
+
+       while ((pl=getinp("Whose holdings do you want to see? ", name_list)) < num_play)
+               printhold(pl);
+}
+/*
+ *     This routine gives the players a chance before it exits.
+ */
+quit() {
+
+       putchar('\n');
+       if (getyn("Do you all really want to quit? ", yn) == 0)
+               exit(0);
+       signal(2, quit);
+}
+/*
+ *     This routine copies one structure to another
+ */
+cpy_st(s1, s2, size)
+reg int        *s1, *s2, size; {
+
+       size /= 2;
+       while (size--)
+               *s1++ = *s2++;
+}
+/*
+ *     This routine forks off a shell.  It uses the users login shell
+ */
+shell_out() {
+
+       static char     *shell = NULL;
+
+       printline();
+       if (shell == NULL)
+               shell = shell_in();
+       fflush();
+       if (!fork()) {
+               signal(SIGINT, SIG_DFL);
+               execsh(shell);
+       }
+       ignoresigs();
+       wait();
+       resetsigs();
+       putchar('\n');
+       printline();
+}
+/*
+ *     This routine looks up the users login shell
+ */
+# include      <pwd.h>
+
+struct passwd  *getpwuid();
+
+char           *getenv();
+
+char *
+shell_in() {
+
+       reg struct passwd       *pp;
+       reg char                *sp;
+
+       if ((sp = getenv("SHELL")) == NULL) {
+               pp = getpwuid(getuid());
+               if (pp->pw_shell[0] != '\0')
+                       return pp->pw_shell;
+               else
+                       return shell_def;
+               /*return (*(pp->pw_shell) != '\0' ? pp->pw_shell : shell_def);*/
+       }
+       return sp;
+}
+/*
+ *     This routine sets things up to ignore all the signals.
+ */
+ignoresigs() {
+
+       reg int i;
+
+       for (i = 0; i < NSIG; i++)
+               signal(i, SIG_IGN);
+}
+/*
+ *     This routine sets up things as they were before.
+ */
+resetsigs() {
+
+       reg int i;
+
+       for (i = 0; i < NSIG; i++)
+               signal(i, SIG_DFL);
+       signal(2, quit);
+}
diff --git a/usr/src/games/monop/monop.c b/usr/src/games/monop/monop.c
new file mode 100644 (file)
index 0000000..5dea4aa
--- /dev/null
@@ -0,0 +1,119 @@
+# include      "monop.def"
+
+/*
+ *     This program implements a monopoly game
+ */
+main(ac, av)
+reg int                ac;
+reg char       *av[]; {
+
+
+       srand(getpid());
+       if (ac > 1) {
+               if (!rest_f(av[1]))
+                       restore();
+       }
+       else {
+               getplayers();
+               init_players();
+               init_monops();
+       }
+       num_luck = sizeof lucky_mes / sizeof (char *);
+       init_decks();
+       signal(2, quit);
+       for (;;) {
+               printf("\n%s (%d) (cash $%d) on %s\n", cur_p->name, player + 1,
+                       cur_p->money, board[cur_p->loc].name);
+               printturn();
+               force_morg();
+               execute(getinp("-- Command: ", comlist));
+       }
+}
+/*
+ *     This routine gets the names of the players
+ */
+getplayers() {
+
+       reg char        *sp;
+       reg int         i, j;
+       char            buf[257];
+
+blew_it:
+       for (;;) {
+               if ((num_play=get_int("How many players? ")) <= 0 ||
+                   num_play > MAX_PL)
+                       printf("Sorry. Number must range from 1 to 9\n");
+               else
+                       break;
+       }
+       cur_p = play = (PLAY *) calloc(num_play, sizeof (PLAY));
+       for (i = 0; i < num_play; i++) {
+over:
+               printf("Player %d's name: ", i + 1);
+               for (sp = buf; (*sp=getchar()) != '\n'; sp++)
+                       continue;
+               if (sp == buf)
+                       goto over;
+               *sp++ = '\0';
+               strcpy(name_list[i]=play[i].name=(char *)calloc(1,sp-buf),buf);
+               play[i].money = 1500;
+       }
+       name_list[i++] = "done";
+       name_list[i] = 0;
+       for (i = 0; i < num_play; i++)
+               for (j = i + 1; j < num_play; j++)
+                       if (strcmp(name_list[i], name_list[j]) == 0) {
+                               if (i != num_play - 1)
+                                       printf("Hey!!! Some of those are IDENTICAL!!  Let's try that again....\n");
+                               else
+                                       printf("\"done\" is a reserved word.  Please try again\n");
+                               for (i = 0; i < num_play; i++)
+                                       cfree(play[i].name);
+                               cfree(play);
+                               goto blew_it;
+                       }
+}
+/*
+ *     This routine figures out who goes first
+ */
+init_players() {
+
+       reg int i, rl, cur_max;
+       bool    over;
+       int     max_pl;
+
+again:
+       putchar('\n');
+       for (cur_max = i = 0; i < num_play; i++) {
+               printf("%s (%d) rolls %d\n", play[i].name, i+1, rl=roll(2, 6));
+               if (rl > cur_max) {
+                       over = FALSE;
+                       cur_max = rl;
+                       max_pl = i;
+               }
+               else if (rl == cur_max)
+                       over++;
+       }
+       if (over) {
+               printf("%d people rolled the same thing, so we'll try again\n",
+                   over + 1);
+               goto again;
+       }
+       player = max_pl;
+       cur_p = &play[max_pl];
+       printf("%s (%d) goes first\n", cur_p->name, max_pl + 1);
+}
+/*
+ *     This routine initalizes the monopoly structures.
+ */
+init_monops() {
+
+       reg MON *mp;
+       reg int i;
+
+       for (mp = mon; mp < &mon[N_MON]; mp++) {
+               mp->name = mp->not_m;
+               for (i = 0; i < mp->num_in; i++)
+                       mp->sq[i] = &board[(int)(mp->sq[i])];
+       }
+}
diff --git a/usr/src/games/monop/monop.def b/usr/src/games/monop/monop.def
new file mode 100644 (file)
index 0000000..d7acbe2
--- /dev/null
@@ -0,0 +1,89 @@
+# include      "monop.h"
+# include      "deck.h"
+
+bool   fixing,                 /* set if fixing up debt                */
+       trading,                /* set if in process of trading         */
+       told_em,                /* set if told user he's out of debt    */
+       spec;                   /* set if moving by card to RR or UTIL  */
+
+char   *name_list[MAX_PL+2],   /* list of players' names               */
+       *comlist[]      = {     /* list of normal commands              */
+       "quit",         /*  0 */        "print",        /*  1 */
+       "where",        /*  2 */        "own holdings", /*  3 */
+       "holdings",     /*  4 */        "shell",        /*  5 */
+       "mortgage",     /*  6 */        "unmortgage",   /*  7 */
+       "buy houses",   /*  8 */        "sell houses",  /*  9 */
+       "card",         /* 10 */        "pay",          /* 11 */
+       "trade",        /* 12 */        "resign",       /* 13 */
+       "save",         /* 14 */        "restore",      /* 15 */
+       "roll",         /* 16 */        "",             /* 17 */
+       0
+       },
+       *yn[]           = {     /* list of commands for yes/no answers  */
+       "yes",          /*  0 */        "no",           /*  1 */
+       "quit",         /*  2 */        "print",        /*  3 */
+       "where",        /*  4 */        "own holdings", /*  5 */
+       "holdings",     /*  6 */        "shell",        /*  7 */
+       0
+       },
+       *lucky_mes[]    = {     /* "got lucky" messages                 */
+       "You lucky stiff",              "You got lucky",
+       "What a lucky person!",         "You must have a 4-leaf clover",
+       "My, my!  Aren't we lucky!",    "Luck smiles upon you",
+       "You got lucky this time",      "Lucky person!",
+       "Your karma must certainly be together",
+       "How beautifully Cosmic",       "Wow, you must be really with it"
+       /* "I want your autograph",     -- Save for later */
+       };
+
+int    player,                 /* current player number                */
+       num_play,               /* current number of players            */
+       num_doub,               /* # of doubles current player rolled   */
+                               /* # of "got lucky" messages            */
+       num_luck        = sizeof lucky_mes / sizeof (char *),
+                               /* list of command functions            */
+       buy_houses(), card(), do_move(), do_move(), list(), list_all(),
+       mortgage(), pay(), printboard(), quit(), resign(), restore(),
+       rub(), save(), sell_houses(), shell_out(), trade(),
+       unmortgage(), where(),
+       (*func[])()     = {     /* array of function calls for commands */
+       quit,                   /* quit game            |*  0 *|        */
+       printboard,             /* print board          |*  1 *|        */
+       where,                  /* where players are    |*  2 *|        */
+       list,                   /* own holdings         |*  3 *|        */
+       list_all,               /* holdings list        |*  4 *|        */
+       shell_out,              /* shell                |*  5 *|        */
+       mortgage,               /* mortgage property    |*  6 *|        */
+       unmortgage,             /* unmortgage property  |*  7 *|        */
+       buy_houses,             /* buy houses           |*  8 *|        */
+       sell_houses,            /* sell houses          |*  9 *|        */
+       card,                   /* card for jail        |* 10 *|        */
+       pay,                    /* pay for jail         |* 11 *|        */
+       trade,                  /* trade                |* 12 *|        */
+       resign,                 /* resign               |* 13 *|        */
+       save,                   /* save game            |* 14 *|        */
+       restore,                /* restore game         |* 15 *|        */
+       do_move,                /* roll                 |* 16 *|        */
+       do_move                 /* ""                   |* 17 *|        */
+       };
+
+DECK   deck[2];                /* Chance and Community Chest           */
+
+PLAY   *play,                  /* player structure array ("calloc"ed)  */
+       *cur_p;                 /* pointer to current player's struct   */
+
+RR_S   rr[N_RR];               /* raildroad descriptions               */
+
+UTIL_S util[2];                /* utility descriptions                 */
+
+MON    mon[N_MON]      = {     /* monopoly descriptions                */
+#              include "mon.dat"
+};
+
+PROP   prop[N_PROP]    = {     /* typical properties                   */
+#              include "prop.dat"
+};
+
+SQUARE board[N_SQRS+1] = {     /* board itself (+1 for Jail)           */
+#              include "brd.dat"
+};
diff --git a/usr/src/games/monop/monop.ext b/usr/src/games/monop/monop.ext
new file mode 100644 (file)
index 0000000..e487dda
--- /dev/null
@@ -0,0 +1,22 @@
+# include      "monop.h"
+# include      "deck.h"
+
+extern bool    trading, spec, fixing, told_em;
+
+extern char    *yn[], *comlist[], *name_list[], *lucky_mes[];
+
+extern int     num_play, player, num_doub, num_luck, (*func[])();
+
+extern DECK    deck[2];
+
+extern MON     mon[];
+
+extern PLAY    *play, *cur_p;
+
+extern PROP    prop[];
+
+extern RR_S    rr[];
+
+extern SQUARE  board[];
+
+extern UTIL_S  util[];
diff --git a/usr/src/games/monop/monop.h b/usr/src/games/monop/monop.h
new file mode 100644 (file)
index 0000000..0e53371
--- /dev/null
@@ -0,0 +1,98 @@
+# include      <stdio.h>
+
+# define       reg     register
+# define       shrt    char
+# define       bool    char
+# define       unsgn   unsigned
+
+# define       TRUE    (1)
+# define       FALSE   (0)
+
+# define       N_MON   8       /* number of monopolies                 */
+# define       N_PROP  22      /* number of normal property squares    */
+# define       N_RR    4       /* number of railroads                  */
+# define       N_UTIL  2       /* number of utilities                  */
+# define       N_SQRS  40      /* number of squares on board           */
+# define       MAX_PL  9       /* maximum number of players            */
+# define       MAX_PRP (N_PROP+N_RR+N_UTIL) /* max # ownable property  */
+
+                               /* square type numbers                  */
+# define       PRPTY   0       /* normal property                      */
+# define       RR      1       /* railroad                             */
+# define       UTIL    2       /* water works - electric co            */
+# define       SAFE    3       /* safe spot                            */
+# define       CC      4       /* community chest                      */
+# define       CHANCE  5       /* chance (surprise!!!)                 */
+# define       SPEC    6       /* special                              */
+
+# define       JAIL    40      /* JAIL square number                   */
+
+# define       lucky(str)      printf("%s%s\n",str,lucky_mes[roll(1,num_luck)-1])
+# define       printline()     printf("------------------------------\n")
+# define       sqnum(sqp)      (sqp - board)
+# define       swap(A1,A2)     if ((A1) != (A2)) { \
+                                       (A1) ^= (A2); \
+                                       (A2) ^= (A1); \
+                                       (A1) ^= (A2); \
+                               }
+
+struct sqr_st {                        /* structure for square                 */
+       char    *name;                  /* place name                   */
+       shrt    owner;                  /* owner number                 */
+       shrt    type;                   /* place type                   */
+       char    *desc;                  /* description struct           */
+       int     cost;                   /* cost                         */
+};
+
+typedef struct sqr_st  SQUARE;
+
+struct mon_st {                        /* monopoly descriptin structure        */
+       char    *name;                  /* monop. name (color)          */
+       shrt    owner;                  /* owner of monopoly            */
+       shrt    num_in;                 /* # in monopoly                */
+       shrt    num_own;                /* # owned (-1: not poss. monop)*/
+       shrt    h_cost;                 /* price of houses              */
+       char    *not_m;                 /* name if not monopoly         */
+       char    *mon_n;                 /* name if a monopoly           */
+       SQUARE  *sq[3];                 /* list of squares in monop     */
+};
+
+typedef struct mon_st  MON;
+
+struct prp_st {                        /* property description structure       */
+       bool    morg;                   /* set if mortgaged             */
+       bool    monop;                  /* set if monopoly              */
+       shrt    square;                 /* square description           */
+       shrt    houses;                 /* number of houses             */
+       MON     *mon_desc;              /* name of color                */
+       int     rent[6];                /* rents                        */
+};
+
+struct own_st {                        /* element in list owned things         */
+       SQUARE  *sqr;                   /* pointer to square            */
+       struct own_st   *next;          /* next in list                 */
+};
+
+typedef struct own_st  OWN;
+
+struct plr_st {                        /* player description structure         */
+       char    *name;                  /* owner name                   */
+       shrt    num_gojf;               /* # of get-out-of-jail-free's  */
+       shrt    num_rr;                 /* # of railroads owned         */
+       shrt    num_util;               /* # of water works/elec. co.   */
+       shrt    loc;                    /* location on board            */
+       shrt    in_jail;                /* count of turns in jail       */
+       int     money;                  /* amount of money              */
+       OWN     *own_list;              /* start of propery list        */
+};
+
+struct rr_st {                 /* railroad description structure       */
+       bool    morg;                   /* set if morgaged              */
+};
+
+typedef struct plr_st  PLAY;
+typedef struct prp_st  PROP;
+typedef struct rr_st   RR_S;
+typedef struct rr_st   UTIL_S;
+
+int    cc(), chance(), lux_tax(), goto_jail(), inc_tax();
diff --git a/usr/src/games/monop/morg.c b/usr/src/games/monop/morg.c
new file mode 100644 (file)
index 0000000..6a07347
--- /dev/null
@@ -0,0 +1,173 @@
+# include      "monop.ext"
+
+/*
+ *     These routines deal with mortgaging.
+ */
+
+static char    *names[MAX_PRP+2],
+               *morg_coms[]    = {
+                       "quit",         /*  0 */
+                       "print",        /*  1 */
+                       "where",        /*  2 */
+                       "own holdings", /*  3 */
+                       "holdings",     /*  4 */
+                       "shell",        /*  5 */
+                       "mortgage",     /*  6 */
+                       "unmortgage",   /*  7 */
+                       "buy",          /*  8 */
+                       "sell",         /*  9 */
+                       "card",         /* 10 */
+                       "pay",          /* 11 */
+                       "trade",        /* 12 */
+                       "resign",       /* 13 */
+                       "save game",    /* 14 */
+                       "restore game", /* 15 */
+                       0
+               };
+
+static shrt    square[MAX_PRP+2];
+
+static int     num_good,got_houses;
+
+/*
+ *     This routine is the command level response the mortgage command.
+ * it gets the list of mortgageable property and asks which are to
+ * be mortgaged.
+ */
+mortgage() {
+
+       reg int prop;
+
+       for (;;) {
+               if (set_mlist() == 0) {
+                       if (got_houses)
+                               printf("You can't mortgage property with houses on it.\n");
+                       else
+                               printf("You don't have any un-mortgaged property.\n");
+                       return;
+               }
+               if (num_good == 1) {
+                       printf("Your only mortageable property is %s\n",names[0]);
+                       if (getyn("Do you want to mortgage it? ") == 0)
+                               m(square[0]);
+                       return;
+               }
+               prop = getinp("Which property do you want to mortgage? ",names);
+               if (prop == num_good)
+                       return;
+               m(square[prop]);
+               notify(cur_p);
+       }
+}
+/*
+ *     This routine sets up the list of mortgageable property
+ */
+set_mlist() {
+
+       reg OWN *op;
+
+       num_good = 0;
+       for (op = cur_p->own_list; op; op = op->next)
+               if (!op->sqr->desc->morg)
+                       if (op->sqr->type == PRPTY && op->sqr->desc->houses)
+                               got_houses++;
+                       else {
+                               names[num_good] = op->sqr->name;
+                               square[num_good++] = sqnum(op->sqr);
+                       }
+       names[num_good++] = "done";
+       names[num_good--] = 0;
+       return num_good;
+}
+/*
+ *     This routine actually mortgages the property.
+ */
+m(prop)
+reg int        prop; {
+
+       reg int price;
+
+       price = board[prop].cost/2;
+       board[prop].desc->morg = TRUE;
+       printf("That got you $%d\n",price);
+       cur_p->money += price;
+}
+/*
+ *     This routine is the command level repsponse to the unmortgage
+ * command.  It gets the list of mortgaged property and asks which are
+ * to be unmortgaged.
+ */
+unmortgage() {
+
+       reg int prop;
+
+       for (;;) {
+               if (set_umlist() == 0) {
+                       printf("You don't have any mortgaged property.\n");
+                       return;
+               }
+               if (num_good == 1) {
+                       printf("Your only mortaged property is %s\n",names[0]);
+                       if (getyn("Do you want to unmortgage it? ") == 0)
+                               unm(square[0]);
+                       return;
+               }
+               prop = getinp("Which property do you want to unmortgage? ",names);
+               if (prop == num_good)
+                       return;
+               unm(square[prop]);
+       }
+}
+/*
+ *     This routine sets up the list of mortgaged property
+ */
+set_umlist() {
+
+       reg OWN *op;
+
+       num_good = 0;
+       for (op = cur_p->own_list; op; op = op->next)
+               if (op->sqr->desc->morg) {
+                       names[num_good] = op->sqr->name;
+                       square[num_good++] = sqnum(op->sqr);
+               }
+       names[num_good++] = "done";
+       names[num_good--] = 0;
+       return num_good;
+}
+/*
+ *     This routine actually unmortgages the property
+ */
+unm(prop)
+reg int        prop; {
+
+       reg int price;
+
+       price = board[prop].cost/2;
+       board[prop].desc->morg = FALSE;
+       price += price/10;
+       printf("That cost you $%d\n",price);
+       cur_p->money -= price;
+       set_umlist();
+}
+/*
+ *     This routine forces the indebted player to fix his
+ * financial woes.
+ */
+force_morg() {
+
+       told_em = fixing = TRUE;
+       while (cur_p->money <= 0)
+               fix_ex(getinp("How are you going to fix it up? ",morg_coms));
+       fixing = FALSE;
+}
+/*
+ *     This routine is a special execute for the force_morg routine
+ */
+fix_ex(com_num)
+reg int        com_num; {
+
+       told_em = FALSE;
+       (*func[com_num])();
+       notify();
+}
diff --git a/usr/src/games/monop/print.c b/usr/src/games/monop/print.c
new file mode 100644 (file)
index 0000000..d7e27b6
--- /dev/null
@@ -0,0 +1,154 @@
+# include      "monop.ext"
+
+static char    buf[80],                /* output buffer                */
+               *header = "Name      Own      Price Mg # Rent";
+
+/*
+ *     This routine prints out the current board
+ */
+printboard() {
+
+       reg int i;
+
+       printf("%s\t%s\n", header, header);
+       for (i = 0; i < N_SQRS/2; i++) {
+               printsq(i, FALSE);
+               putchar('\t');
+               printsq(i+N_SQRS/2, TRUE);
+       }
+}
+/*
+ *     This routine lists where each player is.
+ */
+where() {
+
+       reg int i;
+       char    *bsp;
+
+       printf("%s Player\n", header);
+       for (i = 0; i < num_play; i++) {
+               printsq(play[i].loc, FALSE);
+               printf(" %s (%d)", play[i].name, i+1);
+               if (cur_p == &play[i])
+                       printf(" *");
+               putchar('\n');
+       }
+}
+/*
+ *     This routine prints out an individual square
+ */
+printsq(sqn, eoln)
+int            sqn;
+reg bool       eoln; {
+
+       reg int         rnt;
+       reg PROP        *pp;
+       reg SQUARE      *sqp;
+       int             i;
+
+       sqp = &board[sqn];
+       printf("%-10.10s", sqp->name);
+       if (sqn == JAIL)
+               goto spec;
+       switch (sqp->type) {
+         case SAFE:
+         case CC:
+         case CHANCE:
+         case SPEC:
+spec:
+               if (!eoln)
+                       printf("                        ");
+               break;
+         case PRPTY:
+               pp = sqp->desc;
+               if (sqp->owner < 0) {
+                       printf(" - %-8.8s %3d", pp->mon_desc->name, sqp->cost);
+                       if (!eoln)
+                               printf("         ");
+                       break;
+               }
+               printf(" %d %-8.8s %3d", sqp->owner+1, pp->mon_desc->name,
+                       sqp->cost);
+               printmorg(sqp);
+               if (pp->monop) {
+                       if (pp->houses < 5)
+                               if (pp->houses > 0)
+                                       printf("%d %4d", pp->houses,
+                                               pp->rent[pp->houses]);
+                               else
+                                       printf("0 %4d", pp->rent[0] * 2);
+                       else
+                               printf("H %4d", pp->rent[5]);
+               }
+               else
+                       printf("  %4d", pp->rent[0]);
+               break;
+         case UTIL:
+               if (sqp->owner < 0) {
+                       printf(" -          150");
+                       if (!eoln)
+                               printf("         ");
+                       break;
+               }
+               printf(" %d          150", sqp->owner+1);
+               printmorg(sqp);
+               printf("%d", play[sqp->owner].num_util);
+               if (!eoln)
+                       printf("    ");
+               break;
+         case RR:
+               if (sqp->owner < 0) {
+                       printf(" - Railroad 200");
+                       if (!eoln)
+                               printf("         ");
+                       break;
+               }
+               printf(" %d Railroad 200", sqp->owner+1);
+               printmorg(sqp);
+               rnt = 25;
+               rnt <<= play[sqp->owner].num_rr - 1;
+               printf("%d %4d", play[sqp->owner].num_rr, 25 << (play[sqp->owner].num_rr - 1));
+               break;
+       }
+       if (eoln)
+               putchar('\n');
+}
+/*
+ *     This routine prints out the mortgage flag.
+ */
+printmorg(sqp)
+reg SQUARE     *sqp; {
+
+       if (sqp->desc->morg)
+               printf(" * ");
+       else
+               printf("   ");
+}
+/*
+ *     This routine lists the holdings of the player given
+ */
+printhold(pl)
+reg int        pl; {
+
+       reg OWN         *op;
+       reg PLAY        *pp;
+       char            *bsp;
+
+       pp = &play[pl];
+       printf("%s's (%d) holdings (Total worth: $%d):\n", name_list[pl], pl+1,
+               pp->money + prop_worth(pp));
+       printf("\t$%d", pp->money);
+       if (pp->num_gojf) {
+               printf(", %d get-out-of-jail-free card", pp->num_gojf);
+               if (pp->num_gojf > 1)
+                       putchar('s');
+       }
+       putchar('\n');
+       if (pp->own_list) {
+               printf("\t%s\n", header);
+               for (op = pp->own_list; op; op = op->next) {
+                       putchar('\t');
+                       printsq(sqnum(op->sqr), TRUE);
+               }
+       }
+}
diff --git a/usr/src/games/monop/prop.c b/usr/src/games/monop/prop.c
new file mode 100644 (file)
index 0000000..846f2ff
--- /dev/null
@@ -0,0 +1,172 @@
+# include      "monop.ext"
+
+/*
+ *     This routine deals with buying property, setting all the
+ * appropriate flags.
+ */
+buy(player, sqrp)
+reg int                player;
+reg SQUARE     *sqrp; {
+
+       trading = FALSE;
+       sqrp->owner = player;
+       add_list(player, &(play[player].own_list), cur_p->loc);
+}
+/*
+ *     This routine adds an item to the list.
+ */
+add_list(plr, head, op_sqr)
+int    plr;
+OWN    **head;
+int    op_sqr; {
+
+       reg int val;
+       reg OWN *tp, *last_tp;
+       MON     *mp;
+       OWN     *op;
+
+       op = calloc(1, sizeof (OWN));
+       op->sqr = &board[op_sqr];
+       val = value(op->sqr);
+       last_tp = NULL;
+       for (tp = *head; tp && value(tp->sqr) < val; tp = tp->next)
+               if (val == value(tp->sqr)) {
+                       cfree(op);
+                       return;
+               }
+               else
+                       last_tp = tp;
+       op->next = tp;
+       if (last_tp != NULL)
+               last_tp->next = op;
+       else
+               *head = op;
+       if (!trading)
+               set_ownlist(plr);
+}
+/*
+ *     This routine deletes property from the list.
+ */
+del_list(plr, head, op_sqr)
+int    plr;
+OWN    **head;
+shrt   op_sqr; {
+
+       reg int i;
+       reg OWN *op, *last_op;
+
+       switch (board[op_sqr].type) {
+         case PRPTY:
+               board[op_sqr].desc->mon_desc->num_own--;
+               break;
+         case RR:
+               play[plr].num_rr--;
+               break;
+         case UTIL:
+               play[plr].num_util--;
+               break;
+       }
+       last_op = NULL;
+       for (op = *head; op; op = op->next)
+               if (op->sqr == &board[op_sqr])
+                       break;
+               else
+                       last_op = op;
+       if (last_op == NULL)
+               *head = op->next;
+       else {
+               last_op->next = op->next;
+               cfree(op);
+       }
+}
+/*
+ *     This routine calculates the value for sorting of the
+ * given square.
+ */
+value(sqp)
+reg SQUARE     *sqp; {
+
+       reg int sqr;
+
+       sqr = sqnum(sqp);
+       switch (sqp->type) {
+         case SAFE:
+               return 0;
+         case SPEC:
+               return 1;
+         case UTIL:
+               if (sqr == 12)
+                       return 2;
+               else
+                       return 3;
+         case RR:
+               return 4 + sqr/10;
+         case PRPTY:
+               return 8 + (PROP *)(sqp->desc) - prop;
+       }
+}
+/*
+ *     This routine accepts bids for the current peice
+ * of property.
+ */
+bid() {
+
+       static bool     in[MAX_PL];
+       reg int         i, num_in, cur_max;
+       char            buf[80];
+       int             cur_bid;
+
+       printf("\nSo it goes up for auction.  Type your bid after your name\n");
+       for (i = 0; i < num_play; i++)
+               in[i] = TRUE;
+       i = -1;
+       cur_max = 0;
+       num_in = num_play;
+       while (num_in > 1 || (cur_max == 0 && num_in > 0)) {
+               i = ++i % num_play;
+               if (in[i]) {
+                       do {
+                               sprintf(buf, "%s: ", name_list[i]);
+                               cur_bid = get_int(buf);
+                               if (cur_bid == 0) {
+                                       in[i] = FALSE;
+                                       if (--num_in == 0)
+                                               break;
+                               }
+                               else if (cur_bid <= cur_max) {
+                                       printf("You must bid higher than %d to stay in\n", cur_max);
+                                       printf("(bid of 0 drops you out)\n");
+                               }
+                       } while (cur_bid != 0 && cur_bid <= cur_max);
+                       cur_max = (cur_bid ? cur_bid : cur_max);
+               }
+       }
+       if (cur_max != 0) {
+               while (!in[i])
+                       i = ++i % num_play;
+               printf("It goes to %s (%d) for $%d\n",play[i].name,i+1,cur_max);
+               buy(i, &board[cur_p->loc]);
+               play[i].money -= cur_max;
+       }
+       else
+               printf("Nobody seems to want it, so we'll leave it for later\n");
+}
+/*
+ *     This routine calculates the value of the property
+ * of given player.
+ */
+prop_worth(plp)
+reg PLAY       *plp; {
+
+       reg OWN *op;
+       reg int worth;
+
+       worth = 0;
+       for (op = plp->own_list; op; op = op->next) {
+               if (op->sqr->type == PRPTY && op->sqr->desc->monop)
+                       worth += op->sqr->desc->mon_desc->h_cost * 50 *
+                           op->sqr->desc->houses;
+               worth += op->sqr->cost;
+       }
+       return worth;
+}
diff --git a/usr/src/games/monop/rent.c b/usr/src/games/monop/rent.c
new file mode 100644 (file)
index 0000000..7357f8f
--- /dev/null
@@ -0,0 +1,55 @@
+# include      "monop.ext"
+
+/*
+ *     This routine has the player pay rent
+ */
+rent(sqp)
+reg SQUARE     *sqp; {
+
+       reg int         rnt;
+       reg PROP        *pp;
+       PLAY            *plp;
+
+       plp = &play[sqp->owner];
+       printf("Owned by %s\n", plp->name);
+       if (sqp->desc->morg) {
+               lucky("The thing is mortgaged.  ");
+               return;
+       }
+       switch (sqp->type) {
+         case PRPTY:
+               pp = sqp->desc;
+               if (pp->monop)
+                       if (pp->houses == 0)
+                               printf("rent is %d\n", rnt=pp->rent[0] * 2);
+                       else if (pp->houses < 5)
+                               printf("with %d houses, rent is %d\n",
+                                   pp->houses, rnt=pp->rent[pp->houses]);
+                       else
+                               printf("with a hotel, rent is %d\n",
+                                   rnt=pp->rent[pp->houses]);
+               else
+                       printf("rent is %d\n", rnt = pp->rent[0]);
+               break;
+         case RR:
+               rnt = 25;
+               rnt <<= (plp->num_rr - 1);
+               if (spec)
+                       rnt <<= 1;
+               printf("rent is %d\n", rnt);
+               break;
+         case UTIL:
+               rnt = roll(2, 6);
+               if (plp->num_util == 2 || spec) {
+                       printf("rent is 10 * roll (%d) = %d\n", rnt, rnt * 10);
+                       rnt *= 10;
+               }
+               else {
+                       printf("rent is 4 * roll (%d) = %d\n", rnt, rnt * 4);
+                       rnt *= 4;
+               }
+               break;
+       }
+       cur_p->money -= rnt;
+       plp->money += rnt;
+}
diff --git a/usr/src/games/monop/roll.c b/usr/src/games/monop/roll.c
new file mode 100644 (file)
index 0000000..b1d72a2
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ *     This routine rolls ndie nside-sided dice.
+ */
+
+# define       reg     register
+
+# ifndef vax
+# define       MAXRAND 32767L
+
+roll(ndie, nsides)
+int    ndie, nsides; {
+
+       reg long        tot;
+       reg unsigned    n, r;
+
+       tot = 0;
+       n = ndie;
+       while (n--)
+               tot += rand();
+       return (int) ((tot * (long) nsides) / ((long) MAXRAND + 1)) + ndie;
+}
+
+# else
+
+roll(ndie, nsides)
+reg int        ndie, nsides; {
+
+       reg int         tot, r;
+       reg double      num_sides;
+
+       num_sides = nsides;
+       tot = 0;
+       while (ndie--)
+               tot += (r = rand()) * (num_sides / 017777777777) + 1;
+       return tot;
+}
+# endif
diff --git a/usr/src/games/monop/spec.c b/usr/src/games/monop/spec.c
new file mode 100644 (file)
index 0000000..b100f21
--- /dev/null
@@ -0,0 +1,49 @@
+# include      "monop.ext"
+
+static char    *perc[] = {
+       "10%", "ten percent", "%", "$200", "200", 0
+       };
+
+inc_tax() {                    /* collect income tax                   */
+
+       reg int worth, com_num;
+
+       com_num = getinp("Do you wish to lose 10%% of your total worth or $200? ", perc);
+       worth = cur_p->money + prop_worth(cur_p);
+       printf("You were worth $%d", worth);
+       worth /= 10;
+       if (com_num > 2) {
+               if (worth < 200)
+                       printf(".  Good try, but not quite.\n");
+               else if (worth > 200)
+                       lucky(".\nGood guess.  ");
+               cur_p->money -= 200;
+       }
+       else {
+               printf(", so you pay $%d", worth);
+               if (worth > 200)
+                       printf("  OUCH!!!!.\n");
+               else if (worth < 200)
+                       lucky("\nGood guess.  ");
+               cur_p->money -= worth;
+       }
+       if (worth == 200)
+               lucky("\nIt makes no difference!  ");
+}
+goto_jail() {                  /* move player to jail                  */
+
+       cur_p->loc = JAIL;
+}
+lux_tax() {                    /* landing on luxury tax                */
+
+       printf("You lose $75\n");
+       cur_p->money -= 75;
+}
+cc() {                         /* draw community chest card            */
+
+       get_card(&CC_D);
+}
+chance() {                     /* draw chance card                     */
+
+       get_card(&CH_D);
+}
diff --git a/usr/src/games/monop/strcmp.c b/usr/src/games/monop/strcmp.c
new file mode 100644 (file)
index 0000000..1c53627
--- /dev/null
@@ -0,0 +1,21 @@
+# include      <stdio.h>
+# include      <ctype.h>
+
+# define       reg     register
+
+# define       makelower(c)    (isupper(c) ? tolower(c) : c)
+
+/*
+ * Compare strings:  s1>s2: >0  s1==s2: 0  s1<s2: <0
+ */
+
+strcmp(s1, s2)
+reg char       *s1, *s2; {
+
+       while (makelower(*s1) == makelower(*s2)) {
+               if (*s1 == '\0')
+                       return 0;
+               s1++, s2++;
+       }
+       return *s1 - *s2;
+}
diff --git a/usr/src/games/monop/trade.c b/usr/src/games/monop/trade.c
new file mode 100644 (file)
index 0000000..70e8c5a
--- /dev/null
@@ -0,0 +1,271 @@
+# include      "monop.ext"
+
+static struct  trd_st {        /* how much to give to other player     */
+       int     trader;                 /* trader number                */
+       int     cash;                   /* amount of cash               */
+       int     gojf;                   /* # get-out-of-jail-free cards */
+       OWN     *prop_list;             /* property list                */
+};
+
+typedef        struct trd_st   TRADE;
+
+static char    *list[MAX_PRP+2];
+
+static int     used[MAX_PRP];
+
+static TRADE   trades[2];
+
+trade() {
+
+       reg int tradee, i;
+
+       trading = TRUE;
+       for (i = 0; i < 2; i++) {
+               trades[i].cash = 0;
+               trades[i].gojf = FALSE;
+               trades[i].prop_list = NULL;
+       }
+over:
+       if (num_play == 1) {
+               printf("There ain't no-one around to trade WITH!!\n");
+               return;
+       }
+       if (num_play > 2) {
+               tradee = getinp("Which player do you wish to trade with? ",
+                   name_list);
+               if (tradee == num_play)
+                       return;
+               if (tradee == player) {
+                       printf("You can't trade with yourself!\n");
+                       goto over;
+               }
+       }
+       else
+               tradee = 1 - player;
+       get_list(0, player);
+       get_list(1, tradee);
+       if (getyn("Do you wish a summary? ") == 0)
+               summate();
+       if (getyn("Is the trade ok? ") == 0)
+               do_trade();
+}
+/*
+ *     This routine gets the list of things to be trader for the
+ * player, and puts in the structure given.
+ */
+get_list(struct_no, play_no)
+int    struct_no, play_no; {
+
+       reg int         sn, pn;
+       reg PLAY        *pp;
+       int             numin, prop, num_prp;
+       OWN             *op;
+       TRADE           *tp;
+
+       for (numin = 0; numin < MAX_PRP; numin++)
+               used[numin] = FALSE;
+       sn = struct_no, pn = play_no;
+       pp = &play[pn];
+       tp = &trades[sn];
+       tp->trader = pn;
+       printf("player %s (%d):\n", pp->name, pn+1);
+       if (pp->own_list) {
+               numin = set_list(pp->own_list);
+               for (num_prp = numin; num_prp; ) {
+                       prop = getinp("Which property do you wish to trade? ",
+                           list);
+                       if (prop == numin)
+                               break;
+                       else if (used[prop])
+                               printf("You've already allocated that.\n");
+                       else {
+                               num_prp--;
+                               used[prop] = TRUE;
+                               for (op = pp->own_list; prop--; op = op->next)
+                                       continue;
+                               add_list(pn, &(tp->prop_list), sqnum(op->sqr));
+                       }
+               }
+       }
+       if (pp->money > 0) {
+               printf("You have $%d.  ", pp->money);
+               tp->cash = get_int("How much are you trading? ");
+       }
+       if (pp->num_gojf > 0) {
+once_more:
+               printf("You have %d get-out-of-jail-free cards. ",pp->num_gojf);
+               tp->gojf = get_int("How many are you trading? ");
+               if (tp->gojf > pp->num_gojf) {
+                       printf("You don't have that many.  Try again.\n");
+                       goto once_more;
+               }
+       }
+}
+/*
+ *     This routine sets up the list of tradable property.
+ */
+set_list(the_list)
+reg OWN        *the_list; {
+
+       reg int i;
+       reg OWN *op;
+
+       i = 0;
+       for (op = the_list; op; op = op->next)
+               if (!used[i])
+                       list[i++] = op->sqr->name;
+       list[i++] = "done";
+       list[i--] = 0;
+       return i;
+}
+/*
+ *     This routine summates the trade.
+ */
+summate() {
+
+       reg bool        some;
+       reg int         i;
+       reg TRADE       *tp;
+       OWN     *op;
+
+       for (i = 0; i < 2; i++) {
+               tp = &trades[i];
+               some = FALSE;
+               printf("Player %s (%d) gives:\n", play[tp->trader].name,
+                       tp->trader+1);
+               if (tp->cash > 0)
+                       printf("\t$%d\n", tp->cash), some++;
+               if (tp->gojf > 0)
+                       printf("\t%d get-out-of-jail-free card(s)\n", tp->gojf),
+                       some++;
+               if (tp->prop_list) {
+                       for (op = tp->prop_list; op; op = op->next)
+                               putchar('\t'), printsq(sqnum(op->sqr), TRUE);
+                       some++;
+               }
+               if (!some)
+                       printf("\t-- Nothing --\n");
+       }
+}
+/*
+ *     This routine actually executes the trade.
+ */
+do_trade() {
+
+       move_em(&trades[0], &trades[1]);
+       move_em(&trades[1], &trades[0]);
+}
+/*
+ *     This routine does a switch from one player to another
+ */
+move_em(from, to)
+TRADE  *from, *to; {
+
+       reg PLAY        *pl_fr, *pl_to;
+       reg OWN         *op;
+
+       pl_fr = &play[from->trader];
+       pl_to = &play[to->trader];
+
+       pl_fr->money -= from->cash;
+       pl_to->money += from->cash;
+       pl_fr->num_gojf -= from->gojf;
+       pl_to->num_gojf += from->gojf;
+       for (op = from->prop_list; op; op = op->next) {
+               add_list(to->trader, &(pl_to->own_list), sqnum(op->sqr));
+               op->sqr->owner = to->trader;
+               del_list(from->trader, &(pl_fr->own_list), sqnum(op->sqr));
+       }
+       set_ownlist(to->trader);
+}
+/*
+ *     This routine lets a player resign
+ */
+resign() {
+
+       reg int i, new_own;
+       reg OWN *op;
+       SQUARE  *sqp;
+
+       if (cur_p->money <= 0) {
+               switch (board[cur_p->loc].type) {
+                 case UTIL:
+                 case RR:
+                 case PRPTY:
+                       new_own = board[cur_p->loc].owner;
+                       break;
+                 case SPEC:
+                 case CC:
+                 case CHANCE:
+                       new_own = num_play;
+                       break;
+               }
+               if (new_own == num_play)
+                       printf("You would resign to the bank\n");
+               else
+                       printf("You would resign to %s\n", name_list[new_own]);
+       }
+       else if (num_play == 1) {
+               new_own = num_play;
+               printf("You would resign to the bank\n");
+       }
+       else {
+               name_list[num_play] = "bank";
+               do {
+                       new_own = getinp("Who do you wish to resign to? ",
+                           name_list);
+                       if (new_own == player)
+                               printf("You can't resign to yourself!!\n");
+               } while (new_own == player);
+               name_list[num_play] = "done";
+       }
+       if (getyn("Do you really want to resign? ", yn) != 0)
+               return;
+       if (num_play == 1) {
+               printf("Then NOBODY wins (not even YOU!)\n");
+               exit(0);
+       }
+       if (new_own < num_play) {       /* resign to player             */
+               printf("resigning to player\n");
+               trades[0].trader = new_own;
+               trades[0].cash = trades[0].gojf = 0;
+               trades[0].prop_list = NULL;
+               trades[1].trader = player;
+               trades[1].cash = cur_p->money > 0 ? cur_p->money : 0;
+               trades[1].gojf = cur_p->num_gojf;
+               trades[1].prop_list = cur_p->own_list;
+               do_trade();
+       }
+       else {                          /* resign to bank               */
+               printf("resigning to bank\n");
+               for (op = cur_p->own_list; op; op = op->next) {
+                       sqp = op->sqr;
+                       sqp->owner = -1;
+                       sqp->desc->morg = FALSE;
+                       if (op->type == PRPTY) {
+                               isnot_monop(sqp->desc->mon_desc);
+                               sqp->desc->houses = 0;
+                       }
+               }
+               if (cur_p->num_gojf)
+                       ret_card(cur_p);
+       }
+       for (i = player; i < num_play; i++) {
+               name_list[i] = name_list[i+1];
+               if (i + 1 < num_play)
+                       cpy_st(&play[i], &play[i+1], sizeof (PLAY));
+       }
+       name_list[num_play--] = 0;
+       for (i = 0; i < N_SQRS; i++)
+               if (board[i].owner > player)
+                       --board[i].owner;
+       player = --player < 0 ? num_play - 1 : player;
+       next_play();
+       if (num_play < 2) {
+               printf("\nThen %s WINS!!!!!\n", play[0].name);
+               printhold(0);
+               printf("That's a grand worth of $%d.\n",
+                       play[0].money+prop_worth(&play[0]));
+               exit(0);
+       }
+}
diff --git a/usr/src/games/mpu/constants b/usr/src/games/mpu/constants
new file mode 100644 (file)
index 0000000..b036a54
--- /dev/null
@@ -0,0 +1,37 @@
+
+{  *** Intrinsic Properties *** }
+
+VISIT = 1;              { I've been here / seen this }
+OPENS = 2;              { This can be opened }
+LOCKS = 3;              { This can be locked }
+OPEN  = 4;              { This is opened }
+LOCKD = 5;              { This is locked }
+INVIS = 6;              { This is invisible }
+TRANS = 7;              { This is transparent }
+LIGHT = 8;              { This gives off light }
+FLAME = 9;              { This is on fire }
+CONTS = 10;             { Printed contents for the object (Look Kludge) }
+SHRNK = 11;             { Has it been shrunk? }
+CRYST = 12;             { Is it one of our magic thingies? }
+
+MISC1 = 16;             { Miscellaneous Property (Semantics per object) }
+HOLED = MISC1;
+
+RDLOC = 17;             { Location on Highway 8 }
+WEIGH = 18;
+HOLDS = 19;
+HAS   = 20;
+POINT = 21;
+
+{ Constants }
+TRUE = 1; FALSE = 0;
+CAPAC = 500;                    { More than I can carry }
+
+{ Globals }
+DARKG = 1;
+HWY8  = 2;
+LOOKP = 3;
+SCORE = 4;
+Tempr = 5;              { Dragon's Upset? }
+Cel6x = 6;             { Where he came from to enter Cel06 }
+WASDK = 7;
diff --git a/usr/src/games/mpu/frontend b/usr/src/games/mpu/frontend
new file mode 100644 (file)
index 0000000..47c4a75
--- /dev/null
@@ -0,0 +1 @@
+/usr/games/lib/ddlrun /usr/games/lib/mpu
diff --git a/usr/src/games/mpu/locales b/usr/src/games/mpu/locales
new file mode 100644 (file)
index 0000000..30a4d5b
--- /dev/null
@@ -0,0 +1,305 @@
+
+road1(SDESC) = rdsc;
+road1(LDESC) = ($say "You're on a dirt road going east-west.  Tall stalks of
+corn grow on either side of the road.\n");
+
+road2(SDESC) = rdsc;            road2(LDESC) = rdsc;
+road3(SDESC) = rdsc;            road3(LDESC) = rdsc;
+road4(SDESC) = rdsc;            road4(LDESC) = rdsc;
+road5(SDESC) = rdsc;            road5(LDESC) = rdsc;
+road6(SDESC) = rdsc;            road6(LDESC) = rdsc;
+
+road7(LDESC) = ($say "A road from the west forks north and south here.
+To the east is a dense-looking forest; cornfields are seen on the
+west.\n");
+
+road7(SDESC) = ($say "You're at the fork in the road.\n");
+
+road8(SDESC) = rdsc;
+road8(LDESC)=($say
+"The road stretches a long way east-west.  A short fence divides the
+road from the cornfields beyond.  Please don't tresspass.\n");
+
+
+ROUTINE dump8; ROUTINE get8;    ROUTINE entr8;  ROUTINE east8; ROUTINE west8;
+
+
+
+gard1(SDESC) = gdsc;            gard1(LDESC) = gdsc;
+gard2(SDESC) = gdsc;            gard2(LDESC) = gdsc;
+gard3(SDESC) = gdsc;            gard3(LDESC) = gdsc;
+gard4(SDESC) = gdsc;            gard4(LDESC) = gdsc;
+gard5(SDESC) = gdsc;            gard5(LDESC) = gdsc;
+gard6(SDESC) = gdsc;            gard6(LDESC) = gdsc;
+gard7(SDESC) = gdsc;            gard7(LDESC) = gdsc;
+gard8(SDESC) = gdsc;            gard8(LDESC) = gdsc;
+
+frst1(SDESC) = fdsc;            frst1(LDESC) = fdsc;
+frst2(SDESC) = fdsc;            frst2(LDESC) = fdsc;
+frst3(SDESC) = fdsc;            frst3(LDESC) = fdsc;
+frst4(SDESC) = fdsc;            frst4(LDESC) = fdsc;
+
+farm1(SDESC) = ($say "Entrance to farm.\n");
+farm1 (LDESC) = ($say
+"You are at the entrance on the south side of a rundown
+farmhouse.  Someone has painted 'DIE, HEATHENS' on the
+front door, which barely stays on its hinges.  Marks of
+smoke and flame are visible.  A road runs to the south,
+and you may walk around the farmhouse by going east or west.\n");
+
+farm2(LDESC) = ($say
+"You are in the entry hall of a long-deserted old farmhouse.
+The floor is covered with the dust of years of disuse.  The
+front door to the south is open, and there is another room
+to the north.  A stairway on the east side of the room goes up.\n");
+farm2(SDESC) = ($say "Entry hall\n");
+
+
+farm3(LDESC) = ($say
+"You are on the east side of the farmhouse.  To the east, a forest
+stretches away into the distance.  The entrance to the farmhouse
+is to the south.\n");
+farm3(SDESC) = ($say "East side of the farmhouse\n");
+
+farm4(LDESC) = ($say
+"You are on the west side of the farmhouse.  The cornfields
+stretch away forever to the west.  The entrance to the house
+is to the south.\n");
+farm4(SDESC) = ($say "West side of the farmhouse\n");
+
+farm5(LDESC) = ($say
+"You are on the north side of the farmhouse.  A high fence
+separates you from the cornfields to the north.");
+farm5(SDESC) = ($say "North side of the farmhouse\n");
+
+
+farm6(LDESC) = ($say
+"You are in an old, empty farmhouse kitchen.  All the
+cupboards and cabinets are bare (unless you can eat the
+thick layer of dust which covers everything).")
+              (($prop farm6 VISIT):($say "\n"));
+farm6(SDESC) = ($say "Farmhouse kitchen\n");
+
+farm7(LDESC) = ($say
+"You are in the upstairs bedroom of the farmhouse.  All the
+windows are boarded up, and nobody has slept here for years.
+To the east is an exit leading to the entry hall below.\n")
+
+       (($prop bed OPEN ) :
+               ($say
+"In the middle of the room is an old, rickety bed.   The west
+wall ")
+               (($prop panel OPEN) :
+                       ($say
+     "has a panel missing, revealing a secret stairway down.\n")
+       {else}:         ($say
+     "seems to have a loose panel.\n")
+               )
+ {else} :
+               ($say
+"Against the west wall is an old, rickety bed (which may be
+why nobody has slept here for years).\n")
+       );
+farm7(SDESC) = ($say "Upstairs bedroom\n");
+
+PanL =                  { Try to go through panel }
+       (($prop panel OPEN):
+               ($move .ME cel01)
+               ($say "You descend into the gloom...\n")
+       {else}: (($eq ($loc .ME) farm7):(cg))
+       );
+
+
+town1(SDESC) = ($say "One horse town.\n");
+town1(LDESC) =  ($say
+"You are at the northern end of a one-horse town.  Although the buildings
+are in good shape, all seem deserted.  You can't even find one horse.
+To the east is an old smithy.  On the west side of the street is an
+abandoned hotel.  The street runs north and south.\n");
+
+town2(SDESC) = ($say "One horse business district.\n");
+town2(LDESC) = ($say
+"You are at the southern end of a one-horse town.  This is the
+business district.  On the east side of the street is an old
+building with a tastefully lettered sign, 'Arpa-Citizen's Savings'.
+To the west is the legendary 'Packet Inn'.  The street runs north-south.\n");
+
+town3(SDESC) = ($say "Blacksmith's Shop.\n");
+town3(LDESC) = ($say
+"You're in what is left of a once-thriving blacksmith's shop.
+Long ago abandoned, nothing much of interest remains.\n");
+
+town4(SDESC) = ($say "Flophouse.\n");
+town4(LDESC) = ($say
+"You're in the Flophouse hotel.  Never worth the visit even in
+its heyday, a quick search reveals nothing but a lot of dusty rooms.\n");
+
+town5(SDESC) = ($say "Arpa-Citizen's Savings.\n");
+town5(LDESC) = ($say
+"You are in the ancient and venerable institution of Arpa-Citizen's
+Savings (there's a branch in your town).  The lobby is tastefully
+decorated in marble.  The only feature is a strange sweet-smelling
+well in the center of the room.  A mysterious plaque on the side")
+               ($say
+"reads:
+       'Drop your bits here!'
+");
+TWN5x =
+       (($eq ($verb) drop): (TWN5y));
+TWN5y =         ($say
+"A strange glowing network of lights appears, and you can read:\n")
+               (($prop ($dobj) POINTS):
+                       ($setg SCORE ($plus @SCORE ($prop ($dobj) POINTS)))
+                       ($move ($dobj) .ALL)
+                       ($say "   Your account is now at $")($num @SCORE)
+($say ".\n   Thank you for letting Arpa-Citizen's be your host.\n")
+               {else}:
+                       ($say "   Your deposit is worthless")
+                       (($pct 25):
+                               ($say ", but thanks for the trinket!\n")
+                               ($move ($dobj) .ALL)
+                       {else}:
+                               ($say "!  Keep it!\n")
+                       )
+               )
+               ($say "The Arpa network mercifully disappears.\n")
+               ;
+
+town6(SDESC)  = ($say "The Packet Inn.\n");
+town6(LDESC)  =
+       ($say
+"You are at that famous old saloon, the Packet Inn.  Thousands
+of the local adventurers drank 'till they were totally zorked in
+this colorful old haunt.  A little wandering convinces you that
+nothing much is to be seen.\n");
+
+{*** DUNGEON PROPER ***}
+cel01(LDESC) = ($say
+"You are in a secret cellar below the farmhouse.  In the
+corner of one wall is a strange insignia composed of red
+and green squares, joined at the corners.  Passages
+lead to north, west and south.  An old stairway leads up and out.\n")
+($move insig cel01);
+cel01(SDESC) = ($say "Secret cellar.\n")
+              ($move insig cel01);
+
+cel02(LDESC) = ($say
+"You are in a cool cave, once used for the storage of rare
+wines.  A cool breeze from the caves to the north keeps this cave
+at an even temperature the year round.  Exits can be seen
+to the south and east.\n");
+cel02(SDESC) = ($say "Cool cave.\n");
+
+{ cel03 was moved to after cel08 }
+
+
+cel04(LDESC) = ($say
+"This is a small temple to Elbereth, Queen of the Stars.  The walls
+glow with a warm iridescence of their own.  They are covered
+with murals depicting the kindling of the stars at the Beginning of
+Days.  In one corner, someone has added a strange insignia composed
+of red and white squares, joined at the corners.  Passages lead
+east and west, and a stairway to the north leads down into darkness.\n")
+($move insig cel04);
+cel04(SDESC) = ($say "Temple to Elbereth.\n")
+              ($move insig cel04);
+cel04(LIGHT)=TRUE;
+
+
+cel05(LDESC) = ($say
+"You are in an icy cave.  All the walls are covered with thick
+layers of ice.  The cave continues north and south, and there
+are side tunnels leading to the northeast and northwest.\n");
+cel05(SDESC) = ($say "Ice Cave.\n");
+
+cel06(LDESC) = ($say
+"You have reached a large cavern of ice.  You cannot see
+the roof, but you are sure it is covered with icicles.
+There are exits east and west.\n");
+cel06(SDESC) = ($say "Great Ice Cavern.\n");
+
+
+cel07(LDESC) = ($say
+"You are in a tiny side room where the ice dragon keeps his
+single prize treasure.  You may leave through a western doorway.\n");
+cel07(SDESC) = ($say "Dragon's Treasure Room.\n");
+
+cel08(LDESC) = ($say
+"You are in an old abandoned room, once the resident of a frustrated
+artist.  A huge mural depicting a barren wasteland covers the west
+wall.  A dim glow comes from the corridor to the east.\n");
+cel08(SDESC) = ($say "Artist's Retreat.\n");
+
+cel03(LDESC) = ($say
+"You are standing on the north bank of a frozen underground
+river.  The source of the river seems to have been to the
+west, and you can walk that way on the ice.  However, to
+the northeast, the river forms a frozen waterfall you can
+slide down.\n");
+cel03(SDESC) = ($say "Top of frozen fall.\n");
+
+cel09(LDESC) = ($say
+"You are at the southern end of a dry river gorge.  The source
+of the river was once a waterfall to the south, but for some reason
+it seems frozen solid.  The riverbed continues north.\n");
+cel09(SDESC) = ($say "Southern gorge.\n");
+
+cel10(LDESC) = ($say
+"You are in a dark cave.  The low-hanging stalactites and tall
+stalagmites cast eerily human-like shadows on the craggy walls.
+A roughly-hewn stairway to the south is lit by a dim illumination
+from above, while a slimy pit in the middle of the room leads
+down into even inkier blackness.  The system of caverns continues
+to the west.\n");
+cel10(SDESC) = ($say "Shadowy cave.\n");
+CELdL =
+(($and   (See [clear crystal] ($cont ($loc .ME)) )
+             ($prop [clear crystal] LIGHT)):
+
+                       ($say
+"You are in an impossibly dark cave.  Only the light from your
+magic crystal makes it possible to see, even dimly, here.  You
+can make out a tunnel leading north, and another leading east.
+No other exits are visible.\n")
+                    :  ($say "It's mighty dark in here!")
+                       ((See globe ($cont ($loc .ME))):
+                               (($prop globe LIGHT):
+                                       ($say
+"  Even your glowing globe is barely visible!")
+                               )
+                       )
+                       ($say "\n")
+                       ($setg DARKG TRUE)
+               );
+cel11(LDESC) = CELdL;
+CELdS =
+              ($say "DARK cave.\n")
+              (($and   (See [clear crystal] ($cont ($loc .ME)) )
+                       ($prop [clear crystal] LIGHT)):
+                       ($exit 0):($setg DARKG TRUE));
+cel11(SDESC) = CELdS;
+
+cel12(LDESC) = CELdL;
+cel12(SDESC) = CELdS;
+
+cel13(LDESC) = ($say
+"You are on a large underground lake of ice, thick enough
+to walk on.  To the west you can dimly make out a cavern
+entrance; to the east is an icy river you can walk on.\n")
+               (($prop cel13 HOLED):
+                       ($say
+"In the middle of the lake is a hole; icy water sloshes about
+two feet below the ice.\n")
+               );
+cel13(SDESC) = ($say "Icy lake.\n");
+
+cel14(LDESC) = (($ge ($prop .ME HAS) ($prop globe WEIGH)):
+                       ($say
+"Whatever it is you're carrying drags you down into the icy depths!\n")
+                       (die)
+               )
+               ($say
+"You are swimming beneath the ice.  There seems to be light to the
+east, but you can't hold your breath for long...\n")
+               ;
+cel14(SDESC) = ($say "You shouldn't have survived.\n");
diff --git a/usr/src/games/mpu/locnames b/usr/src/games/mpu/locnames
new file mode 100644 (file)
index 0000000..5531169
--- /dev/null
@@ -0,0 +1,53 @@
+NOUN .road;     rdsc =  ($say "You're on the road.\n");
+NOUN .gard;     gdsc =  ($say "You're somewhere in a cornfield.\n");
+NOUN .frst;     fdsc =  ($say "You're in the forest.\n");
+NOUN .dsrt;     dsrt =  ($say "You're in the middle of the desert.\n");
+NOUN .farm;
+NOUN .town;
+
+NOUN road1(.road);      road1(LIGHT) = TRUE;
+NOUN road2(.road);      road2(LIGHT) = TRUE;
+NOUN road3(.road);      road3(LIGHT) = TRUE;
+NOUN road4(.road);      road4(LIGHT) = TRUE;
+NOUN road5(.road);      road5(LIGHT) = TRUE;
+NOUN road6(.road);      road6(LIGHT) = TRUE;
+NOUN road7(.road);      road7(LIGHT) = TRUE;
+NOUN road8(.road);      road8(LIGHT) = TRUE;
+NOUN roadx;     { Where things on Highway 8 get held }
+
+NOUN gard1(.gard);      gard1(LIGHT) = TRUE;
+NOUN gard2(.gard);      gard2(LIGHT) = TRUE;
+NOUN gard3(.gard);      gard3(LIGHT) = TRUE;
+NOUN gard4(.gard);      gard4(LIGHT) = TRUE;
+NOUN gard5(.gard);      gard5(LIGHT) = TRUE;
+NOUN gard6(.gard);      gard6(LIGHT) = TRUE;
+NOUN gard7(.gard);      gard7(LIGHT) = TRUE;
+NOUN gard8(.gard);      gard8(LIGHT) = TRUE;
+
+NOUN frst1(.frst);      frst1(LIGHT) = TRUE;
+NOUN frst2(.frst);      frst2(LIGHT) = TRUE;
+NOUN frst3(.frst);      frst3(LIGHT) = TRUE;
+NOUN frst4(.frst);      frst4(LIGHT) = TRUE;
+
+NOUN farm1(.farm);      farm1(LIGHT) = TRUE;
+NOUN farm2(.farm);      farm2(LIGHT) = TRUE;
+NOUN farm3(.farm);      farm3(LIGHT) = TRUE;
+NOUN farm4(.farm);      farm4(LIGHT) = TRUE;
+NOUN farm5(.farm);      farm5(LIGHT) = TRUE;
+NOUN farm6(.farm);      farm6(LIGHT) = TRUE;
+NOUN farm7(.farm);      farm7(LIGHT) = TRUE;
+
+NOUN town1(.town);      town1(LIGHT) = TRUE;
+NOUN town2(.town);      town2(LIGHT) = TRUE;
+NOUN town3(.town);      town3(LIGHT) = TRUE;
+NOUN town4(.town);      town4(LIGHT) = TRUE;
+NOUN .bank;
+NOUN town5(.bank);      town5(LIGHT) = TRUE;
+NOUN town6(.town);      town6(LIGHT) = TRUE;
+
+NOUN cel01;
+NOUN cel02,cel03,cel04,cel05,cel06;
+NOUN cel07,cel08,cel09,cel10;
+NOUN cel11,cel12,cel13,cel14,cel15,cel16,cel19,cel20;
+NOUN cel21,cel22,cel23,cel24,cel25,cel26,cel29,cel30;
+NOUN cel31,cel32,cel33,cel34,cel35,cel36,cel39,cel40;
diff --git a/usr/src/games/mpu/mpu.ddl b/usr/src/games/mpu/mpu.ddl
new file mode 100644 (file)
index 0000000..2199ad0
--- /dev/null
@@ -0,0 +1,26 @@
+
+INCLUDE "constants";
+
+PREP with;
+PREP to;
+PREP into,  in;
+PREP at;
+
+INCLUDE "locnames";
+
+NOUN .ME (road1);
+.ME(OPEN) = TRUE;
+.ME(HOLDS) = CAPAC;
+
+INCLUDE "routines";
+
+INCLUDE "verbs";
+
+START = ($sdem LOOK)
+       ($setg LOOKP TRUE)
+       ($setv n s e w ne nw se sw u d)
+       ;
+
+INCLUDE "objects";
+INCLUDE "locales";
+INCLUDE "transitions";
diff --git a/usr/src/games/mpu/objects b/usr/src/games/mpu/objects
new file mode 100644 (file)
index 0000000..635aa36
--- /dev/null
@@ -0,0 +1,579 @@
+
+NOUN keys (town4);
+keys(WEIGH) = 2;
+keys(LDESC) = ($say "There's a set of keys here.\n");
+keys(SDESC) = ($say "a set of keys");
+
+NOUN toolbox (farm5);
+toolbox(WEIGH) = CAPAC;
+toolbox(HOLDS) = 50;
+toolbox(OPENS) = TRUE;
+toolbox(LOCKS) = TRUE;
+toolbox(LOCKD) = TRUE;
+toolbox(LIGHT) = TRUE;
+toolbox(LDESC) = (($eq ($loc .ME) toolbox):
+                       ($say
+"You are in a huge wooden structure, towering up at least 80 feet
+above your head, with wooden walls formed of immense 10-foot by 50-foot
+boards.  Everything here, even the grains of dust which cover the wooden
+floor, seems immense.  ")
+                       (($prop toolbox OPEN):
+                               ($say
+                     "Above your head, the top of the structure is open,
+and sunlight streams in.\n")
+               :               ($say
+                    "The structure is closed at the top, but
+enough light comes in from between the boards to enable you to see.\n")
+                       )
+       : {else} ($say
+                                              "  Against
+the house is a heavy ")
+               (($prop toolbox OPEN):
+                       ($say "toolbox with the lid open.\n")
+       {               (($cont toolbox) :
+                               ($say "In the toolbox, you see:\n")
+                               ($setp toolbox CONTS TRUE)
+                               (Slook 1 ($cont toolbox))
+                               ($setp toolbox CONTS FALSE)
+                       )}
+               :{else} (($prop toolbox LOCKD) :
+                               ($say "toolbox with a rusty lock, painted
+with an insignia composed of blue and green squares, joined at
+their corners.\n") :
+                               ($say "toolbox, the lid of which is ajar.\n")
+                       )
+               )
+       );
+
+toolbox(SDESC) =
+               (($eq ($loc .ME) toolbox):
+                       ($say   "Inside huge box.\n")
+               :{else} ($say "a toolbox"));
+
+toolbox(ACTION) =
+       (($eq ($loc .ME) toolbox) :
+               (($or ($eq ($verb) drop)
+                     ($eq ($verb) throw)):
+                       ($say "You just lost ")(($sdisc ($dobj)))
+                       ($say " in a crack between the wooden floorboards!\n")
+                       ($move ($dobj) .ALL)
+               )
+               ($miss cg cg cg cg cg cg cg cg cg cg)
+
+       {else} :
+               (($eq ($verb) lock):
+                   (Lockup toolbox keys "The toolbox seals with a CLICK!\n"))
+               (($eq ($verb) unlock):
+                   (Ulock toolbox keys
+"One of the keys fits!  The toolbox can be opened now.\n")
+               )
+       );
+
+NOUN signpost(roadx);
+signpost(RDLOC)=10;
+signpost(WEIGH)=CAPAC;
+signpostd(LDESC)=($say "There is a signpost by the side of the road.\n");
+signpostd(SDESC)=($say "a signpost");
+signpost(ACTION) = (($eq ($verb) read):
+                       ($say
+"Pointing east, it says: 'Unuchevala: 10 miles'\n")
+                       ($exit 1)
+                   );
+NOUN globe(toolbox);
+globe(WEIGH) = 20;
+globe(LDESC) = (($prop globe LIGHT):
+                       ($say "A globe of stone glows brightly here.\n")
+               {else}:
+                 ($say "There is a strange globe of polished stone here.\n")
+               );
+globe(SDESC) = (($prop globe LIGHT): ($say "a glowing globe of stone")
+                                  :  ($say "a stone globe"));
+globe(ACTION) = (($eq ($verb) rub):
+                   (($prop globe LIGHT):
+                       ($say "The light from the stone globe fades away.\n")
+                       ($setp globe LIGHT FALSE)
+                  {else}:
+                       ($say "The stone globe glows brightly!\n")
+                       ($setp globe LIGHT TRUE)
+                   )
+                   ($setg LOOKP TRUE)
+                   ($exit 1)
+               )
+               ;
+
+
+NOUN crowbar (town3);
+crowbar(WEIGH) = 100;
+crowbar(LDESC) = ($say "There is a long crowbar here.\n");
+crowbar(SDESC) = ($say "a crowbar");
+
+crydie =
+                       ($say
+"What POWER!  The magic crystal releases a flood of energy in
+a split-second!  Unfortunately, you were a little close...\n")
+                       (die);
+
+
+
+     { Dragon Stuff }
+       AWAKE=MISC1;
+
+NOUN dragon (cel06);
+
+
+ADJECTIVE red,green,blue,clear;
+white=clear;
+NOUN green crystal(cel07);
+NOUN red crystal(cel08);
+NOUN blue crystal(cel10);
+NOUN clear crystal(cel09);
+
+{NOUN diamond  { = clear crystal;
+{NOUN sapphire{=  blue crystal;
+{NOUN ruby (cel08){= red crystal;
+{NOUN emerald (cel07){= green crystal;}
+
+
+green crystal(WEIGH)=15;
+green crystal(POINT)=25;
+green crystal(LDESC) = ($say "There is a beautiful green crystal here!\n");
+green crystal(SDESC) = ($say "a green crystal");
+
+green crystal(ACTION) =
+       (($eq ($verb) take):
+              (($eq ($loc .ME) cel07):
+                       (($not ($prop dragon AWAKE)):
+                               ($say "You hear a stirring in the Ice Cavern.\n")
+                               ($setg Tempr ($plus @Tempr 2))
+                               ($setp dragon AWAKE TRUE)
+                               ($setp cel06 VISIT FALSE)
+
+                       :{else} ($setg Tempr 0)
+                       )
+               )
+       )
+       (($eq ($verb) drop):
+              (($eq ($loc .ME) cel07):
+                       ($setg Tempr ($minus @Tempr 2))
+                       (($le @Tempr 0) :
+                               ($setp dragon AWAKE FALSE)
+                               ($say
+"You hear a deep  Y A W N  from the Cavern.\n"))
+                       ($setp cel06 VISIT FALSE)
+               )
+       )
+       (($eq ($verb) touch):
+               (($eq ($dobj) [red crystal]) :
+                       ($say "The red and green crystals flare briefly!\n")
+                       (Grow)
+                       ($move .ME cel01)
+                       ($setg LOOKP TRUE)
+                       ($exit 1)
+               )
+               (($eq ($dobj) [blue crystal]) :
+                       ($say "The blue and green crystals flare briefly!\n")
+                       ($move .ME toolbox)
+                       (Shrink)
+                       ($setg LOOKP TRUE)
+                       ($exit 1)
+               )
+       )
+       (($eq ($verb) break):
+               (($eq ($dobj) [green crystal]):
+                       (crydie)
+               )
+       );
+ROUTINE CRout;
+WORKD = MISC1;                 { Has Clear crystal shed its light? }
+red crystal(WEIGH)=15;
+red crystal(POINT)=25;
+red crystal(LDESC) = ($say "There is a beautiful red crystal here!\n");
+red crystal(SDESC) = ($say "a red crystal");
+red crystal(ACTION) =
+       (($eq ($verb) touch):
+               (($eq ($dobj) [clear crystal]) :
+                   (($not ($prop [clear crystal] WORKD)):
+                       ($say "The red and clear crystals flare briefly!\n")
+                       ($setp [clear crystal] WORKD TRUE)
+                       ($setp [clear crystal] LIGHT TRUE)
+                       ($say
+"The clear crystal blazes forth with a magical incandescence brilliant
+enough to penetrate even the deepest darkness!!\n\n")
+                       ($sfus CRout 4)
+                       ($setg LOOKP TRUE)
+                       ($exit 1)
+            {else} :
+                       ($say
+"The clear crystal seems curiously inert now.\n")
+                       ($exit 1)
+                   )
+               )
+               (($eq ($dobj) [green crystal]) :
+                       ($say "The red and green crystals flare briefly!\n")
+                       (Grow)
+                       ($move .ME cel01)
+                       ($setg LOOKP TRUE)
+                       ($exit 1)
+               )
+       )
+       (($eq ($verb) break):
+               (($eq ($dobj) [red crystal]):
+                       (crydie)
+               )
+       );
+
+
+blue crystal(WEIGH)=15;
+blue crystal(POINT)=25;
+blue crystal(LDESC) = ($say "There is a beautiful blue crystal here!\n");
+blue crystal(SDESC) = ($say "a blue crystal");
+blue crystal(ACTION) =
+       (($eq ($verb) touch):
+               (($eq ($dobj) [red crystal]) :
+                       ($say "The red and blue crystals flare briefly!\n")
+                       ($exit 1)
+               )
+               (($eq ($dobj) [green crystal]) :
+                       ($say "The blue and green crystals flare briefly!\n")
+                       ($move .ME toolbox)
+                       (Shrink)
+                       ($setg LOOKP TRUE)
+                       ($exit 1)
+               )
+       )
+       (($eq ($verb) break):
+               (($eq ($dobj) [blue crystal]):
+                       (crydie)
+               )
+       );
+
+
+CRout = ($say "The glowing magical crystal seems to have gone dark.\n> ")
+       ($setp [clear crystal] LIGHT FALSE)
+       ;
+clear crystal(WEIGH)=15;
+clear crystal(POINT)=25;
+clear crystal(LDESC) = ($say "There is a beautiful clear crystal here")
+                      (($prop [clear cryst] LIGHT): ($say " (GLOWING!)"))
+                      ($say "!\n");
+clear crystal(SDESC) = ($say "a clear crystal")
+                      (($prop [clear cryst] LIGHT): ($say " (GLOWING!)"))
+                      ;
+clear crystal(ACTION) =
+       (($eq ($verb) touch):
+               (($eq ($dobj) [red crystal]) :
+                   (($not ($prop [clear crystal] WORKD)):
+                       ($say "The red and clear crystals flare briefly!\n")
+                       ($setp [clear crystal] WORKD TRUE)
+                       ($setp [clear crystal] LIGHT TRUE)
+                       ($say
+"The clear crystal blazes forth with a magical incandescence brilliant
+enough to penetrate even the deepest darkness!!\n\n")
+                       ($setg LOOKP TRUE)
+                       ($sfus CRout 4)
+                       ($exit 1)
+            {else} :
+                       ($say
+"The clear crystal seems curiously inert now.\n")
+                       ($exit 1)
+                   )
+               )
+       )
+       (($eq ($verb) break):
+               (($eq ($dobj) [red crystal]):
+                       (crydie)
+               )
+       );
+
+
+
+ROUTINE DRdem;          { Dragon Daemon.  Increases temper in .my presence }
+DRdem=  (($not ($prop dragon AWAKE)): ($exit 0))
+       (($eq ($loc .ME) ($loc dragon)):
+               (($eq ($loc [green crystal]) .ME):      { even worse! }
+                       ($setg Tempr ($plus @Tempr 1)))
+               ($setg Tempr ($plus @Tempr 1))  )
+{       ($say "His temper is now at ")($num @Tempr)($say "\n")  }
+       (($ge @Tempr 7):
+               ($say
+"Jeez, I didn't know ice dragons could reach their boiling point!
+In a final flare of rage, he opens his mouth and breathes his frigid
+breath in a blast in your direction.  It's a bit much for you.\n")
+               (die)
+        )
+       (($ge @Tempr 6) :
+               ($say "Gee, he looks like he's really at the edge!\n")
+               ($exit 0))
+       (($ge @Tempr 5) :
+               ($say "This is one upset dragon!  Be careful!\n")
+               ($exit 0))
+       (($ge @Tempr 3) :
+               ($say "He's getting angrier...\n")($exit 0))
+               ;
+
+dragon(WEIGH)=CAPAC;
+dragon(LDESC)=
+               (($prop dragon AWAKE):
+                       ($say
+"There is a fierce ice dragon glaring balefully in your direction.\n")
+               :{else}
+                       ($say
+"There is a large white dragon sleeping peacefully in the middle
+of the cavern floor.\n")
+               )
+               (DRdem);
+dragon(SDESC)=
+               (($prop dragon AWAKE): ($say "a fierce dragon")
+                                    : ($say "a somnolent dragon")
+               )
+               (@LOOKP: ($say "\n") (DRdem))
+               ;
+
+dragon(ACTION)=                 { Man, the things you can try here... }
+       (($prop dragon AWAKE):          { This is the harder stuff }
+               (($eq ($verb) strike):
+                       ($say "This just seems to get him angrier!\n")
+                       ($setg Tempr ($plus @Tempr 1))
+                       ($exit 1))
+               (($eq ($verb) throw):
+                       (($eq ($iobj) dragon):
+                               (($gt ($prop ($dobj) WEIGH) 75):
+                                       ($say
+                       "This just bruises him!  Now he's getting mad!\n")
+                                       ($setg Tempr ($plus @Tempr 1))
+                                       ($exit 1) :
+                               {else}
+                                       ($say
+                       "That object is just too light to hurt him.\n")
+                                       ($exit 1)
+                               )
+                       :       ($say "This amuses the dragon no end!\n")
+                               ($exit 1)
+                       ))              { end of Throw  case}
+       :{else}
+                                       { he's snoozing}
+               (($eq ($verb) wake):
+                       ($say "You manage to waken him.  He's not happy.\n")
+                       ($setg Tempr 1)
+                       ($setp dragon AWAKE TRUE)
+                       ($exit 1))
+               (($eq ($verb) strike):
+                       ($say "Now you woke him up!  He's upset, too!\n")
+                       ($setg Tempr 2)
+                       ($setp dragon AWAKE TRUE)
+                       ($exit 1))
+               (($eq ($verb) throw):
+                       (($eq ($iobj) dragon):
+                               (($gt ($prop ($dobj) WEIGH) 75):
+                                       ($say
+       "It's just heavy enough to waken him.  The bruise doesn't help
+his temper any either.\n")
+                                       ($setp dragon AWAKE TRUE)
+                                       ($setg Tempr 3)
+                                       ($exit 1) :
+                               {else}
+                                       ($say
+                       "That object is just too light to wake him.\n")
+                                       ($exit 1)
+                               )
+                       :       ($say "Don't hurt yourself trying!\n")
+                               ($exit 1)
+                       ))              { end of Throw  case}
+               );
+
+
+
+
+NOUN bed (farm7);
+bed(WEIGH) = CAPAC;
+bed(SDESC) = ($say "an old, rickety bed");
+
+bed(ACTION) =
+       (($eq ($verb) move):
+               (($prop bed OPEN) :
+                       ($say "Stop messing with the bed, it's fragile!\n")
+                       ($exit 1)
+               )
+               ($say
+"Moving the bed seems to have loosened one of the wall panels
+on the west wall.\n")
+               ($setp bed OPEN TRUE)
+               ($exit 1)
+       );
+
+NOUN panel (farm7);
+panel(OPENS) = TRUE;
+panel(WEIGH) = CAPAC;
+panel(ACTION) =
+       (($or ($eq ($verb) open)
+             ($eq ($verb) pry) ):
+               (($and ($eq ($iobj) crowbar)
+                  ($eq ($loc crowbar) .ME)):
+                       (($not ($prop bed OPEN)):
+                               ($say "There aren't any loose enough.\n")
+                               ($exit 1))
+                       ($say
+"The loose panel comes away, revealing a secret stairway down, down...\n")
+                       ($setp panel OPEN TRUE)
+         {else}:
+                       ($say "You can't seem to get the panel open.\n")
+               )
+               ($exit 1)
+
+       );
+
+NOUN knife (farm6);
+knife(LDESC)=
+       (($prop farm6 VISIT):
+               ($say "There is a carving knife here.\n")
+       :{else} ($say "However,
+on the table is a large carving knife (suitable for blind mice).\n")
+       );
+knife(SDESC)=($say "a carving knife");
+
+
+
+NOUN bottle(town6);
+bottle (LDESC) = ($say "There is a bottle here.\n");
+bottle (SDESC) = ($say "a bottle");
+bottle (TRANS) = TRUE;
+bottle (ACTION) =
+               (($eq ($verb) open):
+                       ($say "Hm, the bottle is somehow sealed shut.\n")
+                       ($exit 1))
+               (($eq ($verb) break):
+                       ($say "Wow, is that heavy glass!  It won't break!\n")
+                       ($exit 1))
+               (($eq ($verb) strike):
+                       (($eq ($iobj) bottle):
+                          ($say "Weird thing to do with it.\n")
+                    :     ($say "Nice try, but it isn't even scratched.\n")
+                       )
+                       ($exit 1));
+
+NOUN ship(bottle);
+ship (LDESC) = ($say "There is a model ship here.\n");
+ship (SDESC) = ($say "a model ship");
+ship (POINT) = 50;
+
+ROUTINE TWN5y;
+NOUN well(town5);
+well (WEIGH) = CAPAC;
+well (ACTION) =
+       (($eq ($iobj) well):
+               (($eq ($verb) put):
+                       (cdrop)
+                       (TWN5y)
+                       ($exit 1)
+               )
+       );
+
+NOUN insignia;
+insignia (WEIGH) = CAPAC;
+insignia (ACTION) = ($say "There's nothing useful to do with the insignia.\n")
+                   ($exit 1);
+square=insignia;
+
+ADJECTIVE glass;
+NOUN glass box(cel08);
+glass box(HOLDS)=1;
+glass box(TRANS)=TRUE;
+glass box(OPENS)=TRUE;
+glass box(OPEN)=FALSE;
+glass box(SHRNK)=TRUE;          { First seen as a tiny box }
+glass box(LDESC) =
+               (($eq ($prop .ME SHRNK) ($prop [glass box] SHRNK)):
+                       ($say "There is a big glass case here.\n")
+                       ($setp [glass box] WEIGH CAPAC)
+                       ($setp [glass box] HOLDS 50)
+
+               {else}:
+                       (($prop .ME SHRNK):
+                               ($say
+"Before you looms a huge glass wall, inscribed with the words,
+       'program error!'\n")
+                       {else} :
+                               ($say
+"There is a tiny glass box with a snap lid here.\n")
+                               ($setp [glass box] WEIGH 5)
+                               ($setp [glass box] HOLDS 1)
+
+                       )
+               );
+glass box(SDESC) =
+               (($eq ($prop .ME SHRNK) ($prop [glass box] SHRNK)):
+                       ($say "a glass case")
+                       ($setp [glass box] WEIGH CAPAC)
+                       ($setp [glass box] HOLDS 50)
+
+               {else}:
+                       (($prop .ME SHRNK):
+                               ($say
+"a huge glass wall, inscribed with the words,
+       'program error'")
+                       {else} :
+                               ($say "a tiny glass box")
+                               ($setp [glass box] WEIGH 5)
+                               ($setp [glass box] HOLDS 1)
+
+                       )
+               );
+case=glass box;
+
+NOUN sand(glass box);
+sand(SHRNK)=TRUE;
+sand(WEIGH)=1;
+sand(LDESC)=(($and ($prop sand SHRNK)
+                  ($not ($prop .ME SHRNK))):
+                       ($setp sand POINT 0)
+                       ($say "There is a grain of sand here.\n")
+
+               {else}: ($say "There is a beautiful porcelain statue here!\n")
+                       ($setp sand POINT 50)
+               );
+sand(SDESC)=(($and ($prop sand SHRNK)
+                  ($not ($prop .ME SHRNK))):
+                       ($setp sand POINT 0)
+                       ($say "a grain of sand") :
+                       ($say "a porcelain statue")
+                       ($setp sand POINT 50)
+               );
+statue=sand;
+sand(ACTION)=(($eq ($verb) take):
+                     (($and ($prop sand SHRNK)
+                            ($not ($prop .ME SHRNK))):
+           ($say "You fumble the grain of sand and lose it on the ground.\n")
+                                       ($move sand .ALL)
+                                       ($exit 1)
+                       )
+               );
+
+NOUN hole;
+
+
+
+NOUN saw(toolbox);
+saw(WEIGH) = 20;
+saw(LDESC) = ($say "There is a saw here.\n");
+saw(SDESC) = ($say "a saw");
+saw(ACTION) = (($eq ($verb) cut):
+                       (($eq ($dobj) hole):
+                               (($eq ($loc .ME) cel13):
+                                       (($prop cel13 HOLED):
+                                               ($say "There's already one here!\n")
+                                               ($exit 1)
+                               :{else}
+                                               ($say
+"You cut a hole in the thick ice; icy water sloshes about two feet down.\n")
+                                               ($setp cel13 HOLED TRUE)
+                                               ($move hole cel13)
+                                               ($exit 1)
+                                       )
+                               )
+                          { cutting a hole somewhere else }
+                          ($say "There's nowhere to cut a hole.\n")
+                          ($exit 1)
+                       )
+                       ($say "The saw isn't used that way.\n")
+                       ($exit 1)
+               );
diff --git a/usr/src/games/mpu/routines b/usr/src/games/mpu/routines
new file mode 100644 (file)
index 0000000..d9fcdb4
--- /dev/null
@@ -0,0 +1,212 @@
+ROUTINE VisP;
+VisP =                          { (Visp List Propno) => True IFF an object }
+(($eq %1 0) : ($rtrn FALSE))   {       is visible on List that has Propno }
+(($prop %1 INVIS) :
+       ($rtrn (VisP ($link %1) %2)))   { Ignore this object }
+(($prop %1 %2) :
+       ($rtrn TRUE))                   { Found one! }
+(($or ($prop %1 OPEN)
+      ($prop %1 TRANS)):                { Look inside...}
+       ( (VisP ($cont %1) %2): ($rtrn TRUE) ))
+($rtrn (VisP ($link %1) %2))
+;
+
+ROUTINE Reach;                  { (Reach obj loc) => True IFF the obj   }
+Reach =                         {       IS the loc or can be reached    }
+(($eq %2 0) : ($rtrn FALSE))    {       by the loc }
+(($eq %1 %2): ($rtrn TRUE))
+                       { Still explore inside }
+(($prop %2 OPEN):
+       ((Reach %1 ($cont %2)): ($rtrn TRUE))
+)
+($rtrn  (Reach %1 ($link %2)))
+
+;
+
+ROUTINE See;                  { (See obj loc) => True IFF the obj   }
+See   =                         {       IS the loc or can be seen       }
+(($prop %1 INVIS): ($rtrn FALSE))
+(($eq %2 0) : ($rtrn FALSE))
+(($eq %1 %2): ($rtrn TRUE))
+(($or  ($prop %2 TRANS)                 { Still explore inside }
+       ($prop %2 OPEN)):
+       ((See   %1 ($cont %2)): ($rtrn TRUE))
+)
+($rtrn  (See   %1 ($link %2)))
+;
+
+Avail =
+       (($not %1):($say "The what?\n")($exit 1))
+       (($not (See %1 ($cont ($loc .ME)))):
+               ($say "I can't see that item here.\n")
+               ($exit 1)
+         )
+       (($not (Reach %1 ($cont ($loc .ME)))):
+               ($say "I can't get at that item.\n")
+               ($exit 1)
+         )
+       (($and ($prop .ME SHRNK)
+              ($not ($prop %1 SHRNK))  ):
+                      (($ne ($loc %1) .ME):
+                               ($say
+"Right now, ")(($sdisc %1))($say " is too big for you to deal with.\n")
+                               ($exit 1)
+                       )
+         )
+       ($rtrn TRUE)
+;
+
+ROUTINE LitP;
+LitP =                          { (LitP Room) => True IFF Room is lit }
+(($prop %1 LIGHT) : ($rtrn TRUE))
+(($or (VisP ($cont %1) LIGHT)
+      (VisP ($cont %1) FLAME)): ($rtrn TRUE))
+
+(($or (VisP ($cont .ME) LIGHT)                  { Check .ME 'cause invisibl }
+      (VisP ($cont .ME) FLAME)): ($rtrn TRUE))
+($rtrn FALSE)
+;
+
+ROUTINE Blank;
+Blank =                         { Blank n => Type n blanks }
+(($gt %1 0):
+       ($say "  ")
+       (Blank ($minus %1 1)));
+
+ROUTINE Llook; ROUTINE Slook;
+Llook =                         { (Llook Level Object) describes Object }
+(($eq %2 0) : ($exit 0))
+(($eq %1 0) :                   { Level 0 == This is a room.  Check lighting }
+       ((LitP %2):
+               ($setg DARKG FALSE)
+               (($ldisc %2))           { Talk about the room }
+               (($not @DARKG):
+                       (Llook 1 ($cont %2))    { Talk about its contents }
+               )
+       {else}:
+               ($say "It's mighty dark in here!\n")
+               ($setg DARKG TRUE)
+       )
+
+{else} :                        { Level > 0 == This is a list of objs }
+       ( ($ldisc %2)   :       { Talk (only) about the visible }
+               (Blank %1)                      { Indent }
+               (($ldisc %2))           { Blurb the object }
+
+               ( ($cont %2):      { something inside it...}
+                       (($or ($prop %2 OPEN)($prop %2 TRANS)):
+                               (Blank %1)
+                               ($say "It contains:\n")
+                               ($setp %2 CONTS TRUE)
+                               (Slook ($plus %1 1) ($cont %2))
+                                       { Short descriptions for contents }
+                       )
+               )
+        )
+       (Llook %1 ($link %2))
+);
+
+
+Slook =                         { (Llook Level Object) describes Object }
+(($eq %2 0) : ($exit 0))
+(($eq %1 0) :                   { Level 0 == This is a room.  Check lighting }
+       ((LitP %2):
+               ($setg DARKG FALSE)
+               (($sdisc %2))           { Talk about the room }
+               (($not @DARKG):
+                       ($setp %2 CONTS FALSE)
+                       (Slook 1 ($cont %2))    { Talk about its contents }
+               )
+       {else}:
+               ($say "It's mighty dark in here!\n")
+               ($setg DARKG TRUE)
+       )
+
+{else} :                        { Level > 0 == This is a list of objs }
+       (($sdisc %2) :          { Talk (only) about the visible }
+               (($not ($prop ($loc %2) CONTS)):
+                       (Blank ($minus %1 1))
+                       ($say "You can see:\n")
+                       ($setp ($loc %2) CONTS TRUE)
+               )
+               (Blank %1)                      { Indent }
+               (($sdisc %2))           { Blurb the object }
+               (($and ($ne ($cont %2) 0)       { something inside it...}
+                      ($or ($prop %2 OPEN)     {...and you can see it }
+                           ($prop %2 TRANS)
+                       )
+                 ):
+
+                       ($setp %2 CONTS TRUE)
+                       ($say ", containing:\n")
+                       (Slook ($plus %1 1) ($cont %2))
+                                       { Short descriptions for contents }
+                  :    ($say "\n")
+
+               )
+       )
+       ( Slook %1 ($link %2))
+
+);
+
+
+
+
+LOOK =
+
+
+
+       ($setg WASDK @DARKG)
+       (@LOOKP :
+               (($prop ($loc .ME) VISIT):
+                       (Slook 0 ($loc .ME))
+                {else} :
+                       (Llook 0 ($loc .ME))
+                       ($setp ($loc .ME) VISIT TRUE)
+               )
+               (@DARKG : ($setp ($loc .ME) VISIT FALSE))
+       )
+       ($setg LOOKP FALSE)
+       ($itun)
+       ($say "\n> ")
+;
+
+ROUTINE GrowX; ROUTINE ShrnX;
+GrowX = (($prop %1 SHRNK):
+               ($setp %1 SHRNK FALSE)
+               (($cont %1):
+                       (GrowX ($cont %1)))
+               (($link %1):
+                       (GrowX ($link %1)))
+       )
+       ;
+
+Grow = (($prop .ME SHRNK):
+               ($setp .ME SHRNK FALSE)
+               (($cont .ME):
+                       (GrowX ($cont .ME)))
+       )
+;
+
+ShrnX = (($not ($prop %1 SHRNK)):
+               ($setp %1 SHRNK TRUE)
+               (($cont %1):
+                       (ShrnX ($cont %1)))
+               (($link %1):
+                       (ShrnX ($link %1)))
+{else}  :
+               ($say "You hear a tiny POP as ")(($sdisc %1))
+               ($say " vanishes completely!\n")
+               (($link %1):
+                       (ShrnX ($link %1)))
+               ($move %1 .ALL)
+       )
+
+;
+
+Shrin= (($not ($prop .ME SHRNK)):
+               ($setp .ME SHRNK TRUE)
+               (($cont .ME):
+                       (ShrnX ($cont .ME)))
+       )
+;
diff --git a/usr/src/games/mpu/transitions b/usr/src/games/mpu/transitions
new file mode 100644 (file)
index 0000000..2837e2f
--- /dev/null
@@ -0,0 +1,212 @@
+{*** TRANSITIONS ***}
+
+road1(ACTION) = ($setv n s e w ne nw se sw u d)
+               ($hit .ME gard1 gard5 road2 road3 gard2 gard3 gard6 gard7 0 0)
+               ($miss 0        0  0    0       0       0  0    0    cg cg);
+
+road2(ACTION) = ($hit .ME gard2 gard6 road7 road1 gard2 gard1 gard6 gard5 0 0)
+               ($miss 0        0  0    0       0       0  0    0    cg cg);
+
+road3(ACTION) = ($hit .ME gard3 gard7 road1 road8 gard1 gard3 gard5 gard7 0 0)
+               ($miss 0        0  0        entr8   0   0  0    0    cg cg);
+
+road4(ACTION) = ($hit .ME farm1 road7 frst1 gard2 frst1 gard2 frst1 gard2 0 0)
+               ($miss 0        0  0    0       0       0  0    0    cg cg);
+
+road5(ACTION) = ($hit .ME road7 road6 frst1 gard6 frst1 gard6 frst1 gard6 0 0)
+               ($miss 0        0  0    0       0       0  0    0    cg cg);
+
+road6(ACTION) = ($hit .ME road5 town1 frst1 gard6 frst1 gard6 frst1 gard6 0 0)
+               ($miss 0        0  0    0       0       0  0    0    cg cg);
+
+road7(ACTION) = ($hit .ME road4 road5 frst1 road2 frst1 gard2 frst1 gard6 0 0)
+               ($miss 0        0  0    0       0       0  0    0    cg cg);
+
+road8(ACTION) = ($miss tress tress east8 west8 cg cg cg cg cg cg);
+
+east8 = ( ($eq @HWY8 0) : ($move .ME road3)
+      { ELSE } :        (dump8 ($cont road8))
+                       ($setg HWY8 ($minus @HWY8 1))
+                       (get8 ($cont roadx))
+                       (Slook 0 ($loc .ME))
+                       ($setg LOOKP FALSE)
+               );
+
+west8 =
+                       (dump8 ($cont road8))
+                       ($setg HWY8 ($plus @HWY8 1))
+                       (get8 ($cont roadx))
+                       (Slook 0 ($loc .ME))
+                       ($setg LOOKP FALSE);
+
+dump8 = (($link %1) : (dump8 ($link %1)))       { start at bottom }
+       (($ne %1 .ME) :                 { Everything else leaves }
+               ($setp %1 RDLOC @HWY8)  { Retain its location on HWY 8 }
+               ($move %1 roadx)        { Put it in the box }
+       );
+
+get8 =  ( %1 :
+               (get8 ($link %1))
+               (($eq ($prop %1 RDLOC) @HWY8) :
+                       ($move %1 road8)
+               )
+       );
+
+entr8 =         (dump8 ($cont road8))
+               ($setg HWY8 0)
+               (get8 ($cont roadx));
+
+
+
+
+
+
+gard1(ACTION) = ($hit .ME gard4 road1 gard2 gard3 0 0 0 0 0 0 )
+               ($miss     0    0       0   0     cg cg cg cg cg cg);
+
+gard2(ACTION) = ($hit .ME gard4 road2 gard2 gard1 0 0 0 0 0 0 )
+               ($miss     0     0      0       0 cg cg cg cg cg cg);
+
+gard3(ACTION) = ($hit .ME gard4 road3 gard1 gard3 0 0 0 0 0 0 )
+               ($miss    0     0      0        0 cg cg cg cg cg cg);
+
+gard4(ACTION) = ($hit .ME gard4 gard1 gard2 gard3 0 0 0 0 0 0 )
+               ($miss    0     0       0       0 cg cg cg cg cg cg);
+
+
+gard5(ACTION) = ($hit .ME road1 gard8 gard6 gard7 0 0 0 0 0 0 )
+               ($miss     0    0       0   0     cg cg cg cg cg cg);
+
+gard6(ACTION) = ($hit .ME road2 gard8 gard6 gard5 0 0 0 0 0 0 )
+               ($miss    0     0       0       0 cg cg cg cg cg cg);
+
+gard7(ACTION) = ($hit .ME road3 gard8 gard5 gard7 0 0 0 0 0 0 )
+               ($miss     0    0       0       0 cg cg cg cg cg cg);
+
+gard8(ACTION) = ($hit .ME gard5 gard8 gard6 gard7 0 0 0 0 0 0 )
+               ($miss     0      0     0       0 cg cg cg cg cg cg);
+
+
+
+
+frst1(ACTION) = ($hit .ME frst3 frst1 frst2 frst2 0 0 0 0 0 0)
+               ($miss       0    0     0       0 cg cg cg cg cg cg);
+
+frst2(ACTION) = ($hit .ME frst1 frst2 frst3 frst1 0 0 0 0 0 0)
+               ($miss       0    0     0       0 cg cg cg cg cg cg);
+
+frst3(ACTION) = ($hit .ME frst1 frst3 frst2 frst2 0 0 0 0 0 0)
+               ($miss       0    0     0       0 cg cg cg cg cg cg);
+
+frst4(ACTION) = ($hit .ME frst4 frst2 frst1 road7 0 0 0 0 0 0)
+               ($miss       0   0      0    0    cg cg cg cg cg cg);
+
+
+farm1 (ACTION) =($hit .ME farm2 road4 farm3 farm4 farm3 farm4 0 0 0 0)
+               ($miss     0     0      0       0  0     0    cg cg cg cg);
+
+farm2 (ACTION) = ($hit .ME farm6 farm1 farm7 0 0 0 0 0 farm7 0)
+                ($miss     0    0       0  cg cg cg cg cg 0 cg);
+
+farm3 (ACTION) = ($hit .ME farm5 farm1 frst1 0 0 farm5 0 farm1 0 0)
+                ($miss     0    0      0  cg cg   0  cg   0  cg cg);
+
+farm4 (ACTION) = ($hit .ME farm5 farm1 0 gard4  farm5 0 farm1 0  0 0)
+                ($miss     0     0   cg   0     0   cg   0  cg cg cg);
+
+farm5 (ACTION) = ($hit .ME 0  0 farm3 farm4 0 0 farm3 farm4 0 0)
+                ($miss    cg cg   0   0  cg cg   0    0  cg  cg);
+
+farm6 (ACTION) = ($hit .ME 0 farm2 0 0 0 0 0 0 0 0)
+                ($miss   cg 0 cg cg cg cg cg cg cg cg );
+
+farm7 (ACTION) =
+                ($hit .ME 0 0 farm2 0 0 0 0 0 0 farm2)
+                ($miss   cg cg 0 PanL cg cg cg cg cg PanL);
+
+
+town1 (ACTION) =($hit .ME road6 town2 town3 town4 0  0  0  0  0  0)
+               ($miss       0    0    0        0 cg cg cg cg cg cg);
+
+town2 (ACTION) =($hit .ME town1   0   town5 town6 0  0  0  0  0  0)
+               ($miss       0    cg   0        0 cg cg cg cg cg cg);
+
+town3 (ACTION) =($hit .ME    0    0    0    town1 0  0  0  0  0  0)
+               ($miss      cg   cg   cg        0 cg cg cg cg cg cg);
+
+town4 (ACTION) =($hit .ME    0    0  town1      0 0  0  0  0  0  0)
+               ($miss      cg   cg    0       cg cg cg cg cg cg cg);
+
+town5 (ACTION) =($hit .ME    0    0    0    town2 0  0  0  0  0  0)
+               ($miss      cg   cg    cg     0   cg cg cg cg cg cg)
+               (TWN5x);
+
+town6 (ACTION) =($hit .ME    0    0  town2      0 0  0  0  0  0  0)
+               ($miss      cg   cg    0       cg cg cg cg cg cg cg);
+
+
+cel01 (ACTION) = ($hit .ME cel02  0    0  cel04 0  0  0  0  farm7 0)
+                ($miss     0     ny  cg    0   cg cg cg cg   0   cg);
+
+cel02 (ACTION) = ($hit .ME cel05 cel01  0    0  0  0  0  0    0   0)
+                ($miss     0     0     ny  cg cg cg cg cg   cg   cg);
+
+cel03 (ACTION) = ($hit .ME  0   cel05   0 cel13 cel09 0  0  0    0   cel09)
+                ($miss     cg    0     cg  0     0   cg cg cg   cg    0);
+
+cel04 (ACTION) = ($hit .ME  cel10   0    cel01 cel08 0  0  0  0    0  cel10)
+                ($miss      0      cg     0     0   cg cg cg cg   cg   0 );
+
+
+MV56=($setg Cel6x 5);
+MV76=($setg Cel6x 7);
+MV67=( ($and ($ne @Cel6x 7)
+            ($prop dragon AWAKE)): ($say
+"The ice dragon blocks your attempt to cross!\n\n")
+               :         ($move .ME cel07) );
+
+MV65=( ($and ($ne @Cel6x 5)
+            ($prop dragon AWAKE)): ($say
+"The ice dragon blocks your attempt to leave!\n")
+               :         ($move .ME cel05) );
+
+
+cel05 (ACTION) = ($hit .ME cel03 cel02  0    0 cel06  0  0  0    0   0)
+                ($miss      0    0     cg  cg MV56   ny cg cg   cg   cg);
+
+cel06 (ACTION) = ($hit .ME  0     0      0     0    0  0  0  0    0   0)
+                ($miss     cg    cg    MV67 MV65  cg cg cg cg   cg   cg)
+               (($eq ($loc .ME) cel06) {still here}:
+                       ($setg LOOKP TRUE)
+               )
+                 ;
+
+cel07 (ACTION) = ($hit .ME  0     0      0   cel06  0  0  0  0    0   0)
+                ($miss     cg    cg     cg  MV76  cg cg cg cg   cg   cg);
+
+cel08 (ACTION) = ($hit .ME  0     0    cel04   0    0  0  0  0    0   0)
+                ($miss     cg    cg     0    ny   cg cg cg cg   cg   cg);
+
+cel09 (ACTION) = ($hit .ME   0     0     0     0     0  0  0  0   0   0)
+                ($miss     ny     cg   cg    cg    cg cg cg cg cg   cg);
+
+cel10 (ACTION) = ($hit .ME   0   cel04   0     0     0  0  0  0   0  cel11)
+                ($miss     cg     0    cg    ny    cg cg cg cg cg    0);
+
+cel11 (ACTION) = ($hit .ME   0     0  cel12    0     0  0  0  0   0   0)
+                ($miss     ny     cg   0     cg    cg cg cg cg cg   cg);
+
+cel12 (ACTION) = ($hit .ME  cel11  0     0     0     0  0  0  0   0   0)
+                ($miss      0     cg   ny    cg    cg cg cg cg cg   cg);
+
+cel13 (ACTION) = (($eq ($verb) down):
+                       (($prop cel13 HOLED):
+                               ($say "You plunge into the icy waters!\n")
+                               ($move .ME cel14)
+                               ($exit 0)
+                       )
+                 )
+               ($hit .ME  0   0   cel03   0   0  0  0  0   0  0)
+               ($miss    cg  cg    0     ny  cg  cg cg cg cg cg);
+
+
diff --git a/usr/src/games/mpu/verbs b/usr/src/games/mpu/verbs
new file mode 100644 (file)
index 0000000..b790f88
--- /dev/null
@@ -0,0 +1,305 @@
+VERB Debug;
+VERB n,s,e,w,ne,se,nw,sw;
+VERB up,down;
+u=up; d=down;
+north=n; south=s; east=e; west=w;
+Looks = ($setg LOOKP TRUE)(($dobj): ($say "Huh?\n")($exit 1));
+
+
+n (PREACT) = Looks;
+s (PREACT) = Looks;
+e (PREACT) = Looks;
+w (PREACT) = Looks;
+
+nw(PREACT) = Looks;
+ne(PREACT) = Looks;
+sw(PREACT) = Looks;
+se(PREACT) = Looks;
+
+u (PREACT) = Looks;
+d (PREACT) = Looks;
+
+VERB take; VERB drop;
+get=take; carry=take;
+take(PREACT) = (Avail ($dobj));
+drop(PREACT) = (Avail ($dobj));
+ROUTINE ctake; ROUTINE cdrop;
+
+VERB save;
+VERB shell;
+VERB restore;
+save(ACTION) = ($spec 4 0 0 0 0);
+shell(ACTION) = ($spec 6 "/bin/csh" "-i" 0 0);
+restore(ACTION) = ($spec 5 0 0 0 0) ($say "Restored.\n");
+
+DWIMD = (($not (See ($dobj) ($cont ($loc .ME)))):
+               ($rtrn 0)
+         )
+       (($not (Reach ($dobj) ($cont ($loc .ME)))):
+               ($rtrn 0)
+         )
+       (($and ($eq ($verb) take) ($eq ($loc ($dobj)) .ME)):
+               ($rtrn 0)
+         )
+       (($and ($eq ($verb) drop) ($ne ($loc ($dobj)) .ME)):
+               ($rtrn 0)
+         )
+       ($rtrn 1)
+;
+
+DWIMI = (($not (See ($iobj) ($cont ($loc .ME)))):
+               ($rtrn 0)
+         )
+       (($not (Reach ($iobj) ($cont ($loc .ME)))):
+               ($rtrn 0)
+         )
+       (($and ($eq ($verb) take) ($eq ($loc ($iobj)) .ME)):
+               ($rtrn 0)
+         )
+       (($and ($eq ($verb) drop) ($ne ($loc ($iobj)) .ME)):
+               ($rtrn 0)
+         )
+
+       ($rtrn 1)
+;
+
+
+
+
+
+take(ACTION) = (ctake);
+ctake =
+       (($ge ($plus ($prop .ME HAS)
+                    ($prop ($dobj) WEIGH))
+             ($prop .ME HOLDS)):
+               ($say "You can't take that!\n")
+               ($exit 0)
+       )
+       ($setp .ME HAS ($plus ($prop .ME HAS) ($prop ($dobj) WEIGH) ) )
+       ($say "Taken.\n") ($move ($dobj) .ME)
+       ;
+
+drop(ACTION) = (cdrop);
+cdrop = (($ne ($loc ($dobj)) .ME) :
+       ($say "You don't have it with you.\n")($exit 1))
+       ($say "Dropped.\n") ($move ($dobj) ($loc .ME))
+       ($setp .ME HAS ($minus ($prop .ME HAS)($prop ($dobj) WEIGH)))
+       ;
+
+VERB put;
+put (PREACT) =
+       (($ne ($loc ($dobj)) .ME) :
+               ($say "You don't have it with you.\n")($exit 1))
+       (Avail ($iobj));
+put(ACTION) =
+       (($not ($and ($prop ($iobj) OPEN)
+                    ($prop ($iobj) OPENS))):
+               ($say "You can't seem to manage that trick.\n")($exit 0))
+       (($gt ($plus ($prop ($iobj) HAS)
+                    ($prop ($dobj) WEIGH))
+             ($prop ($iobj) HOLDS)):
+               ($say "It won't fit!\n")($exit 0))
+       ($say "OK\n") ($move ($dobj) ($iobj))
+       ($setp ($iobj) HAS ($plus ($prop ($iobj) HAS) ($prop ($dobj) WEIGH)))
+       ;
+
+
+
+
+
+
+
+
+
+VERB open; VERB close;
+open(PREACT) = (Avail ($dobj))(($iobj):(Avail ($iobj)));
+close(PREACT) = (Avail ($dobj))(($iobj):(Avail ($iobj)));
+open(ACTION) =
+       (($not ($prop ($dobj) OPENS)):
+               ($say "I don't know how to open that!\n")($exit 0))
+       (($and ($prop ($dobj) LOCKS)
+              ($prop ($dobj) LOCKD)):
+               ($say "I can't open it, it's locked!\n")($exit 0))
+       (($prop ($dobj) OPEN):
+               ($say "It's already open!\n")($exit 0))
+       ($setp ($dobj) OPEN TRUE)
+       ($say "Opened.\n")
+       (($and  ($ne 0 ($cont ($dobj)))  ($not ($prop ($dobj) TRANS))):
+               (Llook 1 ($cont ($dobj)))
+       )
+       ;
+
+close (ACTION) =
+       (($not ($prop ($dobj) OPENS)):
+               ($say "I don't know how to close that!\n")($exit 0))
+       (($not ($prop ($dobj) OPEN)):
+               ($say "It's already closed!\n")($exit 0))
+       ($setp ($dobj) OPEN FALSE)
+       ($say "Closed\n")
+       ;
+
+
+VERB lock; VERB unlock;
+lock(PREACT) = (Avail ($dobj))(($iobj):(Avail ($iobj)));
+unlock(PREACT) = (Avail ($dobj))(($iobj):(Avail ($iobj)));
+
+Lockact =
+       (($prop ($dobj) LOCKS) :
+               ($say "Hm, you don't seem to have the right key.\n")
+       {else}:
+               ($say "I don't know how to lock or unlock such a thing.\n")
+       );
+
+lock(ACTION) = Lockact;
+unlock(ACTION) = Lockact;
+
+Lockup =
+       (($prop %1 OPEN):
+               ($say "You must close it first.\n")($exit 1))
+       (($prop %1 LOCKD):
+               ($say "It's already locked!\n")($exit 1))
+       (($not ($prop %1 LOCKS)):($exit 0))
+       (($eq ($loc %2) .ME):
+               ($say %3)
+               ($setp %1 LOCKD TRUE)
+               ($exit 1))
+               ;
+Ulock  =
+       (($not($prop %1 LOCKD)):
+               ($say "It's already unlocked!\n")($exit 1))
+       (($not ($prop %1 LOCKS)):($exit 0))
+       (($eq ($loc %2) .ME):
+               ($say %3)
+               ($setp %1 LOCKD FALSE)
+               ($exit 1))
+               ;
+
+
+
+
+VERB move;
+move(PREACT) = (Avail ($dobj));
+move(ACTION) =
+($say "Nothing seems to happen.\n");
+push=move;
+pull=move;
+lift=move;
+
+VERB break;
+break(PREACT) = (Avail ($dobj));
+break(ACTION) =
+($say "It seems to be unbreakable.\n");
+
+VERB strike; hit=strike; kill=strike;
+strike(PREACT) = (Avail ($dobj))
+                (($iobj):
+                       (($ne ($loc ($iobj)) .ME):
+                               ($say "You don't have it with you.\n")
+                               ($exit 1)
+                        )
+                 );
+strike(ACTION) = ($say "Hitting ")(($sdisc ($dobj)))($say
+ " doesn't seem to do anything.");
+
+VERB touch;  feel=touch;
+touch(PREACT) = (Avail ($dobj))
+               (($iobj):
+                      (($ne ($loc ($iobj)) .ME):
+                               ($say "You don't have it with you.\n")
+                               ($exit 1)
+                       )
+               );
+touch(ACTION) = ($say "Touching ")(($sdisc ($dobj)))
+               ($say " doesn't seem too useful.\n");
+
+
+
+
+
+
+VERB rub;
+rub(PREACT) = (Avail ($dobj));
+rub(ACTION) = ($say "Nothing happens when you rub ")
+               (($sdisc ($dobj)))($say ".\n");
+
+VERB cut;
+cut(PREACT) = (($not ($iobj)): ($say "You need tools to do that.\n")
+                              ($exit 1))
+             (Avail ($iobj));
+
+VERB pry;
+pry(PREACT) =  (Avail ($dobj))
+              (($not ($iobj)): ($say "You need tools to do that.\n")
+                               ($exit 1))
+              (Avail ($iobj));
+
+pry(ACTION) =  ($say "I can't seem to manage that.\n");
+
+VERB BEAM; BEAM(ACTION)=($setg LOOKP TRUE)($move .ME ($dobj));
+VERB JOIN; JOIN(ACTION) = ($setg LOOKP TRUE)($move .ME ($loc ($dobj)));
+
+
+VERB GRAB;
+GRAB(ACTION) = ($move ($dobj) .ME)
+              ($say "You have the ")($name ($dobj))($say ", boss!\n");
+
+VERB throw;
+throw(PREACT) = (($ne ($loc ($dobj)) .ME): ($say "You aren't holding it!\n")
+                                          ($exit 1));
+throw(ACTION) = ($move ($dobj) ($loc .ME))
+               ($say "Thrown.\n");
+
+VERB wake;
+wake(PREAC) = (Avail ($dobj));
+wake(ACTION) = ($say "I don't know how to wake ")(($sdisc ($dobj)))
+               ($say ".\n");
+VERB read;
+read(PREAC) = (Avail ($dobj));
+read(ACTION) = ($say "It doesn't have anything on it to read.\n");
+
+VERB light;
+light(PREACT) = (Avail ($dobj));
+
+cg = ($say "Can't go that way.
+");
+ny = ($say "That exit seems impassable today!?\n");
+
+die = ($say "You are dead.  Better luck next time.\n")
+      ($spec 3 0 0 0 0);
+
+tress = ($say "You were warned about trespassing! The fence is electrified!\n")
+       (die);
+
+
+VERB look;
+VERB quit;
+VERB inven;
+VERB score;
+
+look(ACTION) = (Llook 0 ($loc .ME))
+                     ;
+inven(ACTION) = (($not ($cont .ME)):
+                       ($say "You are empty-handed.\n")
+                       ($exit 1))
+               ($setp .ME CONTS TRUE)
+               ($say "You are carrying:\n")
+               (Slook 1 ($cont .ME))
+                       ;
+quit(ACTION) = ($spec 3 0 0 0 0);
+
+score(ACTION) =
+       (($eq ($loc .ME) town5):
+               ($say
+"A mysterious glowing network of lights appears, and you can
+just make out the words:
+   Your account is now at $")
+               ($num @SCORE)
+               ($say ".
+   Thank you for letting Arpa-Citizen's be your host.\n")
+               ($say
+"The network then disappears.\n")
+       {else}:
+               ($say
+"Hmm, you'll have to check at the local bank.\n")
+       );
+