aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhistoricalsource <historicalsoftware@textfiles.com>2019-04-16 09:52:54 -0400
committerhistoricalsource <historicalsoftware@textfiles.com>2019-04-16 09:52:54 -0400
commit8b3579aab4bf7b8a2eacbc3d5011ef4afb387a3a (patch)
tree42bd25879079f5367543d91e9f30f7e1421b36fe
downloadzorkzero-8b3579aab4bf7b8a2eacbc3d5011ef4afb387a3a.tar.gz
zorkzero-8b3579aab4bf7b8a2eacbc3d5011ef4afb387a3a.tar.bz2
zorkzero-8b3579aab4bf7b8a2eacbc3d5011ef4afb387a3a.zip
Release 296
-rw-r--r--README.md1
-rw-r--r--castle.zabstr1062
-rw-r--r--castle.zap2732
-rw-r--r--castle.zil4823
-rw-r--r--chess.zabstr144
-rw-r--r--chess.zap753
-rw-r--r--chess.zil937
-rw-r--r--clues.zap505
-rw-r--r--clues.zil538
-rw-r--r--constants.zil208
-rw-r--r--defs.zil132
-rw-r--r--defs2.zabstr69
-rw-r--r--defs2.zap13
-rw-r--r--defs2.zil165
-rw-r--r--fenshire.zabstr153
-rw-r--r--fenshire.zap948
-rw-r--r--fenshire.zil1122
-rw-r--r--find.zap499
-rw-r--r--find.zil555
-rw-r--r--globals.zabstr271
-rw-r--r--globals.zap2131
-rw-r--r--globals.zil2460
-rw-r--r--gram.zil187
-rw-r--r--highway.zabstr406
-rw-r--r--highway.zap1392
-rw-r--r--highway.zil2196
-rw-r--r--hints.zil1121
-rw-r--r--input.zabstr50
-rw-r--r--input.zap490
-rw-r--r--input.zil500
-rw-r--r--jester.zabstr222
-rw-r--r--jester.zap1467
-rw-r--r--jester.zil1836
-rw-r--r--lake.zabstr452
-rw-r--r--lake.zap1351
-rw-r--r--lake.zil2231
-rw-r--r--library.zabstr281
-rw-r--r--library.zap166
-rw-r--r--library.zil585
-rw-r--r--misc.zabstr65
-rw-r--r--misc.zap424
-rw-r--r--misc.zil644
-rw-r--r--oracle.zabstr807
-rw-r--r--oracle.zap1801
-rw-r--r--oracle.zil3376
-rw-r--r--parser.zap1045
-rw-r--r--parser.zil1719
-rw-r--r--pdefs.zil296
-rw-r--r--pic.zabstr13
-rw-r--r--pic.zap100
-rw-r--r--pic.zil96
-rw-r--r--picdef.zil484
-rw-r--r--pmem.zap40
-rw-r--r--pmem.zil270
-rw-r--r--prare.zap1006
-rw-r--r--prare.zil984
-rw-r--r--prologue.zabstr158
-rw-r--r--prologue.zap862
-rw-r--r--prologue.zil1245
-rw-r--r--pstack.zap18
-rw-r--r--pstack.zil116
-rw-r--r--reds.zap1441
-rw-r--r--reds.zil1334
-rw-r--r--syntax.zil823
-rw-r--r--top.zap624
-rw-r--r--top.zil943
-rw-r--r--verbs.zap5511
-rw-r--r--verbs.zil5346
-rw-r--r--village.zabstr277
-rw-r--r--village.zap613
-rw-r--r--village.zil1171
-rw-r--r--zork0.errors39
-rw-r--r--zork0.picbin0 -> 34075 bytes
-rw-r--r--zork0.zap84
-rw-r--r--zork0.zil62
-rw-r--r--zork0.zipbin0 -> 295536 bytes
-rw-r--r--zork0.zpic2108
-rw-r--r--zork0dat.zap26969
-rw-r--r--zork0freq.xzap200
-rw-r--r--zork0pur.zap5247
-rw-r--r--zork0str.zap2108
81 files changed, 105623 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..2af701f
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+# zorkzero
diff --git a/castle.zabstr b/castle.zabstr
new file mode 100644
index 0000000..d23159f
--- /dev/null
+++ b/castle.zabstr
@@ -0,0 +1,1062 @@
+
+<BEGIN-SEGMENT CASTLE>
+<ROOM GREAT-HALL (LOC ROOMS) (REGION "Flatheadia") (DESC "Great Hall") (LDESC
+"This is the huge central chamber of Dimwit's castle. The ceiling was
+lowered at some point in the past, which helped reduce the frequency of
+storm clouds forming in the upper regions of the hall. Arched openings
+lead off in the four cardinal directions. A wide stair leads up to the
+balcony, and an equally wide but ominously dark stair leads downward.") (NORTH
+TO ENTRANCE-HALL) (SOUTH TO AUDIENCE-CHAMBER) (EAST TO COURTYARD) (WEST TO
+FORMAL-GARDEN) (UP TO BALCONY) (DOWN PER LOWER-HALL-ENTER-F) (FLAGS RLANDBIT
+ONBIT) (GLOBAL STAIRS BANNER) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-4
+MAP-GEN-X-5>)>
+<DEFINE-ROUTINE LOWER-HALL-ENTER-F>
+<OBJECT CALENDAR (DESC "calendar") (LDESC
+"A calendar for 883 GUE is lying here.") (SYNONYM CALENDAR) (FLAGS READBIT
+TAKEBIT) (SIZE 3) (TEXT
+"[This is the \"Lives of the Twelve Flatheads Calendar\" which you can find
+in your Zork Zero package.]")>
+<OBJECT CALENDAR-ITEMS (LOC GENERIC-OBJECTS) (DESC "it") (SYNONYM POISON AX AXE
+COBRA SKULL KNIFE DAGGER TROPHY STICK BALL HELMET EPAULET EPAULETTE MEDAL
+TEMPLATE PENCIL TRIANGLE CRAYON COMPASS ELEPHANT VOLCANO BRUSH AVOCADO INKWELL
+RAVEN STAMP CIGAR BURNER CELERY MATCH BOWTIE) (ADJECTIVE HOCKEY RUBBER BUNSEN)>
+
+<OBJECT LOCKET-MOOSE (LOC GENERIC-OBJECTS) (DESC "it") (SYNONYM LOCKET MOOSE)>
+<OBJECT PROCLAMATION (DESC "proclamation") (FDESC
+"A proclamation hangs on the wall.") (OWNER WALL) (SYNONYM PROCLAMATION DECREE)
+(FLAGS READBIT TAKEBIT BURNBIT TRYTAKEBIT) (SIZE 2) (TEXT
+"\"The one who can stop the Curse of Megaboz, and save the land from
+destruction, shall be rewarded with half the wealth of the Empire.|
+ (signed) Wurb Flathead|
+ King of Quendor|
+ Protector of the Empire|
+ Ruler of all the Known Lands\"") (ACTION PROCLAMATION-F)>
+<DEFINE-ROUTINE PROCLAMATION-F>
+<ROOM ENTRANCE-HALL (LOC ROOMS) (REGION "Flatheadia") (DESC "Entrance Hall") (
+NORTH TO INNER-BAILEY IF PORTCULLIS IS OPEN ELSE
+"The closed portcullis covers the doorway.") (SOUTH TO GREAT-HALL) (EAST TO
+BANQUET-HALL) (WEST TO PARLOR) (FLAGS RLANDBIT ONBIT) (GLOBAL PORTCULLIS) (
+RIDDLE "Some say I fly, but I'm not a bird; I'm often wasted, or so I've heard.
+Though I go on endlessly, there's never enough of me! What am I?\"") (MAP-LOC <
+PTABLE MAIN-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-5>) (ACTION ENTRANCE-HALL-F)>
+<DEFINE-ROUTINE ENTRANCE-HALL-F>
+<OBJECT TIME-OBJECT (LOC GLOBAL-OBJECTS) (DESC "time") (SYNONYM TIME) (FLAGS
+NARTICLEBIT)>
+<OBJECT DOORBELL (LOC ENTRANCE-HALL) (DESC "doorbell") (SYNONYM DOORBELL BELL)
+(ADJECTIVE DOOR) (FLAGS NDESCBIT) (GENERIC G-HAT-F) (ACTION DOORBELL-F)>
+<DEFINE-ROUTINE DOORBELL-F>
+<OBJECT PORTCULLIS (LOC LOCAL-GLOBALS) (DESC "portcullis") (SYNONYM PORTCULLIS)
+(ADJECTIVE STURDY HEAVY IRON) (FLAGS DOORBIT) (ACTION PORTCULLIS-F)>
+<DEFINE-ROUTINE PORTCULLIS-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT VILLAGE>
+<OBJECT MOAT (LOC LOCAL-GLOBALS) (DESC "moat") (SYNONYM MOAT) (FLAGS WATERBIT)
+(ACTION MOAT-F)>
+<DEFINE-ROUTINE MOAT-F>
+<ROOM INNER-BAILEY (LOC ROOMS) (REGION "Flatheadia") (DESC "Inner Bailey") (
+LDESC "You are on a narrow grassy strip between the castle (which can be entered
+to the south) and the moat. A young elm grows by the side of the moat. A
+causeway leads out into the moat to the northwest.") (SOUTH TO ENTRANCE-HALL IF
+PORTCULLIS IS OPEN) (NW TO CAUSEWAY) (FLAGS RLANDBIT OUTSIDEBIT ONBIT) (SYNONYM
+BAILEY) (ADJECTIVE INNER) (GLOBAL PORTCULLIS MOAT CAUSEWAY) (MAP-LOC <PTABLE
+VILLAGE-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-6>) (ICON INNER-BAILEY-ICON) (ACTION
+INNER-BAILEY-F)>
+<DEFINE-ROUTINE INNER-BAILEY-F>
+<BEGIN-SEGMENT 0>
+<OBJECT WORM (LOC INNER-BAILEY) (DESC "worm") (FDESC
+"A common earthworm is wriggling through the grass.") (SYNONYM WORM EARTHWORM
+PIECE RUBBER) (ADJECTIVE COMMON) (FLAGS TAKEBIT ANIMATEDBIT) (INANIMATE-DESC
+"piece of rubber") (WAND-TEXT "Instantly, the worm stops wriggling.") (
+ANIMATE-ROUTINE I-W-WORM) (SIZE 1) (ACTION WORM-F)>
+<DEFINE-ROUTINE WORM-F>
+<DEFINE-ROUTINE I-W-WORM>
+<END-SEGMENT>
+<BEGIN-SEGMENT VILLAGE>
+<OBJECT SMALL-ELM (LOC INNER-BAILEY) (DESC "small elm tree") (SYNONYM TREE ELM)
+(ADJECTIVE YOUNG SMALL ELM) (FLAGS NDESCBIT PLANTBIT) (ACTION TREE-F)>
+<DEFINE-ROUTINE TREE-F>
+<ROOM CAUSEWAY (LOC ROOMS) (REGION "Flatheadia") (DESC "Causeway") (LDESC
+"You are on a peninsula of dirt and gravel which extends into the moat from
+the southeast. A tall barbican towers over the end of the causeway, to the
+northwest.") (SE TO INNER-BAILEY) (NW TO BARBICAN) (FLAGS RLANDBIT OUTSIDEBIT
+ONBIT) (SYNONYM CAUSEWAY) (GLOBAL MOAT BARBICAN) (MAP-LOC <PTABLE
+VILLAGE-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-5>) (ICON CAUSEWAY-ICON)>
+<ROOM BARBICAN (LOC ROOMS) (REGION "Flatheadia") (DESC "Barbican") (NW TO
+DRAWBRIDGE IF DRAWBRIDGE IS OPEN) (SE TO CAUSEWAY) (UP TO UPPER-BARBICAN) (
+FLAGS RLANDBIT ONBIT) (SYNONYM BARBICAN TOWER GATE-TOWER) (ADJECTIVE TALL LOWER
+) (GLOBAL MOAT DRAWBRIDGE FIXED-LADDER UPPER-BARBICAN) (MAP-LOC <PTABLE
+VILLAGE-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-4>) (ICON BARBICAN-ICON) (ACTION
+BARBICAN-F)>
+<DEFINE-ROUTINE BARBICAN-F>
+<ROOM UPPER-BARBICAN (LOC ROOMS) (REGION "Flatheadia") (DESC "Upper Barbican")
+(LDESC "This upper level is key to defending the outer perimeter of the castle, with
+its commanding view of the causeway, moat and baileys. The floor is filled
+with \"murder holes\" for dropping heavy cannonballs onto unwanted visitors
+who penetrate as far as the barbican's lower level, just below. A large cast
+iron wheel is mounted in the center of the room. The only exit is a ladder
+leading down.") (DOWN TO BARBICAN) (FLAGS RLANDBIT ONBIT) (SYNONYM BARBICAN
+TOWER) (ADJECTIVE UPPER) (GLOBAL FIXED-LADDER MOAT) (MAP-LOC <PTABLE
+VILLAGE-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-4>) (ICON UPPER-BARBICAN-ICON)>
+<BEGIN-SEGMENT 0>
+<OBJECT CANNONBALL (LOC UPPER-BARBICAN) (DESC "cannonball") (SYNONYM CANNONBALL
+BALL) (ADJECTIVE HEAVY) (FLAGS TAKEBIT) (SIZE 50) (ACTION CANNONBALL-F)>
+<DEFINE-ROUTINE CANNONBALL-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT VILLAGE>
+<OBJECT MURDER-HOLE (LOC UPPER-BARBICAN) (DESC "murder hole") (SYNONYM HOLE) (
+ADJECTIVE MURDER) (FLAGS NDESCBIT) (ACTION MURDER-HOLE-F)>
+<DEFINE-ROUTINE MURDER-HOLE-F>
+<OBJECT WHEEL (LOC UPPER-BARBICAN) (DESC "wheel") (SYNONYM WHEEL) (ADJECTIVE
+LARGE CAST IRON) (FLAGS NDESCBIT) (ACTION WHEEL-F)>
+<DEFINE-ROUTINE WHEEL-F>
+<ROOM DRAWBRIDGE (LOC ROOMS) (REGION "Flatheadia") (DESC "Drawbridge") (SE TO
+BARBICAN) (NW TO OUTER-BAILEY) (FLAGS RLANDBIT ONBIT OUTSIDEBIT) (SYNONYM
+BRIDGE DRAWBRIDGE) (ADJECTIVE DRAW STURDY WOODEN) (GLOBAL DRAWBRIDGE MOAT) (
+MAP-LOC <PTABLE VILLAGE-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-3>) (ICON DRAWBRIDGE-ICON
+) (ACTION DRAWBRIDGE-F)>
+<DEFINE-ROUTINE DRAWBRIDGE-F>
+<END-SEGMENT>
+\
+<BEGIN-SEGMENT CASTLE>
+<ROOM PARLOR (LOC ROOMS) (REGION "Flatheadia") (DESC "Parlor") (LDESC
+"This is where many of Dimwit's guests would come and sit after dinner,
+for wine, conversation, and any other whim that might pop into Dimwit's
+head. There are doorways to the east, west and south.") (EAST TO ENTRANCE-HALL)
+(SOUTH TO FORMAL-GARDEN) (WEST TO TORCH-ROOM) (FLAGS RLANDBIT ONBIT) (SYNONYM
+PARLOR) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-4>) (ICON
+PARLOR-ICON) (ACTION PARLOR-F)>
+<DEFINE-ROUTINE PARLOR-F>
+<OBJECT FISH-TANK (LOC PARLOR) (DESC "fish tank") (SYNONYM TANK AQUARIUM) (
+ADJECTIVE FISH) (CAPACITY 50) (FLAGS CONTBIT SEARCHBIT OPENBIT TRYTAKEBIT
+WATERBIT) (ACTION FISH-TANK-F)>
+<GLOBAL DESCRIBED-TANK-AS-LARGE <>>
+<GLOBAL DESCRIBED-TANK-AS-SMALL <>>
+<DEFINE-ROUTINE FISH-TANK-F>
+<OBJECT SPENSEWEED (OWNER SPENSEWEED) (LOC FISH-TANK) (DESC
+"clump of spenseweed") (SYNONYM CLUMP SPENSEWEED WEED) (ADJECTIVE SPENSE) (
+FLAGS TRYTAKEBIT PLANTBIT) (RESEARCH
+"\"A deep-rooting underwater plant. Once established, it can usually only be
+removed by using certain spells of wilting. The misconception that spenseweed
+is a common roadside weed has been perpetuated by grossly inaccurate entries
+in the last several editions of THE LORE AND LEGENDS OF QUENDOR.\"") (ACTION
+SPENSEWEED-F)>
+<DEFINE-ROUTINE SPENSEWEED-F>
+<BEGIN-SEGMENT 0>
+<OBJECT LOBSTER (LOC FISH-TANK) (DESC "lobster") (SYNONYM LOBSTER NUTCRACKER
+CRACKER) (ADJECTIVE NUT) (FLAGS TRYTAKEBIT TAKEBIT ANIMATEDBIT) (INANIMATE-DESC
+"nutcracker") (WAND-TEXT
+"The lobster stops moving. Frozen as it is, with pincers outstretched, it looks
+like nothing less than a large nutcracker. In fact, it IS a nutcracker!") (
+ANIMATE-ROUTINE I-W-LOBSTER) (ACTION LOBSTER-F)>
+<DEFINE-ROUTINE LOBSTER-F>
+<DEFINE-ROUTINE I-W-LOBSTER>
+<DEFINE-ROUTINE I-LOBSTER-PINCH>
+<OBJECT STARFISH (LOC FISH-TANK) (DESC "starfish") (PLURAL "starfish") (SYNONYM
+STARFISH FISH STAR) (ADJECTIVE STAR) (FLAGS TAKEBIT ANIMATEDBIT) (
+INANIMATE-DESC "star") (WAND-TEXT
+"The starfish, as still as it was before, becomes even more still.") (
+ANIMATE-ROUTINE I-W-STARFISH) (ACTION STARFISH-F)>
+<DEFINE-ROUTINE STARFISH-F>
+<DEFINE-ROUTINE I-W-STARFISH>
+<END-SEGMENT>
+<BEGIN-SEGMENT CASTLE>
+<ROOM TORCH-ROOM (LOC ROOMS) (REGION "Flatheadia") (DESC "Torch Room") (LDESC
+"This is a small room for the storage of torches. The torches kept here
+are generally short-lived, for the purpose of brief forays into the
+darker regions of the castle. To the east is the lone exit.") (EAST TO PARLOR)
+(OUT TO PARLOR) (FLAGS RLANDBIT ONBIT) (MAP-LOC <PTABLE MAIN-MAP-NUM
+MAP-GEN-Y-3 MAP-GEN-X-3>) (ICON TORCH-ROOM-ICON)>
+<BEGIN-SEGMENT 0>
+<OBJECT BICKERING-TORCH (LOC TORCH-ROOM) (DESC "bickering torch") (PLURAL
+"torches") (SYNONYM TORCH TORCHES) (ADJECTIVE BICKERING) (FLAGS TAKEBIT
+TRYTAKEBIT) (ACTION BICKERING-TORCH-F)>
+<DEFINE-ROUTINE BICKERING-TORCH-F>
+<DEFINE-ROUTINE BURNED-OUT>
+<DEFINE-ROUTINE I-BICKERING-TORCH>
+<CONSTANT BITCHES <LTABLE 0 "All the other torches were picking on me."
+"Everyone likes the flickering torch better than me."
+"I saw the guttering torch wasting oil!"
+"How come I didn't get made out of top-quality wood like
+the other torches?"
+"The muttering torch was talking about burning down the castle.">>
+<OBJECT FLICKERING-TORCH (LOC TORCH-ROOM) (SDESC "flickering torch") (PLURAL
+"torches") (SYNONYM TORCH TORCHES) (ADJECTIVE FLICKERING) (FLAGS TAKEBIT
+TRYTAKEBIT FLAMEBIT ONBIT) (ACTION FLICKERING-TORCH-F)>
+<DEFINE-ROUTINE FLICKERING-TORCH-F>
+<GLOBAL FLICKERING-TORCH-COUNT 0>
+<DEFINE-ROUTINE I-FLICKERING-TORCH>
+<DEFINE-ROUTINE IN-THE-SKY>
+<OBJECT MUTTERING-TORCH (LOC TORCH-ROOM) (DESC "muttering torch") (PLURAL
+"torches") (SYNONYM TORCH TORCHES) (ADJECTIVE MUTTERING) (FLAGS TAKEBIT
+TRYTAKEBIT) (ACTION MUTTERING-TORCH-F)>
+<DEFINE-ROUTINE MUTTERING-TORCH-F>
+<DEFINE-ROUTINE I-MUTTERING-TORCH>
+<CONSTANT MUTTERS <LTABLE 0 "human palm odors"
+"the unfairness of existence as a torch" "being held too tightly"
+"the callous discarding of burned-out torches"
+"the uncomfortableness of most sconces">>
+<OBJECT GUTTERING-TORCH (LOC TORCH-ROOM) (SDESC "guttering torch") (PLURAL
+"torches") (SYNONYM TORCH TORCHES) (ADJECTIVE GUTTERING) (FLAGS TAKEBIT
+TRYTAKEBIT ONBIT FLAMEBIT) (ACTION GUTTERING-TORCH-F)>
+<DEFINE-ROUTINE GUTTERING-TORCH-F>
+<GLOBAL GUTTERING-TORCH-COUNT 0>
+<DEFINE-ROUTINE I-GUTTERING-TORCH>
+<END-SEGMENT>
+<BEGIN-SEGMENT CASTLE>
+<ROOM FORMAL-GARDEN (LOC ROOMS) (REGION "Flatheadia") (DESC "Formal Garden") (
+LDESC "Dimwit designed this garden to match a fairy tale he enjoyed as a child,
+and subsequent kings added their own touches, creating a hugely confusing
+maze of flowers and shrubbery and statuary and trees and fountains and pools
+and bridges and gazebos. Now somewhat overgrown, the garden is seemingly
+endless, but you recall that the primary exits lie to the north, east, and
+southwest.") (NORTH TO PARLOR) (EAST TO GREAT-HALL) (SW TO WEST-HALL) (FLAGS
+RLANDBIT ONBIT OUTSIDEBIT) (SYNONYM GARDEN) (ADJECTIVE FORMAL) (MAP-LOC <PTABLE
+MAIN-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-4>) (ICON FORMAL-GARDEN-ICON) (THINGS <>
+FLOWER GARDEN-FLOWER-PS)>
+<DEFINE-ROUTINE GARDEN-FLOWER-PS>
+<OBJECT FLORA (LOC FORMAL-GARDEN) (DESC "flora") (SYNONYM SHRUB SHRUBS
+SHRUBBERY TREE FLORA PLANT PLANTS) (FLAGS PLANTBIT NDESCBIT NARTICLEBIT
+PLURALBIT) (ACTION FLORA-F)>
+<DEFINE-ROUTINE FLORA-F>
+<BEGIN-SEGMENT 0>
+<OBJECT FLAMINGO (LOC FORMAL-GARDEN) (DESC "flamingo") (FDESC
+"You spot a flash of pink amongst the flora. It's a flamingo!") (SYNONYM
+FLAMINGO BIRD ORNAMENT) (ADJECTIVE LAWN) (FLAGS TRYTAKEBIT TAKEBIT ANIMATEDBIT)
+(INANIMATE-DESC "lawn ornament") (WAND-TEXT "The flamingo becomes motionless.")
+(ANIMATE-ROUTINE I-W-FLAMINGO) (SIZE 10) (ACTION FLAMINGO-F)>
+<DEFINE-ROUTINE FLAMINGO-F>
+<DEFINE-ROUTINE I-W-FLAMINGO>
+<END-SEGMENT>
+<BEGIN-SEGMENT CASTLE>
+<ROOM COURTYARD (LOC ROOMS) (REGION "Flatheadia") (DESC "Courtyard") (NORTH TO
+BANQUET-HALL) (WEST TO GREAT-HALL) (SE TO EAST-HALL) (FLAGS RLANDBIT ONBIT
+OUTSIDEBIT) (SYNONYM COURTYARD) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-4
+MAP-GEN-X-6>) (ACTION COURTYARD-F)>
+<DEFINE-ROUTINE COURTYARD-F>
+<ROOM BALCONY (LOC ROOMS) (REGION "Flatheadia") (DESC "Balcony") (LDESC
+"This wide balcony, itself larger than most castles, overlooks the Great
+Hall. Banners and pennants are draped from the railing into the hall below,
+which can be reached via the wide stair. A passage leads off to the south.") (
+DOWN TO GREAT-HALL) (SOUTH TO GALLERY) (FLAGS RLANDBIT ONBIT) (SYNONYM BALCONY)
+(GLOBAL STAIRS BANNER) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-4>)
+(ICON BALCONY-ICON)>
+<OBJECT BANNER (LOC LOCAL-GLOBALS) (DESC "banner") (SYNONYM BANNER BANNERS
+PENNANT PENNANTS) (ADJECTIVE COLORFUL) (ACTION BANNER-F)>
+<DEFINE-ROUTINE BANNER-F>
+<ROOM GALLERY (LOC ROOMS) (REGION "Flatheadia") (DESC "Gallery") (LDESC
+"Twelve large paintings cover the walls of this long, tall room. The main
+exit is north, but there's also a small opening to the south.") (NORTH TO
+BALCONY) (SOUTH TO CLOSET) (FLAGS RLANDBIT ONBIT) (SYNONYM GALLERY) (MAP-LOC <
+PTABLE MAIN-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-4>) (ICON GALLERY-ICON)>
+<OBJECT REBUS (LOC GALLERY) (DESC "rebus") (DESCFCN REBUS-F) (SYNONYM REBUS) (
+ADJECTIVE LARGE FRAMED) (FLAGS READBIT SEARCHBIT CONTBIT SURFACEBIT OPENBIT) (
+OWNER WALL) (RESEARCH
+"\"A rebus is an illustration whose component pictures spell out a word
+or words, usually through the addition and subtraction of sounds or letters.
+The most famous creator of rebuses was Frobesius Fublius.\"") (ACTION REBUS-F)>
+
+<DEFINE-ROUTINE REBUS-F>
+<OBJECT REBUS-CAMEL (LOC REBUS) (DESC "flattened camel") (SYNONYM CAMEL ANIMAL
+REPRESENTATION) (ADJECTIVE FLATTENED LAYERED) (FLAGS NDESCBIT) (OWNER REBUS) (
+GENERIC G-CAMEL-F) (ACTION REBUS-ANIMAL-F)>
+<OBJECT REBUS-MOUSE (LOC REBUS) (DESC "flattened mouse") (SYNONYM MOUSE ANIMAL
+REPRESENTATION) (ADJECTIVE FLATTENED LAYERED) (FLAGS NDESCBIT) (OWNER REBUS) (
+ACTION REBUS-ANIMAL-F)>
+<OBJECT REBUS-SNAKE (LOC REBUS) (DESC "flattened snake") (SYNONYM SNAKE ANIMAL
+REPRESENTATION) (ADJECTIVE FLATTENED LAYERED) (FLAGS NDESCBIT) (OWNER REBUS) (
+ACTION REBUS-ANIMAL-F)>
+<OBJECT REBUS-GOOSE (LOC REBUS) (DESC "flattened goose") (SYNONYM GOOSE ANIMAL
+REPRESENTATION) (ADJECTIVE FLATTENED LAYERED) (FLAGS NDESCBIT) (OWNER REBUS) (
+ACTION REBUS-ANIMAL-F)>
+<OBJECT REBUS-FISH (LOC REBUS) (DESC "flattened fish") (SYNONYM FISH ANIMAL
+REPRESENTATION) (ADJECTIVE FLATTENED LAYERED) (FLAGS NDESCBIT) (OWNER REBUS) (
+ACTION REBUS-ANIMAL-F)>
+<OBJECT REBUS-SLIME-MONSTER (LOC REBUS) (DESC "flattened slime monster") (
+SYNONYM MONSTER ANIMAL REPRESENTATION) (ADJECTIVE SLIME FLATTENED LAYERED) (
+FLAGS NDESCBIT) (OWNER REBUS) (ACTION REBUS-ANIMAL-F)>
+<DEFINE-ROUTINE REBUS-ANIMAL-F>
+<OBJECT PAINTINGS (LOC GALLERY) (DESC "twelve paintings") (SYNONYM PAINTINGS
+PORTRAITS) (ADJECTIVE TWELVE FIRST SECOND THIRD FOURTH FIFTH SIXTH SEVENTH
+EIGHTH NINTH TENTH ELEVENTH TWELVTH) (FLAGS NDESCBIT NARTICLEBIT TRYTAKEBIT) (
+GENERIC G-PAINTING-F) (OWNER WALL) (ACTION PAINTINGS-F)>
+<DEFINE-ROUTINE PAINTINGS-F>
+<OBJECT BABE-PORTRAIT (LOC GALLERY) (DESC "portrait of Babe Flathead") (SYNONYM
+PAINTING PORTRAIT BABE FLATHEAD) (ADJECTIVE BABE) (FLAGS NDESCBIT) (OWNER <
+TABLE (PURE LENGTH) WALL BABE-PORTRAIT>) (ACTION PAINTING-F)>
+<OBJECT FRANK-LLOYD-PORTRAIT (LOC GALLERY) (DESC
+"portrait of Frank Lloyd Flathead") (SYNONYM PAINTING PORTRAIT FRANK LLOYD
+FLATHEAD) (ADJECTIVE FRANK LLOYD) (FLAGS NDESCBIT) (OWNER <TABLE (PURE LENGTH)
+WALL FRANK-LLOYD-PORTRAIT>) (ACTION PAINTING-F)>
+<OBJECT JOHN-PAUL-PORTRAIT (LOC GALLERY) (DESC "portrait of John Paul Flathead"
+) (SYNONYM PAINTING PORTRAIT JOHN PAUL FLATHEAD) (ADJECTIVE JOHN PAUL) (FLAGS
+NDESCBIT) (OWNER <TABLE (PURE LENGTH) WALL JOHN-PAUL-PORTRAIT>) (ACTION
+PAINTING-F)>
+<OBJECT RALPH-WALDO-PORTRAIT (LOC GALLERY) (DESC
+"portrait of Ralph Waldo Flathead") (SYNONYM PAINTING PORTRAIT RALPH WALDO
+FLATHEAD) (ADJECTIVE RALPH WALDO) (FLAGS NDESCBIT) (OWNER <TABLE (PURE LENGTH)
+WALL RALPH-WALDO-PORTRAIT>) (ACTION PAINTING-F)>
+<OBJECT LUCREZIA-PORTRAIT (LOC GALLERY) (DESC "portrait of Lucrezia Flathead")
+(SYNONYM PAINTING PORTRAIT LUCREZIA FLATHEAD) (ADJECTIVE LUCREZIA) (FLAGS
+NDESCBIT) (OWNER <TABLE (PURE LENGTH) WALL LUCREZIA-PORTRAIT>) (ACTION
+PAINTING-F)>
+<OBJECT LEONARDO-PORTRAIT (LOC GALLERY) (DESC "portrait of Leonardo Flathead")
+(SYNONYM PAINTING PORTRAIT SELF-PORTRAIT LEONARDO FLATHEAD) (ADJECTIVE LEONARDO
+) (FLAGS NDESCBIT) (OWNER <TABLE (PURE LENGTH) WALL LEONARDO-PORTRAIT>) (ACTION
+PAINTING-F)>
+<OBJECT THOMAS-ALVA-PORTRAIT (LOC GALLERY) (DESC
+"portrait of Thomas Alva Flathead") (SYNONYM PAINTING PORTRAIT THOMAS ALVA
+FLATHEAD) (ADJECTIVE THOMAS ALVA) (FLAGS NDESCBIT) (OWNER <TABLE (PURE LENGTH)
+WALL THOMAS-ALVA-PORTRAIT>) (ACTION PAINTING-F)>
+<OBJECT JOHN-D-PORTRAIT (LOC GALLERY) (DESC "portrait of John D. Flathead") (
+SYNONYM PAINTING PORTRAIT JOHN DAVISON FLATHEAD DOWN) (ADJECTIVE JOHN DAVISON
+DOWN) (FLAGS NDESCBIT) (OWNER <TABLE (PURE LENGTH) WALL JOHN-D-PORTRAIT>) (
+ACTION PAINTING-F)>
+<OBJECT JOHANN-SEBASTIAN-PORTRAIT (LOC GALLERY) (DESC
+"portrait of Johann Sebastian Flathead") (SYNONYM PAINTING PORTRAIT JOHANN
+SEBASTIAN FLATHEAD) (ADJECTIVE JOHANN SEBASTIAN) (FLAGS NDESCBIT) (OWNER <TABLE
+(PURE LENGTH) WALL JOHANN-SEBASTIAN-PORTRAIT>) (ACTION PAINTING-F)>
+<OBJECT STONEWALL-PORTRAIT (LOC GALLERY) (DESC "portrait of Stonewall Flathead"
+) (SYNONYM PAINTING PORTRAIT STONEWALL FLATHEAD) (ADJECTIVE STONEWALL) (FLAGS
+NDESCBIT) (OWNER <TABLE (PURE LENGTH) WALL STONEWALL-PORTRAIT>) (ACTION
+PAINTING-F)>
+<OBJECT J-PIERPONT-PORTRAIT (LOC GALLERY) (OWNER <TABLE (PURE LENGTH) WALL
+J-PIERPONT-PORTRAIT>) (DESC "portrait of J. Pierpont Flathead") (SYNONYM
+PAINTING PORTRAIT J PIERPONT FLATHEAD) (ADJECTIVE J PIERPONT) (FLAGS NDESCBIT)
+(ACTION PAINTING-F)>
+<OBJECT DIMWIT-PORTRAIT (LOC GALLERY) (DESC "portrait of Dimwit Flathead") (
+SYNONYM PAINTING PORTRAIT DIMWIT FLATHEAD) (ADJECTIVE DIMWIT LORD) (FLAGS
+NDESCBIT) (GENERIC G-DIMWIT-F) (OWNER <TABLE (PURE LENGTH) WALL DIMWIT-PORTRAIT
+>) (ACTION PAINTING-F)>
+<DEFINE-ROUTINE PAINTING-F>
+<ROOM CLOSET (LOC ROOMS) (REGION "Flatheadia") (DESC "Closet") (LDESC
+"You are in some sort of storage closet, which opens to the north. A ladder
+leads upward.") (NORTH TO GALLERY) (UP TO ROOF) (FLAGS RLANDBIT ONBIT) (SYNONYM
+CLOSET) (GLOBAL FIXED-LADDER) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-7
+MAP-GEN-X-4>) (THINGS <> SHADOW PHIL-SHADOW-PS)>
+<OBJECT CLOSET-REBUS-BUTTON (LOC CLOSET) (SDESC "blinking key-shaped button") (
+FDESC "In the shadow of one of the shelves is a key-shaped button, which is blinking
+rhythmically.") (SYNONYM BUTTON) (ADJECTIVE KEY-SHAPED BLINKING) (ACTION
+REBUS-BUTTON-F)>
+<BEGIN-SEGMENT ORACLE>
+<BEGIN-SEGMENT LAKE>
+<BEGIN-SEGMENT VILLAGE>
+<DEFINE-ROUTINE REBUS-BUTTON-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT 0>
+<OBJECT BAG (LOC CLOSET) (DESC "bag") (FDESC
+"The shelves are all dusty and bare -- except for one small bag with some
+printing on it.") (SYNONYM BAG PRINTING) (ADJECTIVE SMALL) (FLAGS TAKEBIT
+CONTBIT SEARCHBIT READBIT) (SIZE 2) (TEXT
+"\"Hello, Flamingo Owner! The enclosed food provides a balanced, nutritious
+diet for your flamingo. Our food is specially formulated for the finicky
+flamingo. WARNING: Poisonous to humans. Another fine product of the Frobozz
+Magic Flamingo Food Company.\"") (ACTION BAG-F)>
+<DEFINE-ROUTINE BAG-F>
+<OBJECT BAR-OF-FOOD (LOC BAG) (OWNER BAR-OF-FOOD) (DESC "bar of food") (PLURAL
+"bars of food") (SYNONYM BAR FOOD) (FLAGS TAKEBIT) (SIZE 3) (ACTION
+BAR-OF-FOOD-F)>
+<DEFINE-ROUTINE BAR-OF-FOOD-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT CASTLE>
+<ROOM ROOF (LOC ROOMS) (REGION "Flatheadia") (DESC "Roof") (LDESC
+"You stand atop the main building of the castle. A tall tower is visible to
+the south, but can't be reached from here. The only exit is down a ladder.") (
+DOWN TO CLOSET) (FLAGS RLANDBIT ONBIT OUTSIDEBIT) (GLOBAL FIXED-LADDER) (
+MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-3>) (ICON ROOF-ICON) (THINGS
+TALL TOWER TOWER-PS)>
+<DEFINE-ROUTINE TOWER-PS>
+<ROOM AUDIENCE-CHAMBER (LOC ROOMS) (REGION "Flatheadia") (DESC
+"Audience Chamber") (LDESC
+"This is a tremendous meeting room where thousands of visitors would queue up
+every day for an audience with Dimwit or one of his successors. Such visitors
+were usually wasting their time; Dimwit rarely had the patience to see even
+one person a day. A plush red carpet leads from the main doorway on the north
+wall to the golden throne, fringed with red tassels, which towers above the
+floor. Behind the throne, a smaller doorway leads south.") (NORTH TO GREAT-HALL
+) (SOUTH TO THRONE-ROOM) (FLAGS RLANDBIT ONBIT) (SYNONYM CHAMBER) (ADJECTIVE
+AUDIENCE) (GLOBAL CARPET) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-5
+>)>
+<OBJECT LARGE-THRONE (LOC AUDIENCE-CHAMBER) (DESC "large golden throne") (
+SYNONYM THRONE TASSLES) (ADJECTIVE GOLDEN LARGE TOWERING RED) (CAPACITY 50) (
+FLAGS NDESCBIT VEHBIT SURFACEBIT CONTBIT OPENBIT SEARCHBIT) (ACTION THRONE-F)>
+<ROOM THRONE-ROOM (LOC ROOMS) (REGION "Flatheadia") (DESC "Throne Room") (NORTH
+TO AUDIENCE-CHAMBER) (SOUTH TO SECRET-PASSAGE IF SECRET-PASSAGE-OPEN) (FLAGS
+RLANDBIT ONBIT) (SYNONYM ROOM) (ADJECTIVE THRONE) (MAP-LOC <PTABLE MAIN-MAP-NUM
+MAP-GEN-Y-6 MAP-GEN-X-5>) (ICON THRONE-ROOM-ICON) (ACTION THRONE-ROOM-F)>
+<DEFINE-ROUTINE THRONE-ROOM-F>
+<OBJECT SCEPTRE (LOC THRONE-ROOM) (DESC "sceptre") (FDESC
+"An overdone sceptre, ornamented with colored enamel and tapering to a sharp
+point, is lying by the throne.") (SYNONYM SCEPTRE SCEPTER) (ADJECTIVE SHARP
+ENAMELED ORNAMENTED OVERDONE) (FLAGS TAKEBIT MAGICBIT) (SIZE 5) (VALUE 12)>
+<OBJECT SMALL-THRONE (LOC THRONE-ROOM) (DESC "small throne") (SYNONYM THRONE) (
+ADJECTIVE GAUDY SMALL COMFORTABLE) (CAPACITY 25) (FLAGS NDESCBIT VEHBIT
+SURFACEBIT CONTBIT OPENBIT SEARCHBIT) (ACTION THRONE-F)>
+<DEFINE-ROUTINE THRONE-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT SECRET>
+<GLOBAL SECRET-PASSAGE-DISCOVERED <>>
+<GLOBAL SECRET-PASSAGE-OPEN <>>
+<GLOBAL SECRET-PASSAGE-SCORE 18>
+<ROOM SECRET-PASSAGE (LOC ROOMS) (REGION "Flatheadia") (DESC "Secret Passage")
+(LDESC "You are in a secret passage running north and south.") (NORTH TO
+THRONE-ROOM IF SECRET-PASSAGE-OPEN ELSE "The passage ends at a blank wall!") (
+SOUTH TO TEE) (FLAGS RLANDBIT) (ICON SECRET-PASSAGE-ICON) (MAP-LOC <PTABLE
+SECRET-WING-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-7>) (THINGS <> SHADOW PHIL-SHADOW-PS)
+(ACTION SECRET-PASSAGE-F)>
+<DEFINE-ROUTINE SECRET-PASSAGE-F>
+<BEGIN-SEGMENT 0>
+<OBJECT CANDLE (LOC SECRET-PASSAGE) (DESC "candle") (FDESC
+"Although no one has entered this secret passage in years, a lit candle is
+mounted here, its flame casting dancing shadows across the uneven walls.") (
+SYNONYM CANDLE) (FLAGS LIGHTBIT FLAMEBIT ONBIT TAKEBIT) (ACTION CANDLE-F)>
+<DEFINE-ROUTINE CANDLE-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT SECRET>
+<ROOM TEE (LOC ROOMS) (REGION "Flatheadia") (DESC "Tee") (LDESC
+"A secret passage from the north ends here at this east-west corridor.") (NORTH
+TO SECRET-PASSAGE) (EAST TO TOP-OF-STAIR) (WEST TO FOREBLDG) (FLAGS RLANDBIT) (
+ICON TEE-ICON) (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-7>)>
+<ROOM FOREBLDG (LOC ROOMS) (REGION "Flatheadia") (DESC "Forebuilding") (LDESC
+"The secret passage from the east ends here. An easily defensible hallway
+rises into the keep, to the southwest.") (EAST TO TEE) (SW TO DONJON) (UP TO
+DONJON) (FLAGS RLANDBIT) (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-5
+MAP-GEN-X-6>)>
+<ROOM DONJON (LOC ROOMS) (REGION "Flatheadia") (DESC "Donjon") (LDESC
+"You are in the lowest level of the castle's keep. A stone stair winds
+up into the keep, and a sloping passage leads northeast.") (NE TO FOREBLDG) (
+DOWN TO FOREBLDG) (UP TO SOLAR) (FLAGS RLANDBIT) (GLOBAL STAIRS) (MAP-LOC <
+PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-5>)>
+<ROOM SOLAR (LOC ROOMS) (REGION "Flatheadia") (DESC "Solar") (LDESC
+"This is the king's solar, where he would bathe and dress and meet his
+most trusted advisors and intimate guests. Dim light enters through narrow,
+slitted windows. The solar has obviously lain unused for many decades. The
+circular stair continues up and down, and a doorway leads west.") (UP TO
+BASTION) (DOWN TO DONJON) (WEST TO DIMWITS-ROOM) (FLAGS RLANDBIT ONBIT) (
+SYNONYM SOLAR) (GLOBAL STAIRS WINDOW) (RIDDLE
+"You can find me at the beginning of youth, in the center of every eye,
+and at the end of eternity. What am I?\"") (MAP-LOC <PTABLE SECRET-WING-MAP-NUM
+MAP-GEN-Y-5 MAP-GEN-X-5>) (ACTION SOLAR-F)>
+<DEFINE-ROUTINE SOLAR-F>
+<OBJECT LETTER-Y (LOC GLOBAL-OBJECTS) (DESC "the letter y") (SYNONYM Y) (
+ADJECTIVE LETTER) (FLAGS NARTICLEBIT)>
+<BEGIN-SEGMENT 0>
+<OBJECT EAST-KEY (LOC SOLAR) (DESC "iron key") (FDESC
+"Sitting on a cushioned window seat, illuminated by a shaft of sunlight, rests
+an ancient iron key.") (SYNONYM KEY) (ADJECTIVE ANCIENT IRON) (FLAGS KEYBIT
+TAKEBIT TRYTAKEBIT VOWELBIT) (SIZE 2) (ACTION EAST-KEY-F)>
+<DEFINE-ROUTINE EAST-KEY-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT SECRET>
+<ROOM DIMWITS-ROOM (LOC ROOMS) (REGION "Flatheadia") (DESC "Dimwit's Room") (
+LDESC "You stare around in awe as you realize that you are within the private
+bedroom of Lord Dimwit Flathead. The canopied bed alone is larger than most
+of the farms in your home province. Light seeps in through slitted windows,
+and doorways lead east and south.") (EAST TO SOLAR) (SOUTH TO CLOTHES-CLOSET) (
+FLAGS RLANDBIT) (SYNONYM ROOM) (OWNER DIMWIT) (GLOBAL WINDOW) (ICON
+DIMWITS-ROOM-ICON) (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-4
+>)>
+<OBJECT DIMWITS-BED (LOC DIMWITS-ROOM) (DESC "Dimwit's bed") (SYNONYM BED) (
+ADJECTIVE LARGE CANOPIED) (OWNER DIMWIT) (CAPACITY 250) (FLAGS NARTICLEBIT
+SEARCHBIT VEHBIT DROPBIT NDESCBIT CONTBIT OPENBIT SURFACEBIT)>
+<ROOM CLOTHES-CLOSET (LOC ROOMS) (REGION "Flatheadia") (DESC
+"Magic Clothes Closet") (LDESC
+"This is a small closet. Well, it's small by the standards of this castle;
+in a pinch, it could probably sleep a few regiments. The only exit is north.")
+(NORTH TO DIMWITS-ROOM) (FLAGS RLANDBIT) (SYNONYM CLOSET) (ADJECTIVE MAGIC
+CLOTHES) (ICON MAGIC-CLOSET-ICON) (MAP-LOC <PTABLE SECRET-WING-MAP-NUM
+MAP-GEN-Y-6 MAP-GEN-X-4>)>
+<BEGIN-SEGMENT 0>
+<OBJECT CLOAK (LOC CLOTHES-CLOSET) (DESC "cloak") (SYNONYM CLOAK LABEL WRITING)
+(ADJECTIVE MAGIC) (FLAGS WEARBIT TAKEBIT) (OWNER CLOAK) (ACTION CLOAK-F)>
+<GLOBAL CLOAK-LOC <>>
+<DEFINE-ROUTINE CLOAK-F>
+<OBJECT GLOVE (LOC CLOTHES-CLOSET) (DESC "glove") (SYNONYM GLOVE WRITING
+EMBROIDER) (ADJECTIVE TINY EMBROIDER) (SIZE 3) (FLAGS TAKEBIT WEARBIT READBIT)
+(OWNER GLOVE) (ACTION GLOVE-F)>
+<DEFINE-ROUTINE GLOVE-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT SECRET>
+<ROOM BASTION (LOC ROOMS) (REGION "Flatheadia") (DESC "Bastion") (LDESC
+"This room occupies a taller tower rising from the corner of the keep.
+The slitted windows are wider here, presumably to accomodate the weaponry
+of the period. The stair winds up and down from here.") (UP TO PARAPET) (DOWN
+TO SOLAR) (FLAGS RLANDBIT ONBIT) (SYNONYM BASTION) (GLOBAL STAIRS WINDOW) (ICON
+BASTION-ICON) (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-5>)>
+<ROOM PARAPET (LOC ROOMS) (REGION "Flatheadia") (DESC "Parapet") (LDESC
+"You are on the roof of the tower, a virtual museum of state-of-the-art
+castle defense from the eighth century. A fortified parapet, resting on
+stone corbels, rims the roof. Machicolations, holes between the corbels,
+allow massive weights to be dropped on invaders below. (More often, they
+were dropped rather painfully on the soldier's own toe.) Crenellations
+are spaced around the parapet, providing openings for armaments and
+offering a commanding view of the castle grounds: the main castle just
+below, and beyond the moat, the castle's village and garrison. The sole
+exit is the stairway down.") (DOWN TO BASTION) (FLAGS RLANDBIT OUTSIDEBIT ONBIT
+) (SYNONYM PARAPET TOWER) (GLOBAL STAIRS MOAT VILLAGE) (ICON PARAPET-ICON) (
+MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-5>) (ACTION
+FLY-ROOM-F)>
+<OBJECT MACHICOLATION (LOC PARAPET) (DESC "machicolation") (SYNONYM
+MACHICOLATION HOLE) (FLAGS NDESCBIT) (ACTION MACHICOLATION-F)>
+<DEFINE-ROUTINE MACHICOLATION-F>
+<ROOM TOP-OF-STAIR (LOC ROOMS) (REGION "Flatheadia") (DESC "Top of Stair") (
+LDESC "A secret passage from the west ends here, at the top of these dark,
+cobwebby stairs.") (WEST TO TEE) (DOWN TO BOTTOM-OF-STAIR) (FLAGS RLANDBIT) (
+GLOBAL STAIRS) (ICON TOP-OF-STAIR-ICON) (MAP-LOC <PTABLE SECRET-WING-MAP-NUM
+MAP-GEN-Y-5 MAP-GEN-X-8>)>
+<ROOM BOTTOM-OF-STAIR (LOC ROOMS) (REGION "Flatheadia") (DESC "Bottom of Stair"
+) (LDESC "You are in the center of a gloomy, north-south passage. A crude
+stairway leads upward.") (NORTH TO OUTSIDE-CRYPT) (SOUTH TO DUNGEON) (UP TO
+TOP-OF-STAIR) (FLAGS RLANDBIT) (GLOBAL STAIRS) (ICON BOTTOM-OF-STAIR-ICON) (
+MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-9>)>
+<ROOM OUTSIDE-CRYPT (LOC ROOMS) (REGION "Flatheadia") (DESC "Outside Crypt") (
+LDESC "A hall from the south ends here at the entrance to a spooky crypt.") (
+SOUTH TO BOTTOM-OF-STAIR) (NORTH TO CRYPT) (IN TO CRYPT) (FLAGS RLANDBIT) (
+GLOBAL CRYPT) (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-9>)>
+<ROOM CRYPT (LOC ROOMS) (REGION "Flatheadia") (DESC "Crypt") (UP TO CHAPEL IF
+TRAP-DOOR IS OPEN) (DOWN PER ORACLE-ENTER-F) (SOUTH TO OUTSIDE-CRYPT) (OUT TO
+OUTSIDE-CRYPT) (FLAGS RLANDBIT) (SYNONYM CRYPT TOMB) (ADJECTIVE SPOOKY
+UNDERGROUND) (GLOBAL TRAP-DOOR SLIME BODIES) (MAP-LOC <PTABLE
+SECRET-WING-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-9>) (ACTION CRYPT-F)>
+<DEFINE-ROUTINE CRYPT-F>
+<OBJECT BODIES (LOC LOCAL-GLOBALS) (DESC "bodies") (SYNONYM BODIES REMAINS) (
+FLAGS PLURALBIT NDESCBIT NARTICLEBIT) (ACTION BODIES-F)>
+<DEFINE-ROUTINE BODIES-F>
+<DEFINE-ROUTINE ORACLE-ENTER-F>
+<OBJECT FLATTEST-SLAB (LOC CRYPT) (DESC "flattest slab") (SYNONYM SLAB) (
+ADJECTIVE FLATTEST) (FLAGS NDESCBIT) (ACTION SLAB-F)>
+<OBJECT SHORTEST-SLAB (LOC CRYPT) (DESC "shortest slab") (SYNONYM SLAB) (
+ADJECTIVE SHORTEST) (FLAGS NDESCBIT) (ACTION SLAB-F)>
+<OBJECT LONGEST-SLAB (LOC CRYPT) (DESC "longest slab") (SYNONYM SLAB) (
+ADJECTIVE LONGEST) (FLAGS NDESCBIT) (ACTION SLAB-F)>
+<OBJECT DUSTIEST-SLAB (LOC CRYPT) (DESC "dustiest slab") (SYNONYM SLAB) (
+ADJECTIVE DUSTIEST) (FLAGS NDESCBIT) (ACTION SLAB-F)>
+<OBJECT DARKEST-SLAB (LOC CRYPT) (DESC "darkest slab") (SYNONYM SLAB) (
+ADJECTIVE DARKEST) (FLAGS NDESCBIT) (ACTION SLAB-F)>
+<OBJECT OLDEST-SLAB (LOC CRYPT) (DESC "oldest slab") (SYNONYM SLAB) (ADJECTIVE
+OLDEST) (FLAGS NDESCBIT) (ACTION SLAB-F)>
+<OBJECT NEWEST-SLAB (LOC CRYPT) (DESC "newest slab") (SYNONYM SLAB) (ADJECTIVE
+NEWEST) (FLAGS NDESCBIT) (ACTION SLAB-F)>
+<DEFINE-ROUTINE SLAB-F>
+<GLOBAL HOLEY-SLAB <>>
+<CONSTANT SLAB-TABLE <PTABLE FLATTEST-SLAB SHORTEST-SLAB LONGEST-SLAB
+DUSTIEST-SLAB DARKEST-SLAB OLDEST-SLAB NEWEST-SLAB>>
+<OBJECT TRAP-DOOR (LOC LOCAL-GLOBALS) (DESC "trap door") (SYNONYM DOOR TRAPDOOR
+) (ADJECTIVE SMALL TRAP) (FLAGS DOORBIT) (ACTION TRAP-DOOR-F)>
+<DEFINE-ROUTINE TRAP-DOOR-F>
+<ROOM DUNGEON (LOC ROOMS) (REGION "Flatheadia") (DESC "Dungeon") (LDESC
+"A century's worth of prisoners have languished in this dismal prison.
+In addition to a hole in the floor, passages lead north, southeast, and
+southwest.") (NORTH TO BOTTOM-OF-STAIR) (DOWN TO OUBLIETTE) (SE TO CELL) (SW TO
+TORTURE-CHAMBER) (FLAGS RLANDBIT) (SYNONYM DUNGEON) (ICON DUNGEON-ICON) (
+MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-9>)>
+<OBJECT DUNGEON-HOLE (LOC DUNGEON) (DESC "hole") (SYNONYM HOLE) (ADJECTIVE
+SMALL) (FLAGS NDESCBIT) (OWNER GROUND) (ACTION DUNGEON-HOLE-F)>
+<DEFINE-ROUTINE DUNGEON-HOLE-F>
+<ROOM OUBLIETTE (LOC ROOMS) (REGION "Flatheadia") (DESC "Oubliette") (UP SORRY
+"You're trapped.") (OUT SORRY "You're trapped.") (FLAGS RLANDBIT) (SYNONYM
+OUBLIETTE) (RIDDLE
+"I look just like my brother; we have the same father and mother! We're
+identical in every way; we were born on the very same day. I'm younger
+by seconds, but as everyone reckons, I'm not a twin, and never have been.
+What am I?\"") (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-9>) (
+ACTION OUBLIETTE-F)>
+<GLOBAL OUBLIETTE-SCORE 20>
+<DEFINE-ROUTINE OUBLIETTE-F>
+<OBJECT TRIPLET (LOC GLOBAL-OBJECTS) (DESC "triplet") (SYNONYM TRIPLET TRIPLETS
+QUADRUPLET QUINTUPLET)>
+<BEGIN-SEGMENT 0>
+<OBJECT SEAMANS-CAP (LOC OUBLIETTE) (DESC "seaman's cap") (FDESC
+"The last prisoner in the oubliette must have been a sailor; an old seaman's
+cap lies discarded in the corner.") (SYNONYM CAP HAT) (ADJECTIVE OLD SEAMAN\'S
+SEAMAN) (FLAGS TAKEBIT WEARBIT MAGICBIT) (GENERIC G-HAT-F) (VALUE 12)>
+<DEFINE-ROUTINE G-HAT-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT SECRET>
+<ROOM CELL (LOC ROOMS) (REGION "Flatheadia") (DESC "Cell") (NW TO DUNGEON) (OUT
+TO DUNGEON) (FLAGS RLANDBIT) (SYNONYM CELL) (ICON CELL-ICON) (MAP-LOC <PTABLE
+SECRET-WING-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-10>) (ACTION CELL-F)>
+<DEFINE-ROUTINE CELL-F>
+<OBJECT GIANT-SPIDERS (LOC CELL) (DESC "giant spider") (SYNONYM SPIDER SPIDERS)
+(ADJECTIVE LARGE) (FLAGS NDESCBIT) (ACTION GIANT-SPIDERS-F)>
+<DEFINE-ROUTINE GIANT-SPIDERS-F>
+<OBJECT COBWEBS (LOC CELL) (DESC "cobwebs") (SYNONYM COBWEBS WEB COBWEB WEBS) (
+ADJECTIVE THICK) (FLAGS NDESCBIT NARTICLEBIT PLURALBIT) (ACTION COBWEBS-F)>
+<DEFINE-ROUTINE COBWEBS-F>
+<BEGIN-SEGMENT 0>
+<OBJECT FLASK (DESC "stoppered glass flask filled with liquid") (LDESC
+"A stoppered glass flask with a skull-and-crossbones marking is here.
+The flask is filled with some clear liquid.") (SYNONYM FLASK) (ADJECTIVE GLASS)
+(FLAGS TAKEBIT TRANSBIT READBIT MAGICBIT SEARCHBIT) (CAPACITY 5) (SIZE 5) (
+VALUE 0) (TEXT "There is a skull-and-crossbones engraved on the glass.") (
+ACTION FLASK-F)>
+<DEFINE-ROUTINE FLASK-F>
+<OBJECT LIQUID (LOC FLASK) (DESC "clear liquid") (SYNONYM LIQUID) (ADJECTIVE
+CLEAR) (FLAGS NDESCBIT) (ACTION LIQUID-F)>
+<DEFINE-ROUTINE LIQUID-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT SECRET>
+<ROOM TORTURE-CHAMBER (LOC ROOMS) (REGION "Flatheadia") (DESC "Torture Chamber"
+) (LDESC "This room contains all your standard torture devices: an iron maiden,
+a water chamber, a snake pit, a comfy chair, and so forth. The only
+obvious exit is northeast.") (NE TO DUNGEON) (OUT TO DUNGEON) (FLAGS RLANDBIT)
+(SYNONYM CHAMBER) (ADJECTIVE TORTURE) (MAP-LOC <PTABLE SECRET-WING-MAP-NUM
+MAP-GEN-Y-7 MAP-GEN-X-8>) (ACTION TORTURE-CHAMBER-F)>
+<DEFINE-ROUTINE TORTURE-CHAMBER-F>
+<DEFINE-ROUTINE METRONOME-TORTURE>
+<BEGIN-SEGMENT 0>
+<GLOBAL METRONOME-LOC <>>
+<GLOBAL METRONOME-COUNTER 0>
+<GLOBAL METRONOME-ON <>>
+<OBJECT METRONOME (DESC "metronome") (SYNONYM METRONOME) (FLAGS TAKEBIT
+TRYTAKEBIT MAGICBIT) (VALUE 0) (ACTION METRONOME-F)>
+<DEFINE-ROUTINE METRONOME-F>
+<DEFINE-ROUTINE I-METRONOME>
+<END-SEGMENT>
+<BEGIN-SEGMENT SECRET>
+<OBJECT COMFY-CHAIR (LOC TORTURE-CHAMBER) (DESC "comfy chair") (SYNONYM CHAIR)
+(ADJECTIVE COMFY) (FLAGS NDESCBIT CONTBIT INBIT SEARCHBIT VEHBIT SURFACEBIT
+OPENBIT) (ACTION TORTURE-DEVICE-F)>
+<OBJECT IRON-MAIDEN (LOC TORTURE-CHAMBER) (DESC "iron maiden") (SYNONYM MAIDEN)
+(ADJECTIVE IRON) (FLAGS NDESCBIT VOWELBIT INBIT CONTBIT SEARCHBIT VEHBIT) (
+ACTION TORTURE-DEVICE-F)>
+<OBJECT WATER-CHAMBER (LOC TORTURE-CHAMBER) (DESC "water chamber") (SYNONYM
+CHAMBER) (ADJECTIVE WATER) (FLAGS NDESCBIT CONTBIT INBIT SEARCHBIT VEHBIT) (
+ACTION TORTURE-DEVICE-F)>
+<OBJECT SNAKE-PIT (LOC TORTURE-CHAMBER) (DESC "snake pit") (SYNONYM PIT LID) (
+ADJECTIVE SNAKE) (FLAGS NDESCBIT CONTBIT INBIT SEARCHBIT VEHBIT) (ACTION
+TORTURE-DEVICE-F)>
+<OBJECT THOUSANDS-OF-SNAKES (LOC SNAKE-PIT) (DESC "writhing mass of snakes") (
+SYNONYM SNAKE MASS) (ADJECTIVE WRITHING)>
+<DEFINE-ROUTINE TORTURE-DEVICE-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT CASTLE>
+<ROOM WEST-HALL (LOC ROOMS) (REGION "Flatheadia") (DESC "West Hall") (WEST TO
+WEST-WING IF WEST-DOOR IS OPEN) (NE TO FORMAL-GARDEN) (FLAGS RLANDBIT ONBIT) (
+GLOBAL WEST-DOOR LOCK-OBJECT) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5
+MAP-GEN-X-3>) (ACTION WEST-HALL-F)>
+<DEFINE-ROUTINE WEST-HALL-F>
+<OBJECT WEST-DOOR (LOC LOCAL-GLOBALS) (DESC "door") (SYNONYM DOOR) (ADJECTIVE
+LARGE OAK) (FLAGS DOORBIT LOCKEDBIT) (ACTION WEST-DOOR-F)>
+<DEFINE-ROUTINE WEST-DOOR-F>
+<ROOM WEST-WING (LOC ROOMS) (REGION "Flatheadia") (DESC "West Wing") (EAST TO
+WEST-HALL IF WEST-DOOR IS OPEN) (WEST PER DIRIGIBLE-HANGAR-ENTER-F) (NORTH TO
+PEG-ROOM) (SOUTH TO GYM) (FLAGS RLANDBIT ONBIT) (GLOBAL WEST-DOOR LOCK-OBJECT)
+(VALUE 8) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-2>) (ICON
+WEST-WING-ICON) (ACTION WEST-WING-F)>
+<DEFINE-ROUTINE WEST-WING-F>
+<GLOBAL NUT-OPENED <>>
+<GLOBAL NUT-SHOWN <>>
+<GLOBAL NUT-EATEN <>>
+<GLOBAL J-DISPOSED 0>
+<DEFINE-ROUTINE DIRIGIBLE-HANGAR-ENTER-F>
+\
+<ROOM PEG-ROOM (LOC ROOMS) (REGION "Flatheadia") (DESC "Peg Room") (OUT TO
+WEST-WING) (SOUTH TO WEST-WING) (NORTH TO GAMING-ROOM IF PEG-PASSAGE-OPENED) (
+FLAGS RLANDBIT ONBIT) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-2>) (
+ICON PEG-ROOM-ICON) (ACTION PEG-ROOM-F)>
+<DEFINE-ROUTINE PEG-ROOM-F>
+<OBJECT PBOZ-OBJECT (LOC GLOBAL-OBJECTS) (DESC "Peggleboz") (SYNONYM PEGGLEBOZ)
+(ADJECTIVE GUSTAV) (RESEARCH
+"\"Peggleboz, a popular game of jumping pegs, is named after its creator,
+Gustav Peggleboz (399 - 456 GUE).\"") (ACTION PBOZ-OBJECT-F)>
+<DEFINE-ROUTINE PBOZ-OBJECT-F>
+<OBJECT PEGBOARD (LOC PEG-ROOM) (DESC "pegboard") (SYNONYM BOARD PEGBOARD) (
+ADJECTIVE PEG) (FLAGS NDESCBIT TRYTAKEBIT) (ACTION PEGBOARD-F)>
+<DEFINE-ROUTINE PEGBOARD-F>
+<OBJECT PEGBOARD-PEGS (LOC PEG-ROOM) (DESC "peg") (SYNONYM PEG) (FLAGS NDESCBIT
+TRYTAKEBIT) (ACTION PEGBOARD-PEGS-F)>
+<DEFINE-ROUTINE PEGBOARD-PEGS-F>
+<OBJECT SET-OF-INSTRUCTIONS (LOC PEG-ROOM) (OWNER SET-OF-INSTRUCTIONS) (DESC
+"set of instructions") (SYNONYM SET INSTRUCTIONS RULES) (FLAGS NDESCBIT READBIT
+) (TEXT "\"Rules for PEGGLEBOZ:|
+1. Pegs can only move by jumping another peg.|
+2. Pegs can only jump one peg per move.|
+3. Pegs jumped are removed.|
+4. Your goal is to end up with one peg in the starting hole.|
+5. To begin, simply type PLAY PEGGLEBOZ!\"")>
+<CONSTANT PBOZ-PICSET-TBL <TABLE UNHL-PEG HL-PEG BG-A BG-B BG-C BG-D BG-E BG-F
+BG-G BG-H BG-I BG-J BG-K BG-L BG-M BG-N BG-O BG-P BG-Q BG-R BG-S BG-T BG-U
+RESTART-BOX EXIT-BOX SHOW-MOVES-BOX DIM-RESTART-BOX DIM-SHOW-MOVES-BOX 0>>
+<DEFINE-ROUTINE PEG-GAME>
+<DEFINE-ROUTINE PBOZ-CLICK>
+<DEFINE-ROUTINE SETUP-PBOZ>
+<CONSTANT PBOZ-PIC-TABLE <PTABLE ,PBOZ-A-LOC ,PBOZ-B-LOC ,PBOZ-C-LOC ,
+PBOZ-D-LOC ,PBOZ-E-LOC ,PBOZ-F-LOC ,PBOZ-G-LOC ,PBOZ-H-LOC ,PBOZ-I-LOC ,
+PBOZ-J-LOC ,PBOZ-K-LOC ,PBOZ-L-LOC ,PBOZ-M-LOC ,PBOZ-N-LOC ,PBOZ-O-LOC ,
+PBOZ-P-LOC ,PBOZ-Q-LOC ,PBOZ-R-LOC ,PBOZ-S-LOC ,PBOZ-T-LOC ,PBOZ-U-LOC>>
+<CONSTANT BOARD-TABLE <ITABLE 44 0>>
+<DEFINE-ROUTINE DRAW-PEGS>
+<CONSTANT PEG-BG-PIC-TBL <PLTABLE BG-A BG-B BG-C BG-D BG-E BG-F BG-G BG-H BG-I
+BG-J BG-K BG-L BG-M BG-N BG-O BG-P BG-Q BG-R BG-S BG-T BG-U>>
+<DEFINE-ROUTINE RESET-PEGBOARD>
+<CONSTANT PEG-TABLE <TABLE 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1>>
+<DEFINE-ROUTINE LEGAL-MOVE>
+<CONSTANT LEGAL-MOVE-TABLE <PTABLE <PTABLE 0 0> <PTABLE 5 3 0 0 0 0 0 0> <
+PTABLE 4 3 0 0 0 0 0 0> <PTABLE 6 4 8 5 0 0 0 0> <PTABLE 2 3 9 6 11 7 0 0> <
+PTABLE 1 3 10 7 12 8 0 0> <PTABLE 3 4 8 7 14 9 16 10> <PTABLE 15 10 17 11 0 0 0
+0> <PTABLE 3 5 6 7 16 11 18 12> <PTABLE 4 6 11 10 20 14 0 0> <PTABLE 5 7 12 11
+0 0 0 0> <PTABLE 4 7 9 10 0 0 0 0> <PTABLE 5 8 10 11 21 18 0 0> <PTABLE 15 14 0
+0 0 0 0 0> <PTABLE 6 9 16 15 0 0 0 0> <PTABLE 7 10 13 14 17 16 0 0> <PTABLE 6
+10 8 11 14 15 18 17> <PTABLE 7 11 15 16 19 18 0 0> <PTABLE 8 12 16 17 0 0 0 0>
+<PTABLE 17 18 0 0 0 0 0 0> <PTABLE 9 14 0 0 0 0 0 0> <PTABLE 12 18 0 0 0 0 0 0>
+>>
+<DEFINE-ROUTINE PBOZ-WIN-CHECK>
+<DEFINE-ROUTINE PEG-COUNT>
+<CONSTANT PEG-MOVE-TABLE <TABLE 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>>
+<CONSTANT LETTER-OFFSET <- <ASCII !\A> 1>>
+<GLOBAL PEG-MOVE-NUMBER 0>
+<GLOBAL PEG-PASSAGE-OPENED <>>
+<DEFINE-ROUTINE DISPLAY-MOVES>
+<ROOM GAMING-ROOM (LOC ROOMS) (REGION "Flatheadia") (DESC "Gaming Room") (LDESC
+"This is a plushly carpeted room draped in deeply hued velvets and satins.
+The sole exit is south.") (SOUTH TO PEG-ROOM) (OUT TO WEST-WING) (FLAGS ONBIT
+RLANDBIT) (GLOBAL CARPET) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-2
+>) (ACTION GAMING-ROOM-F)>
+<DEFINE-ROUTINE GAMING-ROOM-F>
+<OBJECT CARPET (LOC LOCAL-GLOBALS) (DESC "carpet") (SYNONYM CARPET CARPETING) (
+ADJECTIVE PLUSH RED) (ACTION CARPET-F)>
+<DEFINE-ROUTINE CARPET-F>
+<ROOM GYM (LOC ROOMS) (REGION "Flatheadia") (DESC "Gym") (LDESC
+"Dimwit despised all forms of exercise; this room must have been a later
+addition by one of his successors. Doorways lead north and southwest.") (NORTH
+TO WEST-WING) (SW TO STEAM-BATH) (FLAGS RLANDBIT ONBIT) (SYNONYM GYM) (MAP-LOC
+<PTABLE MAIN-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-2>) (ICON GYM-ICON)>
+<BEGIN-SEGMENT 0>
+<OBJECT DUMBBELL (LOC GYM) (DESC "dumbbell") (LDESC
+"A 100-ugh dumbbell is sitting here, looking heavy.") (SYNONYM DUMBBELL WEIGHTS
+SET) (ADJECTIVE HEAVY 100-UGH) (FLAGS TAKEBIT MAGICBIT) (SIZE 99) (VALUE 12) (
+ACTION DUMBELL-F)>
+<DEFINE-ROUTINE DUMBELL-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT CASTLE>
+<ROOM STEAM-BATH (LOC ROOMS) (REGION "Flatheadia") (DESC "Steam Bath") (LDESC
+"For generations, the Kings of Quendor have come here to sweat off excess
+pounds (which, given their excessive infatuation with chocolate truffles,
+was plenty often). The only exit is northeast.") (NE TO GYM) (OUT TO GYM) (
+FLAGS RLANDBIT ONBIT) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-1>)>
+<ROOM EAST-HALL (LOC ROOMS) (REGION "Flatheadia") (DESC "East Hall") (EAST TO
+EAST-WING IF EAST-DOOR IS OPEN) (NW TO COURTYARD) (FLAGS RLANDBIT ONBIT) (
+GLOBAL EAST-DOOR LOCK-OBJECT) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5
+MAP-GEN-X-7>) (ACTION EAST-HALL-F)>
+<DEFINE-ROUTINE EAST-HALL-F>
+<OBJECT EAST-DOOR (LOC LOCAL-GLOBALS) (DESC "door") (SYNONYM DOOR) (ADJECTIVE
+LARGE HEAVY OAK OAKEN) (FLAGS LOCKEDBIT DOORBIT) (ACTION EAST-DOOR-F)>
+<DEFINE-ROUTINE EAST-DOOR-F>
+<ROOM EAST-WING (LOC ROOMS) (REGION "Flatheadia") (DESC "East Wing") (LDESC
+"This wide corridor runs the length of the east wing of the castle. The
+corridor ends at a large door to the west. There are openings to the north,
+south and east.") (WEST TO EAST-HALL IF EAST-DOOR IS OPEN) (SOUTH TO CHAPEL) (
+NORTH TO LIBRARY) (EAST TO GUEST-ROOMS) (GLOBAL EAST-DOOR LOCK-OBJECT) (FLAGS
+RLANDBIT ONBIT) (VALUE 8) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-8
+>) (ICON EAST-WING-ICON)>
+<ROOM GUEST-ROOMS (LOC ROOMS) (REGION "Flatheadia") (DESC "Guest Rooms") (LDESC
+"This is where visitors to the castle would stay. Many stayed for decades.
+Passages lead east and west.") (EAST TO SERVANTS-QUARTERS) (WEST TO EAST-WING)
+(FLAGS RLANDBIT ONBIT) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-9>)>
+
+<BEGIN-SEGMENT 0>
+<OBJECT WAND (LOC GUEST-ROOMS) (DESC "wand") (FDESC
+"It seems that a wizard must have been a recent guest at the castle, since
+a rather typical wizardly wand is lying here.") (SYNONYM WAND WANDS) (ADJECTIVE
+TYPICAL WIZARDLY INANIMATION MAGIC) (FLAGS TAKEBIT READBIT) (RESEARCH
+"\"Wands are among the most useful forms of magic; the wand is merely
+pointed at the object to be ensorcelled.\"") (SIZE 3) (ACTION WAND-F)>
+<GLOBAL WAND-LIFE 5>
+<DEFINE-ROUTINE WAND-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT CASTLE>
+<ROOM SERVANTS-QUARTERS (LOC ROOMS) (REGION "Flatheadia") (DESC
+"Servants' Quarters") (LDESC
+"These are the spartan rooms where the servants lived (if you can actually call
+this \"living\"). A passage leads west and a narrow stair spirals upward.") (
+WEST TO GUEST-ROOMS) (UP TO JESTERS-QUARTERS) (FLAGS RLANDBIT) (SYNONYM
+QUARTERS) (ADJECTIVE SERVANT\'S) (GLOBAL STAIRS) (MAP-LOC <PTABLE MAIN-MAP-NUM
+MAP-GEN-Y-5 MAP-GEN-X-10>)>
+<ROOM CHAPEL (LOC ROOMS) (REGION "Flatheadia") (DESC "Chapel") (LDESC
+"None of the Flatheads were particularly religious, but that didn't stop
+Dimwit from building the biggest chapel in all of Quendor. The exit is north,
+at the rear of the chapel. Just below the altar is a small trap door.") (NORTH
+TO EAST-WING) (DOWN TO CRYPT IF TRAP-DOOR IS OPEN) (SYNONYM CHAPEL) (GLOBAL
+TRAP-DOOR) (FLAGS RLANDBIT ONBIT) (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-6
+MAP-GEN-X-8>) (ICON CHAPEL-ICON)>
+<OBJECT CHAPEL-ALTAR (LOC CHAPEL) (DESC "altar") (SYNONYM ALTAR) (FLAGS
+NDESCBIT VOWELBIT SURFACEBIT SEARCHBIT CONTBIT OPENBIT)>
+<END-SEGMENT>
+<BEGIN-SEGMENT LOWER>
+<ROOM LOWER-HALL (LOC ROOMS) (REGION "Flatheadia") (DESC "Lower Hall") (LDESC
+"This large hall, barely illuminated by your light, has seen its better
+days; based on the dust and debris, the lower levels of the castle probably
+haven't been maintained since Dimwit's death. Stairs lead up and down; the
+latter stair looks particularly forbidding. Passages head off to the north,
+south, southeast, and southwest.") (NORTH TO LABORATORY) (SOUTH TO KENNELS) (SW
+TO G-U-HIGHWAY) (SE TO ROYAL-ZOO) (DOWN TO LOWEST-HALL) (UP TO GREAT-HALL) (
+FLAGS RLANDBIT) (GLOBAL STAIRS) (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM
+MAP-GEN-Y-5 MAP-GEN-X-6>)>
+<ROOM LABORATORY (LOC ROOMS) (REGION "Flatheadia") (DESC "Laboratory") (LDESC
+"You have entered the lab that was affectionately known as Froblo Park.
+The main exit is south, but there's a narrow doorway on the north wall.") (
+SOUTH TO LOWER-HALL) (NORTH TO TESTING-ROOM) (FLAGS RLANDBIT) (SYNONYM
+LABORATORY) (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-6>) (
+ICON LABORATORY-ICON)>
+<OBJECT SCREWDRIVER (LOC LABORATORY) (DESC "screwdriver") (FDESC
+"Sitting on the lab bench is an old screwdriver.") (SYNONYM SCREWDRIVER DRIVER)
+(ADJECTIVE SCREW OLD) (FLAGS TAKEBIT MAGICBIT) (VALUE 12)>
+<ROOM TESTING-ROOM (LOC ROOMS) (REGION "Flatheadia") (DESC "Testing Room") (
+LDESC "This is where certain dangerous experiments would take place. There
+are two large booths, one on the left side of the room, the other on
+the right side. The only exit is south.") (SOUTH TO LABORATORY) (OUT TO
+LABORATORY) (FLAGS RLANDBIT) (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-3
+MAP-GEN-X-6>)>
+<OBJECT LEFT-BOOTH (LOC TESTING-ROOM) (DESC "left booth") (SYNONYM BOOTH) (
+ADJECTIVE LEFT) (FLAGS NDESCBIT VEHBIT INBIT DROPBIT CONTBIT OPENBIT SEARCHBIT)
+(GENERIC G-BOOTH-F) (CAPACITY 60) (ACTION BOOTH-F)>
+<OBJECT RIGHT-BOOTH (LOC TESTING-ROOM) (DESC "right booth") (SYNONYM BOOTH) (
+ADJECTIVE RIGHT) (FLAGS NDESCBIT VEHBIT INBIT DROPBIT CONTBIT OPENBIT SEARCHBIT
+) (GENERIC G-BOOTH-F) (CAPACITY 60) (ACTION BOOTH-F)>
+<DEFINE-ROUTINE G-BOOTH-F>
+<DEFINE-ROUTINE BOOTH-F>
+<OBJECT LEFT-BOOTH-BUTTON (LOC LEFT-BOOTH) (DESC "ominous black button") (
+SYNONYM BUTTON) (ADJECTIVE OMINOUS BLACK) (FLAGS NDESCBIT) (GENERIC G-BUTTON-F)
+(ACTION BOOTH-BUTTON-F)>
+<OBJECT RIGHT-BOOTH-BUTTON (LOC RIGHT-BOOTH) (DESC "ominous black button") (
+SYNONYM BUTTON) (ADJECTIVE OMINOUS BLACK) (GENERIC G-BUTTON-F) (FLAGS NDESCBIT)
+(ACTION BOOTH-BUTTON-F)>
+<DEFINE-ROUTINE G-BUTTON-F>
+<GLOBAL TURNED-INTO <>>
+<DEFINE-ROUTINE BOOTH-BUTTON-F>
+<DEFINE-ROUTINE I-UNTURN>
+<DEFINE-ROUTINE TO-SPEAK-OF>
+<DEFINE-ROUTINE GOOD-MEAL>
+<ROOM KENNELS (LOC ROOMS) (REGION "Flatheadia") (DESC "Kennels") (LDESC
+"This was once where the royal bloodhounds lived. Considering the size
+of the leash and collar fragments scattered around, the royal bloodhounds
+were BIG. Passages lead east and north.") (NORTH TO LOWER-HALL) (EAST TO
+ROYAL-ZOO) (FLAGS RLANDBIT) (SYNONYM KENNEL KENNELS) (MAP-LOC <PTABLE
+LOWER-LEVEL-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-6>) (ICON KENNELS-ICON)>
+<BEGIN-SEGMENT 0>
+<OBJECT TOBOGGAN (LOC KENNELS) (DESC "toboggan") (SYNONYM TOBOGGAN SLED
+INSCRIPTION) (FLAGS TAKEBIT READBIT VEHBIT CONTBIT OPENBIT SEARCHBIT SURFACEBIT
+) (CAPACITY 30) (SIZE 20) (ACTION TOBOGGAN-F) (TEXT
+"A large inscription says, \"Made by the Frobozz Magic Toboggan Company.\"
+Below that is a faded image of a blooming morgia plant, with the name
+\"Morgiabud.\" It's possible that this sled may have once belonged to
+publishing giant William Randolph Flathead (a.k.a. \"Citizen Flathead\").")>
+<DEFINE-ROUTINE TOBOGGAN-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT LOWER>
+<ROOM ROYAL-ZOO (LOC ROOMS) (REGION "Flatheadia") (DESC "Royal Zoo") (LDESC
+"Dimwit loved zoos, because he loved imprisonment of any kind -- if the
+dungeons were full of prisoners he could at least get some joy from
+throwing a couple of minxes behind bars. This zoo, with 69,105 cages,
+is easily the largest in Quendor. There are passages to the west and
+northwest, and a wide tunnel leads east.") (NW TO LOWER-HALL) (WEST TO KENNELS)
+(EAST TO WEST-SHORE) (FLAGS RLANDBIT) (SYNONYM ZOO) (ADJECTIVE ROYAL) (MAP-LOC
+<PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-7>) (ICON ROYAL-ZOO-ICON)>
+<OBJECT CAGE (LOC ROYAL-ZOO) (DESC "cage") (FDESC
+"The zoo has been extensively looted; only one of the many nearby cages
+still seems to be occupied.") (SYNONYM CAGE) (FLAGS CONTBIT SEARCHBIT TRANSBIT)
+(ACTION CAGE-F)>
+<DEFINE-ROUTINE CAGE-F>
+<BEGIN-SEGMENT 0>
+<OBJECT SNAKE (LOC CAGE) (DESC "snake") (SYNONYM SNAKE ROPE) (FLAGS TAKEBIT
+ANIMATEDBIT) (INANIMATE-DESC "rope") (WAND-TEXT
+"The snake shivers and shimmers and is then still. Too still. You approach,
+tentatively at first, then with more conviction. The snake is gone, replaced
+by (or turned into!) a good, heavy rope.") (ANIMATE-ROUTINE I-W-SNAKE) (ACTION
+SNAKE-F)>
+<DEFINE-ROUTINE SNAKE-F>
+<DEFINE-ROUTINE I-W-SNAKE>
+<END-SEGMENT>
+<BEGIN-SEGMENT LOWER>
+<ROOM LOWEST-HALL (LOC ROOMS) (REGION "Flatheadia") (DESC "Lowest Hall") (LDESC
+"You get the feeling that no ray of light has touched these walls in ages.
+Few have even ventured down here since the Curse was laid upon the castle
+those many years ago. A decrepit stair leads upward, and there's an opening
+to the north. The bottom of a steep, gravelly passage is visible to the
+east. To the south is the most massively reinforced door you've ever seen.
+A rickety ladder can take you down to even lower domains.") (NORTH TO
+PASSAGE-STORAGE-ROOM) (SOUTH TO VAULT IF VAULT-DOOR IS OPEN) (EAST SORRY
+"You can't get a footing on the steep, gravelly passage.") (UP TO LOWER-HALL) (
+FLAGS RLANDBIT) (DOWN TO PITS) (GLOBAL VAULT VAULT-DOOR LOCK-OBJECT
+FIXED-LADDER STAIRS) (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-5
+MAP-GEN-X-4>)>
+<OBJECT VAULT-DOOR (LOC LOCAL-GLOBALS) (DESC "vault door") (SYNONYM DOOR) (
+ADJECTIVE VAULT) (FLAGS DOORBIT LOCKEDBIT) (ACTION VAULT-DOOR-F)>
+<DEFINE-ROUTINE VAULT-DOOR-F>
+<OBJECT DIAL (LOC LOWEST-HALL) (DESC "dial") (SYNONYM DIAL) (ADJECTIVE LARGE) (
+FLAGS NDESCBIT) (OWNER VAULT-DOOR) (ACTION DIAL-F)>
+<GLOBAL DIAL-NUMBER 0>
+<DEFINE-ROUTINE DIAL-F>
+<ROOM VAULT (LOC ROOMS) (REGION "Flatheadia") (DESC "Vault") (LDESC
+"This was just the vault where Dimwit stored his trifles; his valuables
+were stored in a hidden vault buried seven miles under the Flathead
+Mountains, accessible only by a chain of sixty-three secret teleportation
+spells. The only exit is north.") (NORTH TO LOWEST-HALL IF VAULT-DOOR IS OPEN)
+(OUT TO LOWEST-HALL IF VAULT-DOOR IS OPEN) (FLAGS RLANDBIT) (GLOBAL VAULT-DOOR)
+(SYNONYM VAULT) (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-4>)
+(ICON VAULT-ICON) (ACTION VAULT-F)>
+<DEFINE-ROUTINE VAULT-F>
+<OBJECT STOCK-CERTIFICATE (LOC VAULT) (DESC "stock certificate") (SYNONYM
+CERTIFICATE STOCK) (ADJECTIVE STOCK RARE) (FLAGS TAKEBIT BURNBIT READBIT
+MAGICBIT) (VALUE 12) (SIZE 2) (TEXT
+"The certificate reads \"FrobozzCo International -- 923,130,877 shares.\"")>
+<ROOM PASSAGE-STORAGE-ROOM (LOC ROOMS) (REGION "Flatheadia") (DESC
+"Passage Storage Room") (LDESC
+"This is a tremendous warehouse where passageways and tunnels would be stored
+before being installed as part of the Great Underground Empire. The only exit
+is south.") (SOUTH TO LOWEST-HALL) (OUT TO LOWEST-HALL) (FLAGS RLANDBIT) (
+MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-4>) (ICON
+PASSAGE-STORAGE-ICON)>
+<BEGIN-SEGMENT 0>
+<OBJECT NW-SE-PASSAGE (LOC PASSAGE-STORAGE-ROOM) (DESC
+"northwest-southeast passage") (SYNONYM PASSAGE PASSAGEWAY) (ADJECTIVE MAGIC NW
+NW-SE SLIGHTLY IRREGULAR) (FLAGS TAKEBIT TRYTAKEBIT) (DESCFCN NW-SE-PASSAGE-F)
+(OWNER <>) (SIZE 25) (ACTION PASSAGE-F)>
+<DEFINE-ROUTINE NW-SE-PASSAGE-F>
+<OBJECT N-S-PASSAGE (LOC PASSAGE-STORAGE-ROOM) (DESC "north-south passage") (
+SYNONYM PASSAGE PASSAGEWAY) (ADJECTIVE MAGIC NORTH-SOUTH N-S SLIGHTLY DAMAGED)
+(FLAGS TAKEBIT TRYTAKEBIT) (DESCFCN N-S-PASSAGE-F) (OWNER <>) (SIZE 25) (ACTION
+PASSAGE-F)>
+<DEFINE-ROUTINE N-S-PASSAGE-F>
+<DEFINE-ROUTINE PASSAGE-F>
+<DEFINE-ROUTINE D-PASSAGE>
+<GLOBAL N-S-PASSAGE-DIR <>>
+<GLOBAL NW-SE-PASSAGE-DIR <>>
+<GLOBAL N-S-PASSAGE-LOC <>>
+<GLOBAL NW-SE-PASSAGE-LOC <>>
+<OBJECT NOTICE (DESC "notice") (SYNONYM NOTICE) (FLAGS TAKEBIT BURNBIT READBIT)
+(SIZE 2) (TEXT "\"Hello, Builder!|
+ Your Magic Passage should last you for many useful years. To install,
+simply INSTALL THE PASSAGE IN THE _____ WALL. Remember, your Magic Passage,
+once installed, is not removable! Please contact your dealer with any
+questions or problems!|
+ Another fine product of the Frobozz Magic Passage Company.\"")>
+<END-SEGMENT>
+<BEGIN-SEGMENT LOWER>
+<ROOM PITS (LOC ROOMS) (DESC "Pits") (REGION "Flatheadia") (UP TO LOWEST-HALL)
+(DOWN PER PIT-ENTER-F) (FLAGS RLANDBIT UNDERGROUNDBIT) (GLOBAL FIXED-LADDER
+PITS-OBJECT) (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-3>) (
+THINGS <> SHADOW PHIL-SHADOW-PS) (ACTION PITS-F)>
+<DEFINE-ROUTINE PITS-F>
+<DEFINE-ROUTINE D-PITS-FLOOR>
+<DEFINE-ROUTINE PIT-ENTER-F>
+<OBJECT PITS-OBJECT (LOC LOCAL-GLOBALS) (DESC "bottomless pit") (SYNONYM PIT
+PITS) (ADJECTIVE BOTTOMLESS) (ACTION PITS-OBJECT-F)>
+<DEFINE-ROUTINE PITS-OBJECT-F>
+<BEGIN-SEGMENT 0>
+<OBJECT LANTERN (LOC PITS) (DESC "brass lantern") (FDESC
+"At the far end of the cavern sits an ancient battery-powered brass
+lantern.") (SYNONYM LAMP LANTERN LIGHT MONOGRAM) (ADJECTIVE ANCIENT BRASS
+BATTERY-POWERED) (FLAGS TRYTAKEBIT TAKEBIT LIGHTBIT MAGICBIT READBIT) (SIZE 15)
+(VALUE 0) (TEXT "You can barely read the worn letters: \"T. A. F.\"") (ACTION
+LANTERN-F)>
+<DEFINE-ROUTINE LANTERN-F>
+<GLOBAL LANTERN-COUNTER 500>
+<DEFINE-ROUTINE I-LANTERN>
+<END-SEGMENT>
+<BEGIN-SEGMENT LOWER>
+<ROOM LEDGE-IN-PIT (LOC ROOMS) (DESC "Ledge in Bottomless Pit") (REGION
+"Region: Unknown") (LDESC
+"This is a wide, irregular ledge, far below the lip of the pit. The ledge
+is strewn with the bones of creatures (including a few luckless humans)
+who fell into the pit and landed here, to be devoured by grues. Rough
+handholds, possibly natural, lead upward and downward.") (UP TO PITS) (DOWN TO
+MOUTH-OF-CAVE) (FLAGS RLANDBIT UNDERGROUNDBIT) (GLOBAL BONES PITS-OBJECT) (
+MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-2>) (ICON
+LEDGE-IN-PIT-ICON) (THINGS WIDE LEDGE LEDGE-IN-PIT-PS)>
+<DEFINE-ROUTINE LEDGE-IN-PIT-PS>
+<ROOM MOUTH-OF-CAVE (LOC ROOMS) (DESC "Mouth of Cave") (REGION
+"Region: Unknown") (LDESC
+"A narrow, slimy cave connects here with the bottomless pit, leading
+roughly northeast. The handholds in the rock walls of the pit, which have
+been fairly dependable down to here, seem to peter out just below you.") (UP TO
+LEDGE-IN-PIT) (DOWN SORRY "There are no more handholds!") (NE TO SLOPING-CAVE)
+(FLAGS RLANDBIT UNDERGROUNDBIT) (GLOBAL PITS-OBJECT) (MAP-LOC <PTABLE
+LOWER-LEVEL-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-1>) (ICON MOUTH-OF-CAVE-ICON)>
+<ROOM SLOPING-CAVE (LOC ROOMS) (DESC "Sloping Cave") (REGION "Region: Unknown"
+) (LDESC "You are in a cramped cave with disgustingly sticky walls which press
+in against you. The cave drops sharply to the northeast, and rises
+sharply to the southwest.") (NE TO TOP-OF-WELL) (DOWN TO TOP-OF-WELL) (SW TO
+MOUTH-OF-CAVE) (UP TO MOUTH-OF-CAVE) (FLAGS RLANDBIT UNDERGROUNDBIT) (MAP-LOC <
+PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-2>)>
+<ROOM TOP-OF-WELL (LOC ROOMS) (DESC "Top of Well") (REGION "Region: Unknown")
+(LDESC "The cave ends here at the opening of a natural well. The walls of the
+well look irregular enough to climb down. The sensation of being deep
+within the bowels of the earth is overpowering here; you feel as though
+you are farther down than anyone has ever been before.") (SW TO SLOPING-CAVE) (
+UP TO SLOPING-CAVE) (DOWN TO UNDER-THE-WORLD) (FLAGS RLANDBIT UNDERGROUNDBIT) (
+MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-3>)>
+<ROOM UNDER-THE-WORLD (LOC ROOMS) (DESC "Under the World") (REGION
+"Region: Unknown") (LDESC
+"This is surely the most incredible sight that any pair of eyes has ever
+gazed upon: You have reached the underside of the world, which hangs above
+you, an enormous slab of dirt and rock which stretches as far as you can see
+in all directions! A glowing white haze stretches below you.|
+ To the west, you can see the head and shoulders of a muscular brogmoid;
+the rest of his body seems to be lost in the haze. As your mind adjusts to the
+scale of this place, you realize that the brogmoid is tremendous beyond
+description, and that he is holding the world upon his shoulder and upper
+back.|
+ Thanks to some hardy roots which hang below the world, it looks like you
+could swing over to the shoulder of the brogmoid. Above you, a hole leads
+up into the world.") (UP TO TOP-OF-WELL) (DOWN SORRY
+"There's nothing there -- literally.") (WEST TO HANGING-FROM-ROOTS) (FLAGS
+RLANDBIT ONBIT OUTSIDEBIT) (GLOBAL BROGMOID ROOTS) (MAP-LOC <PTABLE
+LOWER-LEVEL-MAP-NUM MAP-GEN-Y-2 MAP-GEN-X-3>) (ACTION UNDER-THE-WORLD-F)>
+<DEFINE-ROUTINE UNDER-THE-WORLD-F>
+<ROOM HANGING-FROM-ROOTS (LOC ROOMS) (DESC "Hanging From Roots") (REGION
+"Region: Unknown") (LDESC
+"You are clutching some hardy tree roots, between a seemingly infinite plane
+of earth above you, and a seemingly infinite haze below. To the east, a tiny
+black spot indicates the opening of a well leading upward. To the west, part
+of the shoulder, neck, and ear of an incredibly gigantic brogmoid fills your
+view.") (UP SORRY "The world is in the way.") (DOWN SORRY
+"There's nothing there -- literally.") (WEST TO SHOULDER) (EAST TO
+UNDER-THE-WORLD) (FLAGS RLANDBIT ONBIT OUTSIDEBIT) (GLOBAL BROGMOID ROOTS) (
+MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-2 MAP-GEN-X-2>) (ICON ROOTS-ICON)
+>
+<OBJECT ROOTS (LOC LOCAL-GLOBALS) (DESC "root") (SYNONYM ROOTS ROOT) (ADJECTIVE
+HARDY TREE) (ACTION ROOTS-F)>
+<DEFINE-ROUTINE ROOTS-F>
+<ROOM SHOULDER (LOC ROOMS) (DESC "Shoulder") (REGION "Region: Unknown") (LDESC
+"You have landed on a shoulder of mind-numbing dimension. The hairs of the
+shoulder are like mighty trees, the pores like deep craters. Thanks to the
+thickness of the hair/trees, you could probably climb up the neck to the
+ear which looms above you. A series of underhanging roots make it possible
+to swing off to the east.") (EAST TO HANGING-FROM-ROOTS) (UP TO EAR) (FLAGS
+RLANDBIT ONBIT OUTSIDEBIT) (GLOBAL BROGMOID ROOTS) (MAP-LOC <PTABLE
+LOWER-LEVEL-MAP-NUM MAP-GEN-Y-2 MAP-GEN-X-1>)>
+<ROOM EAR (LOC ROOMS) (DESC "Ear") (REGION "Region: Unknown") (IN TO INNER-EAR
+IF EAR-PASSAGE-OPEN ELSE "The mound of ear fungus blocks entry into the ear.")
+(DOWN TO SHOULDER) (FLAGS RLANDBIT ONBIT OUTSIDEBIT) (GLOBAL BROGMOID) (MAP-LOC
+<PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-1 MAP-GEN-X-1>) (ICON EAR-ICON) (ACTION
+EAR-F)>
+<DEFINE-ROUTINE EAR-F>
+<GLOBAL EAR-PASSAGE-OPEN <>>
+<OBJECT EAR-FUNGUS (LOC EAR) (DESC "ear fungus") (SYNONYM FUNGUS FUNGI) (
+ADJECTIVE EAR) (FLAGS VOWELBIT NDESCBIT PLANTBIT) (GENERIC G-FUNGUS-F) (
+RESEARCH "\"A class of saprophytic parasitical plants which lack chlorophyll and are
+frequently found in the less hygienic cavities of brogmoids.\"") (ACTION
+EAR-FUNGUS-F)>
+<DEFINE-ROUTINE EAR-FUNGUS-F>
+<DEFINE-ROUTINE G-FUNGUS-F>
+<GLOBAL FUNGUS-NUMBER 12>
+<CONSTANT FUNGUS-TABLE <PTABLE "Seymour" "Sherman" "Irving" "Sammy" "Myron"
+"Boris" "Melvin" "Lester" "Julius" "Ricardo" "Omar" "Barnaby">>
+<CONSTANT FUNGUS-WORDS <PTABLE <VOC "SEYMOUR" <>> <VOC "SHERMAN" <>> <VOC
+"IRVING" <>> <VOC "SAMMY" <>> <VOC "MYRON" <>> <VOC "BORIS" <>> <VOC "MELVIN" <
+>> <VOC "LESTER" <>> <VOC "JULIUS" <>> <VOC "RICARDO" <>> <VOC "OMAR" <>> <VOC
+"BARNABY" <>>>>
+<OBJECT BROGMOID (LOC LOCAL-GLOBALS) (DESC "giant brogmoid") (SYNONYM BROGMOID
+BROGMOIDS SHOULDER EAR TOE) (ADJECTIVE LARGE) (ACTION BROGMOID-F)>
+<DEFINE-ROUTINE BROGMOID-F>
+<ROOM INNER-EAR (LOC ROOMS) (DESC "Inner Ear") (REGION "Region: Unknown") (
+LDESC "You have reached the brogmoid's eardrum, which prevents any farther travel
+inward. A passage through a forest of fungus leads back out.") (IN SORRY
+"The membrane of the eardrum is tougher than most walls.") (OUT TO EAR) (FLAGS
+RLANDBIT OUTSIDEBIT) (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-1
+EAR-ICON-LOC>)>
+<OBJECT EARWAX (LOC INNER-EAR) (OWNER EARWAX) (DESC "hunk of brogmoid ear wax")
+(SYNONYM HUNK WAX EARWAX) (ADJECTIVE BROGMOID EAR) (FLAGS TAKEBIT)>
+<END-SEGMENT> \ No newline at end of file
diff --git a/castle.zap b/castle.zap
new file mode 100644
index 0000000..c0280eb
--- /dev/null
+++ b/castle.zap
@@ -0,0 +1,2732 @@
+
+ .SEGMENT "CASTLE"
+
+
+ .FUNCT LOWER-HALL-ENTER-F,RARG
+ FSET? OUTER-GATE,OPENBIT /?CTR2
+ ZERO? TIME-STOPPED /?CCL3
+?CTR2: ZERO? RARG \FALSE
+ ICALL1 RETURN-FROM-MAP
+ PRINTI "Near the bottom of the flight, the steps are blocked by newly-fallen rubble!"
+ CRLF
+ RFALSE
+?CCL3: RETURN LOWER-HALL
+
+
+ .FUNCT PROCLAMATION-F
+ EQUAL? PRSA,V?TAKE \FALSE
+ FSET? PROCLAMATION,TRYTAKEBIT \FALSE
+ CALL2 ITAKE,TRUE-VALUE
+ EQUAL? STACK,M-FATAL /TRUE
+ PUTP PROCLAMATION,P?ACTION,FALSE-VALUE
+ PUTP PROCLAMATION,P?OWNER,FALSE-VALUE
+ FCLEAR PROCLAMATION,TRYTAKEBIT
+ PRINTR "You rip the decree from the wall."
+
+
+ .FUNCT ENTRANCE-HALL-F,RARG
+ EQUAL? RARG,M-LOOK \?CCL3
+ PRINTI "This is where visitors enter the castle proper, through the wide doorway to the north. "
+ FSET? PORTCULLIS,OPENBIT /?CND4
+ PRINTI "The doorway is currently blocked by a sturdy portcullis. "
+?CND4: PRINTI "Oddly, there is a doorbell on the inside of the doorway. Other doorways lead east, west, and south."
+ RTRUE
+?CCL3: EQUAL? RARG,M-END \FALSE
+ IN? JESTER,HERE \FALSE
+ FSET? PORTCULLIS,OPENBIT /FALSE
+ CALL2 SETUP-ORPHAN,STR?44
+ RSTACK
+
+
+ .FUNCT DOORBELL-F
+ EQUAL? PRSA,V?TOUCH,V?PUSH \FALSE
+ PRINTI """Ding, dong!"""
+ CRLF
+ IN? JESTER,HERE /TRUE
+ SET 'DO-J,TRUE-VALUE
+ ICALL2 I-JESTER,TRUE-VALUE
+ RTRUE
+
+
+ .FUNCT PORTCULLIS-F
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ PRINTI "The portcullis, which is a heavy iron latticework used to block this entrance doorway, is "
+ ICALL2 OPEN-CLOSED,PORTCULLIS
+ PRINT PERIOD-CR
+ RTRUE
+?CCL3: EQUAL? PRSA,V?OPEN \?CCL5
+ FSET? PORTCULLIS,OPENBIT /?CCL5
+ PRINTR "You try to lift the portcullis, but with no effect (aside from nearly breaking your back)."
+?CCL5: EQUAL? PRSA,V?CLOSE \FALSE
+ FSET? PORTCULLIS,OPENBIT \FALSE
+ PRINT WONT-BUDGE
+ RTRUE
+
+ .ENDSEG
+
+ .SEGMENT "VILLAGE"
+
+
+ .FUNCT MOAT-F
+ CALL2 TOUCHING?,MOAT
+ ZERO? STACK /FALSE
+ EQUAL? HERE,PARAPET,UPPER-BARBICAN \FALSE
+ CALL2 CANT-REACH,MOAT
+ RSTACK
+
+
+ .FUNCT INNER-BAILEY-F,RARG
+ ZERO? DEMO-VERSION? /FALSE
+ EQUAL? RARG,M-END \FALSE
+ CALL1 END-DEMO
+ RSTACK
+
+ .SEGMENT "0"
+
+
+ .FUNCT WORM-F
+ EQUAL? PRSA,V?EAT \?CCL3
+ EQUAL? TURNED-INTO,ROOSTER \?CCL6
+ CALL2 GOOD-MEAL,WORM
+ RSTACK
+?CCL6: PRINTR "Yukko!"
+?CCL3: EQUAL? PRSA,V?RESEARCH \FALSE
+ CALL NOUN-USED?,WORM,W?WORM,W?EARTHWORM
+ ZERO? STACK /FALSE
+ PRINTR """A low form of ground-dwelling animal life."""
+
+
+ .FUNCT I-W-WORM,L
+ LOC WORM >L
+ FSET WORM,ANIMATEDBIT
+ IN? WORM,LAKE-BOTTOM \?CCL3
+ REMOVE WORM
+ RTRUE
+?CCL3: CALL2 META-LOC,WORM
+ EQUAL? STACK,HERE \?CCL5
+ ICALL1 RETURN-FROM-MAP
+ PRINTI " The worm "
+ EQUAL? L,PROTAGONIST,HERE /?CCL8
+ FSET? L,DROPBIT /?CCL8
+ MOVE WORM,HERE
+ FSET L,OPENBIT
+ PRINTI "wriggles out of"
+ ICALL2 TPRINT,L
+ JUMP ?CND6
+?CCL8: PRINTI "has resumed wriggling"
+?CND6: PRINT PERIOD-CR
+ RTRUE
+?CCL5: CALL2 META-LOC,WORM
+ MOVE WORM,STACK
+ RFALSE
+
+ .ENDSEG
+
+ .SEGMENT "VILLAGE"
+
+
+ .FUNCT TREE-F,ARG
+ EQUAL? ARG,M-WINNER \?CCL3
+ CALL1 PLANT-STUNNED
+ RSTACK
+?CCL3: EQUAL? PRSA,V?GET-NEAR \?CCL5
+ PRINTR "You are now standing at the base of the tree."
+?CCL5: EQUAL? PRSA,V?LISTEN \?CCL7
+ ZERO? PLANT-TALKER /?CCL7
+ EQUAL? PRSO,MIGHTY-ELM \?CCL12
+ PRINTR "The mighty elm rumbles in a voice that bespeaks great age and weariness. It seems to be pining for its simple, happier, younger days. Most particularly, it seems to be fondly recalling a playful squirrel named ""Rosebud."""
+?CCL12: EQUAL? PRSO,SMALL-ELM \?CCL14
+ PRINTR "The little elm's roots have, apparently, just reached down to a particularly yummy patch of decayed mulch, and the young elm is humming rhapsodically about the yumminess of the minerals therein."
+?CCL14: PRINTR "The two elms are exchanging off-color jokes, most of which seem to involve various methods of pollen transfer."
+?CCL7: EQUAL? PRSA,V?CLIMB-UP,V?CLIMB \?CCL16
+ EQUAL? PRSO,SMALL-ELM \?CCL19
+ PRINTR "Your weight is too much for this little tree."
+?CCL19: PRINT POORLY-CONFIGURED
+ RTRUE
+?CCL16: EQUAL? PRSA,V?LISTEN \?CCL21
+ ZERO? PLANT-TALKER /?CCL21
+ PRINTR "The tree's speech is very childlike and difficult to understand, but it seems to be fantasizing about the day when it will be tall enough to see over the castle walls."
+?CCL21: EQUAL? PRSA,V?MEASURE \FALSE
+ PRINTI "You can"
+ EQUAL? PRSO,MIGHTY-ELM \?CCL28
+ PRINTI "'t come close to getting"
+ JUMP ?CND26
+?CCL28: EQUAL? PRSO,SMALL-ELM \?CCL31
+ PRINTI " easily"
+ JUMP ?CND29
+?CCL31: PRINTI " just barely"
+?CND29: PRINTI " get"
+?CND26: PRINTR " your arms around the tree."
+
+
+ .FUNCT BARBICAN-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "This dimly lit room is the bottom level of the gate-tower which guards the castle's drawbridge. It lies at the tip of a peninsula into the moat; the rest of the peninsula is to the southeast. A drawbridge to the northwest is "
+ ICALL2 OPEN-CLOSED,DRAWBRIDGE
+ PRINTI ", and a ladder leads to an upper level."
+ RTRUE
+
+ .SEGMENT "0"
+
+
+ .FUNCT CANNONBALL-F
+ EQUAL? PRSA,V?PUT-ON \FALSE
+ EQUAL? P-PRSA-WORD,W?DROP \FALSE
+ EQUAL? PRSO,CANNONBALL \FALSE
+ MOVE CANNONBALL,HERE
+ FSET? PRSI,PARTBIT \?CCL9
+ PRINTR "Ouch!!!"
+?CCL9: GETP PRSI,P?SIZE
+ GRTR? STACK,10 \?CCL11
+ PRINTR "This has no effect."
+?CCL11: PRINTI "Miraculously,"
+ ICALL1 TPRINT-PRSI
+ PRINTR " survives."
+
+ .ENDSEG
+
+ .SEGMENT "VILLAGE"
+
+
+ .FUNCT MURDER-HOLE-F,TAKER
+ EQUAL? PRSA,V?LOOK-INSIDE \?CCL3
+ PRINTR "You can just make out the barbican below."
+?CCL3: EQUAL? PRSA,V?REACH-IN \?CCL5
+ PRINT NOTHING-IN-REACH
+ RTRUE
+?CCL5: EQUAL? PRSA,V?PUT-THROUGH,V?PUT \FALSE
+ EQUAL? PRSI,MURDER-HOLE \FALSE
+ EQUAL? PRSO,CANNONBALL \?CCL12
+ CALL2 VISIBLE?,CANDLE
+ ZERO? STACK /?CCL12
+ FSET? CANDLE,ONBIT \?CCL12
+ CALL2 ULTIMATELY-IN?,CANDLE
+ ZERO? STACK \?CND16
+ MOVE CANDLE,PROTAGONIST
+?CND16: PRINTI "As you drop the cannonball through the murder hole, you hear a sickening ""splat,"" followed by a woman's scream!
+ ""Emily, what is it!""
+ ""It's Victor -- he's been murdered!""
+ ""I'll summon the Inspector! Ah, here he is now!"" You hear whispered questions and answers from the room below, followed by footsteps on the stairs. The jester enters, wearing a trenchcoat and smoking a large pipe.
+ ""I'm afraid I'm going to have to order Sgt. Duffy to place you under arrest, sir."" You grow dizzy with confusion, and your surroundings swirl wildly about you"
+ PRINT ELLIPSIS
+ ICALL2 GOTO,DUNGEON
+ JUMP ?CND10
+?CCL12: PRINTI "You hear a ""thunk"" from down below."
+ CRLF
+?CND10: CALL FIND-IN,BARBICAN,WHITEBIT >TAKER
+ ZERO? TAKER \?CTR19
+ CALL FIND-IN,BARBICAN,BLACKBIT >TAKER
+ ZERO? TAKER /?CCL20
+?CTR19: MOVE PRSO,TAKER
+ EQUAL? PRSO,PIGEON \TRUE
+ ICALL2 MOVE-TO-PERCH,TAKER
+ RTRUE
+?CCL20: MOVE PRSO,BARBICAN
+ RTRUE
+
+
+ .FUNCT WHEEL-F
+ EQUAL? PRSA,V?SET-DIR,V?SET \FALSE
+ FSET? DRAWBRIDGE,OPENBIT \?CCL6
+ FCLEAR DRAWBRIDGE,OPENBIT
+ JUMP ?CND4
+?CCL6: FSET DRAWBRIDGE,OPENBIT
+?CND4: FSET BARBICAN,REDESCBIT
+ PRINTI "You hear a clattering clanking noise from below."
+ CRLF
+ ICALL ROB,DRAWBRIDGE,BARBICAN
+ RTRUE
+
+
+ .FUNCT DRAWBRIDGE-F,RARG
+ EQUAL? RARG,M-LOOK \?CCL3
+ PRINTI "You are standing on a sturdy wooden drawbridge across a moat. "
+ ZERO? TIME-STOPPED \?CND4
+ PRINTI "The surface of the moat roils from the thrashing of countless ravenous beasts. "
+?CND4: PRINTI "The drawbridge runs from a tall barbican at the southeast to a wide meadow at the northwest."
+ RTRUE
+?CCL3: ZERO? RARG \FALSE
+ EQUAL? PRSA,V?EXAMINE \?CCL9
+ PRINTI "The drawbridge is "
+ ICALL2 OPEN-CLOSED,DRAWBRIDGE
+ PRINT PERIOD-CR
+ RTRUE
+?CCL9: EQUAL? PRSA,V?LOWER,V?OPEN \?PRD13
+ FSET? DRAWBRIDGE,OPENBIT \?CCL11
+?PRD13: EQUAL? PRSA,V?RAISE,V?CLOSE \FALSE
+ FSET? DRAWBRIDGE,OPENBIT \FALSE
+?CCL11: PRINTR "There's no apparent way to do that."
+
+ .ENDSEG
+
+ .SEGMENT "CASTLE"
+
+
+ .FUNCT PARLOR-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ MOVE SPENSEWEED,FISH-TANK
+ FCLEAR SPENSEWEED,NDESCBIT
+ RTRUE
+
+
+ .FUNCT FISH-TANK-F
+ EQUAL? PRSA,V?TAKE \?CCL3
+ EQUAL? PRSO,FISH-TANK \?CCL3
+ ZERO? DESCRIBED-TANK-AS-SMALL /?CCL8
+ PRINTR "The fish tank is much too large to carry! [Okay, I was exaggerating when I called the tank ""itsy-bitsy.""]"
+?CCL8: SET 'DESCRIBED-TANK-AS-LARGE,TRUE-VALUE
+ PRINTR "This tank is bigger than a lot of swimming pools!"
+?CCL3: EQUAL? PRSO,FLAMINGO,ROOSTER,FOX \FALSE
+ FSET? PRSO,ANIMATEDBIT \FALSE
+ PRINTI "The "
+ ICALL2 DPRINT,PRSO
+ PRINTR " raises such a fuss that it becomes impossible."
+
+
+ .FUNCT SPENSEWEED-F,ARG
+ EQUAL? ARG,M-WINNER \?CCL3
+ CALL1 PLANT-STUNNED
+ RSTACK
+?CCL3: IN? PROTAGONIST,DB \?CCL5
+ CALL2 TOUCHING?,SPENSEWEED
+ ZERO? STACK /?CCL5
+ CALL2 CANT-REACH,SPENSEWEED
+ RSTACK
+?CCL5: EQUAL? PRSA,V?DIG,V?TAKE \?CCL9
+ EQUAL? PRSO,SPENSEWEED \?CCL9
+ PRINT DEEPLY-ROOTED
+ RTRUE
+?CCL9: EQUAL? PRSA,V?LISTEN \FALSE
+ ZERO? PLANT-TALKER /FALSE
+ PRINTR "It's difficult to interpret the gurgly voice of the spenseweed, but it seems to be fretting about the possibility of plant-eating fish being introduced into the aquarium."
+
+ .SEGMENT "0"
+
+
+ .FUNCT LOBSTER-F
+ EQUAL? PRSA,V?RESEARCH \?CCL3
+ CALL NOUN-USED?,LOBSTER,W?LOBSTER
+ ZERO? STACK /?CCL3
+ PRINT STR?304
+ CRLF
+ RTRUE
+?CCL3: EQUAL? PRSA,V?TAKE \?CCL7
+ FSET? LOBSTER,ANIMATEDBIT \?CCL7
+ ZERO? TIME-STOPPED /?CCL12
+ ICALL QUEUE,I-LOBSTER-PINCH,-1
+ RFALSE
+?CCL12: FSET? GLOVE,WORNBIT \?CCL14
+ ICALL QUEUE,I-LOBSTER-PINCH,2
+ MOVE LOBSTER,PROTAGONIST
+ PRINTR "Your gloved hand moves with blazing speed, lifting the lobster and avoiding its snapping pincers."
+?CCL14: PRINTR "The lobster snaps its pincers at you. You snatch your hand away just in time."
+?CCL7: EQUAL? PRSA,V?MUNG,V?KILL \?CCL16
+ EQUAL? PRSI,HAMMER,CANNONBALL \?CCL16
+ PRINTR "You pulverize the lobster into invisible jelly. Heartless; but then again, I understand there are a large group of people who release boiling these creatures alive."
+?CCL16: EQUAL? PRSA,V?EAT \FALSE
+ FSET? LOBSTER,ANIMATEDBIT \FALSE
+ PRINTR "1) It's not cooked. 2) It would probably bite your nose off if you tried. 3) You don't have any tableware. 4) You don't have any melted butter. 5) It isn't kosher."
+
+
+ .FUNCT I-W-LOBSTER
+ ZERO? TIME-STOPPED /?CND1
+ ICALL QUEUE,I-W-LOBSTER,3
+ RFALSE
+?CND1: FSET LOBSTER,ANIMATEDBIT
+ IN? LOBSTER,LAKE-BOTTOM \?CCL5
+ REMOVE LOBSTER
+ RTRUE
+?CCL5: IN? LOBSTER,PROTAGONIST \?CCL7
+ IN? LOBSTER,WALDO /?CCL7
+ ICALL1 RETURN-FROM-MAP
+ PRINTI " Youch! The nutcracker just pinched you! As you drop it, you realize that it has turned back into a lobster."
+ EQUAL? HERE,HANGING-FROM-ROOTS,UNDER-THE-WORLD \?CCL12
+ REMOVE LOBSTER
+ PRINTR " The poor creature plunges into the void."
+?CCL12: MOVE LOBSTER,HERE
+ CRLF
+ RTRUE
+?CCL7: CALL2 VISIBLE?,LOBSTER
+ ZERO? STACK /FALSE
+ ICALL1 RETURN-FROM-MAP
+ PRINTR " You notice the nutcracker waving its pincers. It seems that the nutcracker is once again a lobster."
+
+
+ .FUNCT I-LOBSTER-PINCH
+ ZERO? TIME-STOPPED \FALSE
+ FSET? LOBSTER,ANIMATEDBIT \FALSE
+ ICALL2 DEQUEUE,I-LOBSTER-PINCH
+ CALL2 ULTIMATELY-IN?,LOBSTER
+ ZERO? STACK /FALSE
+ IN? LOBSTER,WALDO /FALSE
+ ICALL1 RETURN-FROM-MAP
+ PRINTI " Youch! The lobster gives you a painful nip, and you drop it like a hot potato."
+ EQUAL? HERE,HANGING-FROM-ROOTS,UNDER-THE-WORLD \?CCL12
+ REMOVE LOBSTER
+ PRINTR " The poor creature plunges into the void."
+?CCL12: MOVE LOBSTER,HERE
+ CRLF
+ RTRUE
+
+
+ .FUNCT STARFISH-F
+ EQUAL? PRSA,V?RESEARCH \FALSE
+ CALL NOUN-USED?,STARFISH,W?STARFISH
+ ZERO? STACK /FALSE
+ PRINT STR?304
+ CRLF
+ RTRUE
+
+
+ .FUNCT I-W-STARFISH
+ ZERO? TIME-STOPPED /?CND1
+ ICALL QUEUE,I-W-STARFISH,3
+ RFALSE
+?CND1: FSET STARFISH,ANIMATEDBIT
+ IN? STARFISH,LAKE-BOTTOM \?CCL5
+ REMOVE STARFISH
+ RTRUE
+?CCL5: CALL2 VISIBLE?,STARFISH
+ ZERO? STACK /FALSE
+ ICALL1 RETURN-FROM-MAP
+ PRINTR " With the tiniest wiggle, the star gives evidence that it is once again a starfish."
+
+ .ENDSEG
+
+ .SEGMENT "0"
+
+ .SEGMENT "CASTLE"
+
+
+ .FUNCT BICKERING-TORCH-F
+ EQUAL? PRSA,V?TAKE \?CCL3
+ ICALL QUEUE,I-BICKERING-TORCH,-1
+ RFALSE
+?CCL3: EQUAL? PRSA,V?BURN,V?ON,V?EXAMINE \FALSE
+ CALL2 BURNED-OUT,BICKERING-TORCH
+ RSTACK
+
+
+ .FUNCT BURNED-OUT,OBJ
+ PRINTI "The "
+ ICALL2 DPRINT,OBJ
+ PRINTR " has burned out and cannot be rekindled."
+
+
+ .FUNCT I-BICKERING-TORCH
+ ZERO? TIME-STOPPED \FALSE
+ CALL2 ULTIMATELY-IN?,BICKERING-TORCH
+ ZERO? STACK \?CCL5
+ ICALL2 DEQUEUE,I-BICKERING-TORCH
+ RFALSE
+?CCL5: RANDOM 100
+ LESS? 30,STACK /FALSE
+ EQUAL? CURRENT-SPLIT,MAP-TOP-LEFT-LOC /FALSE
+ PRINTI " The bickering torch says, """
+ CALL2 PICK-ONE,BITCHES
+ PRINT STACK
+ PRINTR """"
+
+
+ .FUNCT FLICKERING-TORCH-F
+ EQUAL? PRSA,V?TAKE \?CCL3
+ FSET? FLICKERING-TORCH,ONBIT \?CCL3
+ ZERO? FLICKERING-TORCH-COUNT \?CCL3
+ RANDOM 3
+ ADD STACK,9 >FLICKERING-TORCH-COUNT
+ ICALL QUEUE,I-FLICKERING-TORCH,-1
+ RFALSE
+?CCL3: EQUAL? PRSA,V?OFF \?CCL8
+ FSET? FLICKERING-TORCH,ONBIT \?CCL8
+ FCLEAR FLICKERING-TORCH,ONBIT
+ FCLEAR FLICKERING-TORCH,FLAMEBIT
+ ICALL2 DEQUEUE,I-FLICKERING-TORCH
+ PRINTI """Pffft."""
+ CRLF
+ CALL1 NOW-DARK?
+ RSTACK
+?CCL8: EQUAL? PRSA,V?OFF,V?ON,V?EXAMINE /?PRD14
+ EQUAL? PRSA,V?BURN \FALSE
+?PRD14: FSET? FLICKERING-TORCH,ONBIT /FALSE
+ CALL2 BURNED-OUT,FLICKERING-TORCH
+ RSTACK
+
+
+ .FUNCT I-FLICKERING-TORCH
+ DEC 'FLICKERING-TORCH-COUNT
+ FSET? FLICKERING-TORCH,ONBIT /?CCL3
+ PUTP FLICKERING-TORCH,P?SDESC,STR?316
+ ICALL2 DEQUEUE,I-FLICKERING-TORCH
+ RFALSE
+?CCL3: ZERO? FLICKERING-TORCH-COUNT \?CND1
+ PUTP FLICKERING-TORCH,P?SDESC,STR?316
+ FCLEAR FLICKERING-TORCH,ONBIT
+ FCLEAR FLICKERING-TORCH,FLAMEBIT
+ ICALL2 DEQUEUE,I-FLICKERING-TORCH
+?CND1: CALL2 VISIBLE?,FLICKERING-TORCH
+ ZERO? STACK /FALSE
+ FSET? FLICKERING-TORCH,ONBIT /?CCL9
+ ICALL1 RETURN-FROM-MAP
+ CALL2 IN-THE-SKY,STR?317
+ RSTACK
+?CCL9: RANDOM 100
+ LESS? 40,STACK /FALSE
+ ICALL1 RETURN-FROM-MAP
+ PRINTR " The flame of the flickering torch dances wildly on the brink of extinction."
+
+
+ .FUNCT IN-THE-SKY,STRING
+ PRINTI " The "
+ PRINT STRING
+ PRINTI "ering torch gives its last "
+ PRINT STRING
+ PRINTI "er before going to that great Torch Room in the sky."
+ CRLF
+ CALL1 NOW-DARK?
+ RSTACK
+
+
+ .FUNCT MUTTERING-TORCH-F
+ EQUAL? PRSA,V?TAKE \?CCL3
+ ICALL QUEUE,I-MUTTERING-TORCH,-1
+ RFALSE
+?CCL3: EQUAL? PRSA,V?BURN,V?ON,V?EXAMINE \FALSE
+ CALL2 BURNED-OUT,MUTTERING-TORCH
+ RSTACK
+
+
+ .FUNCT I-MUTTERING-TORCH
+ ZERO? TIME-STOPPED \FALSE
+ CALL2 ULTIMATELY-IN?,MUTTERING-TORCH
+ ZERO? STACK \?CCL5
+ ICALL2 DEQUEUE,I-MUTTERING-TORCH
+ RFALSE
+?CCL5: RANDOM 100
+ LESS? 30,STACK /FALSE
+ EQUAL? CURRENT-SPLIT,MAP-TOP-LEFT-LOC /FALSE
+ PRINTI " The muttering torch mutters something about "
+ CALL2 PICK-ONE,MUTTERS
+ PRINT STACK
+ PRINT PERIOD-CR
+ RTRUE
+
+
+ .FUNCT GUTTERING-TORCH-F
+ EQUAL? PRSA,V?TAKE \?CCL3
+ FSET? GUTTERING-TORCH,ONBIT \?CCL3
+ ZERO? GUTTERING-TORCH-COUNT \?CCL3
+ RANDOM 3
+ ADD STACK,9 >GUTTERING-TORCH-COUNT
+ ICALL QUEUE,I-GUTTERING-TORCH,-1
+ RFALSE
+?CCL3: EQUAL? PRSA,V?OFF \?CCL8
+ FSET? GUTTERING-TORCH,ONBIT \?CCL8
+ FCLEAR GUTTERING-TORCH,ONBIT
+ FCLEAR GUTTERING-TORCH,FLAMEBIT
+ ICALL2 DEQUEUE,I-GUTTERING-TORCH
+ PRINTI """Pffft."""
+ CRLF
+ CALL1 NOW-DARK?
+ RSTACK
+?CCL8: EQUAL? PRSA,V?OFF,V?ON,V?EXAMINE /?PRD14
+ EQUAL? PRSA,V?BURN \FALSE
+?PRD14: FSET? GUTTERING-TORCH,ONBIT /FALSE
+ CALL2 BURNED-OUT,GUTTERING-TORCH
+ RSTACK
+
+
+ .FUNCT I-GUTTERING-TORCH
+ DEC 'GUTTERING-TORCH-COUNT
+ FSET? GUTTERING-TORCH,ONBIT /?CCL3
+ PUTP GUTTERING-TORCH,P?SDESC,STR?324
+ ICALL2 DEQUEUE,I-GUTTERING-TORCH
+ RFALSE
+?CCL3: ZERO? GUTTERING-TORCH-COUNT \?CND1
+ PUTP GUTTERING-TORCH,P?SDESC,STR?324
+ FCLEAR GUTTERING-TORCH,ONBIT
+ FCLEAR GUTTERING-TORCH,FLAMEBIT
+ ICALL2 DEQUEUE,I-GUTTERING-TORCH
+?CND1: CALL2 VISIBLE?,GUTTERING-TORCH
+ ZERO? STACK /FALSE
+ FSET? GUTTERING-TORCH,ONBIT /?CCL9
+ ICALL1 RETURN-FROM-MAP
+ CALL2 IN-THE-SKY,STR?325
+ RSTACK
+?CCL9: RANDOM 100
+ LESS? 40,STACK /FALSE
+ ICALL1 RETURN-FROM-MAP
+ PRINTR " The guttering torch sputters on the verge of burning out, but then decides to keep burning for at least another minute."
+
+ .ENDSEG
+
+ .SEGMENT "CASTLE"
+
+
+ .FUNCT GARDEN-FLOWER-PS
+ EQUAL? PRSA,V?PICK \?CCL3
+ PRINTR "Ouch! Thorns!"
+?CCL3: EQUAL? PRSA,V?EXAMINE \?CCL5
+ PRINTR "Breathtakingly beautiful."
+?CCL5: EQUAL? PRSA,V?LISTEN \FALSE
+ ZERO? PLANT-TALKER /FALSE
+ CALL2 PERFORM-PRSA,FLORA
+ RSTACK
+
+
+ .FUNCT FLORA-F,ARG
+ EQUAL? ARG,M-WINNER \?CCL3
+ CALL1 PLANT-STUNNED
+ RSTACK
+?CCL3: EQUAL? PRSA,V?EXAMINE \?CCL5
+ PRINTR "Breathtakingly beautiful."
+?CCL5: EQUAL? PRSA,V?LISTEN \FALSE
+ ZERO? PLANT-TALKER /FALSE
+ PRINTR "The many shrub and trees and flowers create a cacophony of plant-talk that makes it impossible to understand any of it!"
+
+ .SEGMENT "0"
+
+
+ .FUNCT FLAMINGO-F,ARG
+ FSET? FLAMINGO,ANIMATEDBIT \FALSE
+ EQUAL? PRSA,V?RESEARCH \?CCL5
+ CALL NOUN-USED?,FLAMINGO,W?FLAMINGO
+ ZERO? STACK /?CCL5
+ PRINTR """A common garden animal."""
+?CCL5: EQUAL? PRSA,V?FEED \?CCL9
+ CALL2 ULTIMATELY-IN?,BAR-OF-FOOD
+ ZERO? STACK /?CCL9
+ ICALL PERFORM,V?GIVE,BAR-OF-FOOD,FLAMINGO
+ RTRUE
+?CCL9: EQUAL? PRSA,V?SHOW \?CCL13
+ EQUAL? PRSO,BAR-OF-FOOD \?CCL13
+ PRINTR "The flamingo feigns disinterest, but vast volumes of drool betray its true feelings."
+?CCL13: EQUAL? PRSA,V?GIVE \?CCL17
+ EQUAL? PRSO,BAR-OF-FOOD \?CCL17
+ REMOVE BAR-OF-FOOD
+ PRINTI "The flamingo greedily snatches"
+ ICALL2 TPRINT,BAR-OF-FOOD
+ PRINTR " in its beak and gulps it down."
+?CCL17: ZERO? TIME-STOPPED \FALSE
+ EQUAL? PRSA,V?CATCH,V?TAKE \?CCL23
+ PRINTR "The flamingo prances away, leaving you clutching at air."
+?CCL23: EQUAL? PRSA,V?TOUCH \FALSE
+ PRINTR "The bird nearly nips off a finger."
+
+
+ .FUNCT I-W-FLAMINGO,L
+ LOC FLAMINGO >L
+ ZERO? TIME-STOPPED /?CND1
+ ICALL QUEUE,I-W-FLAMINGO,3
+ RFALSE
+?CND1: FSET FLAMINGO,ANIMATEDBIT
+ IN? FLAMINGO,LAKE-BOTTOM \?CCL5
+ REMOVE FLAMINGO
+ RTRUE
+?CCL5: CALL2 META-LOC,FLAMINGO
+ EQUAL? STACK,HERE \?CCL7
+ ICALL1 RETURN-FROM-MAP
+ PRINTI " Based on its angry squawks, the lawn ornament has returned to its former state"
+ IN? FLAMINGO,FISH-TANK \?CCL10
+ PRINTI ". The flamingo sprays you with water as it leaps out of the fish tank"
+ JUMP ?CND8
+?CCL10: EQUAL? L,PROTAGONIST,HERE /?CCL12
+ FSET? L,DROPBIT /?CCL12
+ MOVE FLAMINGO,HERE
+ FSET L,OPENBIT
+ PRINTI " and popped out of"
+ ICALL2 TPRINT,L
+ JUMP ?CND8
+?CCL12: CALL2 ULTIMATELY-IN?,FLAMINGO
+ ZERO? STACK /?CND8
+ IN? FLAMINGO,WALDO /?CND8
+ PRINTI ". The flamingo gives you a vicious peck and hops to the ground"
+?CND8: CALL2 ULTIMATELY-IN?,FLAMINGO
+ ZERO? STACK /?CCL20
+ LOC PROTAGONIST
+ FSET? STACK,DROPBIT \?CCL20
+ LOC PROTAGONIST
+ MOVE FLAMINGO,STACK
+ JUMP ?CND18
+?CCL20: LOC FLAMINGO
+ FSET? STACK,DROPBIT /?CND18
+ MOVE FLAMINGO,HERE
+?CND18: PRINT PERIOD-CR
+ RTRUE
+?CCL7: CALL2 ULTIMATELY-IN?,FLAMINGO
+ ZERO? STACK /?CCL26
+ LOC PROTAGONIST
+ FSET? STACK,DROPBIT \?CCL26
+ LOC PROTAGONIST
+ MOVE FLAMINGO,STACK
+ RFALSE
+?CCL26: LOC FLAMINGO
+ FSET? STACK,DROPBIT /FALSE
+ CALL2 META-LOC,FLAMINGO
+ MOVE FLAMINGO,STACK
+ RFALSE
+
+ .ENDSEG
+
+ .SEGMENT "CASTLE"
+
+
+ .FUNCT COURTYARD-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "This open area is paved with marble and surrounded by imposing stone walls. "
+ CALL2 RUNNING?,I-PROLOGUE
+ ZERO? STACK /?CCL6
+ PRINTI "Servants are cleaning up after a tremendous carnival"
+ JUMP ?CND4
+?CCL6: PRINTI "Dimwit would occasionally order carnivals to be set up in this court, on totally cloudless days"
+?CND4: PRINTI ". At the distant edges of the courtyard, you can see exits to the north, west, and southeast."
+ RTRUE
+
+
+ .FUNCT BANNER-F
+ EQUAL? PRSA,V?EXAMINE,V?READ \?CCL3
+ PRINTR "These colorful banners display various royal crests and insignias."
+?CCL3: EQUAL? PRSA,V?CLIMB-DOWN \FALSE
+ PRINTI "Okay, but for future reference, the stairs are easier"
+ PRINT ELLIPSIS
+ CALL2 GOTO,GREAT-HALL
+ RSTACK
+
+
+ .FUNCT REBUS-F,OARG,CNT
+ CALL2 CCOUNT,REBUS >CNT
+ ZERO? OARG /?CCL3
+ EQUAL? OARG,M-OBJDESC? /TRUE
+ PRINTI " A large framed rebus occupies a central position at the far end of the gallery. It appears to have been recently hung."
+ GRTR? CNT,0 \TRUE
+ PRINTI " The rebus is "
+ GRTR? CNT,3 \?CCL10
+ PRINTI "mostly"
+ JUMP ?CND8
+?CCL10: PRINTI "partially"
+?CND8: PRINTI " obscured by a"
+ EQUAL? CNT,1 \?CCL13
+ PRINTI "n animal -- or a representation of an animal"
+ JUMP ?CND11
+?CCL13: PRINTI " number of animals -- or representations of animals"
+?CND11: PRINTI " -- which appear"
+ EQUAL? CNT,1 \?CND14
+ PRINTC 115
+?CND14: PRINTI " to be magically layered onto its surface:"
+ FCLEAR REBUS-CAMEL,NDESCBIT
+ FCLEAR REBUS-MOUSE,NDESCBIT
+ FCLEAR REBUS-GOOSE,NDESCBIT
+ FCLEAR REBUS-SNAKE,NDESCBIT
+ FCLEAR REBUS-FISH,NDESCBIT
+ FCLEAR REBUS-SLIME-MONSTER,NDESCBIT
+ ICALL D-CONTENTS,REBUS,2
+ FSET REBUS-CAMEL,NDESCBIT
+ FSET REBUS-MOUSE,NDESCBIT
+ FSET REBUS-GOOSE,NDESCBIT
+ FSET REBUS-SNAKE,NDESCBIT
+ FSET REBUS-FISH,NDESCBIT
+ FSET REBUS-SLIME-MONSTER,NDESCBIT
+ RTRUE
+?CCL3: EQUAL? PRSA,V?CLOSE,V?OPEN \?CCL17
+ PRINT HUH
+ RTRUE
+?CCL17: EQUAL? PRSA,V?PUT-ON,V?PUT \?CCL19
+ EQUAL? PRSI,REBUS \?CCL19
+ PRINT HUH
+ RTRUE
+?CCL19: EQUAL? PRSA,V?EXAMINE,V?READ \FALSE
+ CLEAR -1
+ SCREEN S-FULL
+ IN? REBUS-MOUSE,REBUS \?CCL26
+ PUSH REBUS-6
+ JUMP ?CND24
+?CCL26: IN? REBUS-GOOSE,REBUS \?CCL28
+ PUSH REBUS-5
+ JUMP ?CND24
+?CCL28: IN? REBUS-SLIME-MONSTER,REBUS \?CCL30
+ PUSH REBUS-4
+ JUMP ?CND24
+?CCL30: IN? REBUS-CAMEL,REBUS \?CCL32
+ PUSH REBUS-3
+ JUMP ?CND24
+?CCL32: IN? REBUS-SNAKE,REBUS \?CCL34
+ PUSH REBUS-2
+ JUMP ?CND24
+?CCL34: IN? REBUS-FISH,REBUS \?CCL36
+ PUSH REBUS-1
+ JUMP ?CND24
+?CCL36: PUSH REBUS-0
+?CND24: DISPLAY STACK,1,1
+ ZERO? DEMO-VERSION? /?CCL39
+ ICALL2 INPUT-DEMO,1
+ JUMP ?CND37
+?CCL39: INPUT 1
+?CND37: ICALL1 MOUSE-INPUT?
+ ICALL1 V-$REFRESH
+ RTRUE
+
+
+ .FUNCT REBUS-ANIMAL-F
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ PRINTI "The "
+ PRINTD PRSO
+ PRINTR " seems to be magically flattened upon the rebus surface."
+?CCL3: EQUAL? PRSA,V?MOVE,V?TAKE \?CCL5
+ PRINT WONT-BUDGE
+ RTRUE
+?CCL5: EQUAL? PRSA,V?TOUCH \FALSE
+ PRINTI "The "
+ PRINTD PRSO
+ PRINTR " feels cold to the touch."
+
+
+ .FUNCT PAINTINGS-F
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ PRINTR "These are Leonardo Flathead's famous portraits of the Twelve Flatheads, including his own self-portrait, which been have reproduced in many places [such as the ""Lives of the Twelve Flatheads Calendar"" which you'll find in your Zork Zero package]."
+?CCL3: EQUAL? PRSA,V?MOVE,V?TAKE \?CCL5
+ PRINTR "The portraits are all securely fastened to the wall."
+?CCL5: EQUAL? PRSA,V?COUNT \FALSE
+ PRINTR "12."
+
+
+ .FUNCT PAINTING-F
+ EQUAL? PRSA,V?MOVE,V?TAKE,V?EXAMINE \?CCL3
+ CALL2 PERFORM-PRSA,PAINTINGS
+ RSTACK
+?CCL3: EQUAL? PRSA,V?RESEARCH \FALSE
+ PRINTR """One of the Twelve Flatheads. For more information, we recommend Boswell Barwell's 'The Lives of the Twelve Flatheads.'"" [Excerpts of which can be found in the calendar from your Zork Zero package.]"
+
+ .SEGMENT "VILLAGE"
+
+ .SEGMENT "LAKE"
+
+ .SEGMENT "ORACLE"
+
+
+ .FUNCT REBUS-BUTTON-F
+ EQUAL? PRSA,V?PUSH \FALSE
+ FSET? PRSO,TOUCHBIT /?CTR5
+ ZERO? TIME-STOPPED /?CCL6
+?CTR5: PRINT NOTHING-HAPPENS
+ RTRUE
+?CCL6: FSET PRSO,TOUCHBIT
+ PUTP PRSO,P?SDESC,STR?270
+ PRINTI "The button produces a "
+ IN? REBUS-MOUSE,REBUS \?CCL11
+ REMOVE REBUS-MOUSE
+ PRINTI "squeak"
+ JUMP ?CND9
+?CCL11: IN? REBUS-GOOSE,REBUS \?CCL13
+ REMOVE REBUS-GOOSE
+ PRINTI "honk"
+ JUMP ?CND9
+?CCL13: IN? REBUS-SLIME-MONSTER,REBUS \?CCL15
+ REMOVE REBUS-SLIME-MONSTER
+ PRINTI "squish"
+ JUMP ?CND9
+?CCL15: IN? REBUS-CAMEL,REBUS \?CCL17
+ REMOVE REBUS-CAMEL
+ PRINTI "bray"
+ JUMP ?CND9
+?CCL17: IN? REBUS-SNAKE,REBUS \?CCL19
+ REMOVE REBUS-SNAKE
+ PRINTI "hiss"
+ JUMP ?CND9
+?CCL19: REMOVE REBUS-FISH
+ PRINTI "splash"
+?CND9: PRINTR "ing noise and stops blinking."
+
+ .ENDSEG
+
+ .SEGMENT "0"
+
+
+ .FUNCT BAG-F
+ EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTI "There's writing on the outside of the bag. "
+ RFALSE
+
+
+ .FUNCT BAR-OF-FOOD-F
+ EQUAL? PRSA,V?EAT \FALSE
+ EQUAL? TURNED-INTO,FLAMINGO \?CCL6
+ CALL2 GOOD-MEAL,BAR-OF-FOOD
+ RSTACK
+?CCL6: CALL2 JIGS-UP,STR?339
+ RSTACK
+
+ .ENDSEG
+
+ .SEGMENT "CASTLE"
+
+
+ .FUNCT TOWER-PS
+ CALL2 TOUCHING?,PSEUDO-OBJECT
+ ZERO? STACK /FALSE
+ CALL2 CANT-REACH,PSEUDO-OBJECT
+ RSTACK
+
+
+ .FUNCT THRONE-ROOM-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "This is a smaller version of the room to the north, meaning that a person can walk all the way across it without stopping to rest. The throne, though smaller and more comfortable looking, is just as gaudy. It is in this chamber that Dimwit would meet with his ""advisors,"" raising taxes and plotting grandiose schemes. A doorway leads north"
+ ZERO? SECRET-PASSAGE-OPEN /?CND4
+ PRINTI ", and a secret passage is open to the south"
+?CND4: PRINTC 46
+ RTRUE
+
+
+ .FUNCT THRONE-F,VARG
+ ZERO? DEMO-VERSION? /?CCL3
+ EQUAL? VARG,M-ENTER \?CCL3
+ EQUAL? PRSO,SMALL-THRONE \?CCL3
+ PRINTC 32
+ ICALL1 OPEN-SECRET-PASSAGE?
+ RETURN 2
+?CCL3: ZERO? VARG \FALSE
+ EQUAL? PRSA,V?CLIMB-UP \?CCL12
+ ICALL PERFORM,V?ENTER,PRSO
+ RTRUE
+?CCL12: EQUAL? PRSA,V?LOOK-BEHIND \FALSE
+ PRINTI "Behind the throne"
+ EQUAL? HERE,AUDIENCE-CHAMBER \?CCL17
+ PRINTR ", a doorway leads south."
+?CCL17: ZERO? SECRET-PASSAGE-OPEN /?CCL19
+ PRINTR ", a secret passage beckons to the south!"
+?CCL19: PRINTR " is nothing but a blank wall."
+
+ .ENDSEG
+
+ .SEGMENT "SECRET"
+
+
+ .FUNCT SECRET-PASSAGE-F,RARG
+ ZERO? DEMO-VERSION? /FALSE
+ EQUAL? RARG,M-END \FALSE
+ CALL1 END-DEMO
+ RSTACK
+
+ .SEGMENT "0"
+
+
+ .FUNCT CANDLE-F,FLAME
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ FSET? CANDLE,ONBIT \?CCL6
+ PRINTR "The flame burns tall and bright."
+?CCL6: PRINTR "The candle has been snuffed."
+?CCL3: EQUAL? PRSA,V?ON \FALSE
+ FSET? CANDLE,FLAMEBIT /FALSE
+ CALL FIND-IN,HERE,FLAMEBIT,STR?202 >FLAME
+ ZERO? FLAME /?CCL13
+ FSET CANDLE,FLAMEBIT
+ FSET CANDLE,ONBIT
+ PRINTR "You re-light the candle."
+?CCL13: PRINTR "You have no flame to light the candle."
+
+ .ENDSEG
+
+ .SEGMENT "SECRET"
+
+
+ .FUNCT SOLAR-F,RARG
+ EQUAL? RARG,M-END \FALSE
+ IN? EAST-KEY,JESTER \FALSE
+ IN? JESTER,HERE \FALSE
+ CALL2 SETUP-ORPHAN,STR?44
+ RSTACK
+
+ .SEGMENT "0"
+
+
+ .FUNCT EAST-KEY-F
+ EQUAL? PRSA,V?TAKE \FALSE
+ FSET? EAST-KEY,TRYTAKEBIT \FALSE
+ IN? EAST-KEY,JESTER \?CCL8
+ PRINT ANSWER-MY-RIDDLE
+ RTRUE
+?CCL8: PRINTI "You begin reaching for the key..."
+ CRLF
+ SET 'DO-J,TRUE-VALUE
+ CALL1 I-JESTER
+ RSTACK
+
+ .ENDSEG
+
+ .SEGMENT "0"
+
+ .SEGMENT "SECRET"
+
+
+ .FUNCT CLOAK-F
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ CALL NOUN-USED?,CLOAK,W?CLOAK
+ ZERO? STACK /?CCL6
+ PRINTR "The colors of the cloak seem to shimmer like a Mithican chameleon. There's a small label with writing on it."
+?CCL6: ICALL PERFORM,V?READ,CLOAK
+ RTRUE
+?CCL3: EQUAL? PRSA,V?READ \?CCL8
+ PRINTR """Frobozz Magic Cloak Company."""
+?CCL8: EQUAL? HERE,OUBLIETTE \?CCL10
+ EQUAL? PRSA,V?TAKE-OFF,V?WEAR \?CCL10
+ PRINTR "There's not enough elbow room here."
+?CCL10: EQUAL? PRSA,V?WEAR \?CCL14
+ EQUAL? HERE,PLAIN /?CCL14
+ FSET? CLOAK,WORNBIT /?CCL14
+ FSET? OUTER-GATE,OPENBIT /?CCL14
+ IN? CLOAK,WALDO /?CCL14
+ ZERO? TIME-STOPPED \?CCL14
+ EQUAL? HERE,CONSTRUCTION \?CCL23
+ ICALL STORE,CONSTRUCTION-OFFSET,CONSTRUCTION-LOC,CONSTRUCTION
+ JUMP ?CND21
+?CCL23: EQUAL? HERE,FR-OFFICES \?CCL25
+ ICALL STORE,OFFICES-OFFSET,FLOOR-NUMBER,FR-OFFICES
+ JUMP ?CND21
+?CCL25: EQUAL? HERE,OFFICES-NORTH \?CCL27
+ ICALL STORE,OFFICES-N-OFFSET,FLOOR-NUMBER,OFFICES-NORTH
+ JUMP ?CND21
+?CCL27: EQUAL? HERE,OFFICES-SOUTH \?CCL29
+ ICALL STORE,OFFICES-S-OFFSET,FLOOR-NUMBER,OFFICES-SOUTH
+ JUMP ?CND21
+?CCL29: EQUAL? HERE,OFFICES-EAST \?CCL31
+ ICALL STORE,OFFICES-E-OFFSET,FLOOR-NUMBER,OFFICES-EAST
+ JUMP ?CND21
+?CCL31: EQUAL? HERE,OFFICES-WEST \?CND21
+ ICALL STORE,OFFICES-W-OFFSET,FLOOR-NUMBER,OFFICES-WEST
+?CND21: FSET CLOAK,WORNBIT
+ LOC PROTAGONIST
+ FSET? STACK,TAKEBIT \?CCL35
+ SET 'CLOAK-LOC,HERE
+ JUMP ?CND33
+?CCL35: LOC PROTAGONIST >CLOAK-LOC
+?CND33: MOVE PROTAGONIST,HERE
+ DIV PLAIN-LOC,8
+ ADD STACK,1 >RANK
+ MOD PLAIN-LOC,8
+ ADD STACK,1 >FILE
+ ICALL1 CAST-HUNGER-SPELL
+ PRINTI "As you wrap the cloak around you, the world changes"
+ PRINT ELLIPSIS
+ ICALL UNSTORE,PLAIN-OFFSET,PLAIN-LOC,PLAIN
+ CALL2 GOTO,PLAIN
+ RSTACK
+?CCL14: EQUAL? PRSA,V?TAKE-OFF \FALSE
+ FSET? CLOAK,WORNBIT \FALSE
+ EQUAL? HERE,PLAIN \FALSE
+ FCLEAR CLOAK,WORNBIT
+ ICALL STORE,PLAIN-OFFSET,PLAIN-LOC,PLAIN
+ PRINTI "As the cloak is removed, the world changes again"
+ PRINT ELLIPSIS
+ EQUAL? CLOAK-LOC,CONSTRUCTION \?CCL43
+ DIV CONSTRUCTION-LOC,8
+ ADD STACK,1 >RANK
+ MOD CONSTRUCTION-LOC,8
+ ADD STACK,1 >FILE
+ ICALL UNSTORE,CONSTRUCTION-OFFSET,CONSTRUCTION-LOC,CLOAK-LOC
+ JUMP ?CND41
+?CCL43: EQUAL? CLOAK-LOC,FR-OFFICES,OFFICES-NORTH,OFFICES-SOUTH /?CCL44
+ EQUAL? CLOAK-LOC,OFFICES-EAST,OFFICES-WEST \?CND41
+?CCL44: ICALL2 OFFICE-UNSTORE,FLOOR-NUMBER
+?CND41: ICALL2 GOTO,CLOAK-LOC
+ EQUAL? CLOAK-LOC,ORACLE-OBJECT \TRUE
+ IN? RUBY,DEPRESSION \TRUE
+ PRINTI " You have only a moment to take in your surroundings. "
+ ICALL PERFORM,V?ENTER,ORACLE-OBJECT
+ RTRUE
+
+
+ .FUNCT GLOVE-F
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ FSET? GOGGLES,WORNBIT \?CCL6
+ FSET? GLOVE,WORNBIT \?CCL6
+ ICALL1 DISCOVER-X-RAY
+ PRINTR "You can see your hand within the glove."
+?CCL6: CALL NOUN-USED?,GLOVE,W?GLOVE
+ ZERO? STACK /?CCL10
+ PRINTR "Tiny writing is embroidered at the edge of the glove."
+?CCL10: ICALL PERFORM,V?READ,GLOVE
+ RTRUE
+?CCL3: EQUAL? PRSA,V?READ \FALSE
+ PRINTR """Frobozz Magic Glove Company."""
+
+ .ENDSEG
+
+ .SEGMENT "SECRET"
+
+
+ .FUNCT MACHICOLATION-F
+ EQUAL? PRSA,V?PUT-THROUGH,V?PUT \?CCL3
+ EQUAL? PRSI,MACHICOLATION \?CCL3
+ REMOVE PRSO
+ EQUAL? PRSO,PERCH /?CCL7
+ CALL ULTIMATELY-IN?,PERCH,PRSO
+ ZERO? STACK /?CND6
+?CCL7: SET 'REMOVED-PERCH-LOC,GROUND
+?CND6: PRINTI "You hear a distant ""thunk,"" as"
+ ICALL1 TPRINT-PRSO
+ PRINTR " imbeds itself into the ground. The lack of an accompanying distant ""ouch!"" would seem to indicate that there are no invaders below."
+?CCL3: EQUAL? PRSA,V?LOOK-INSIDE \?CCL11
+ PRINT YOU-SEE
+ PRINTR " light at the bottom of the hole."
+?CCL11: EQUAL? PRSA,V?REACH-IN \FALSE
+ PRINT NOTHING-IN-REACH
+ RTRUE
+
+
+ .FUNCT CRYPT-F,RARG
+ ZERO? DEMO-VERSION? /?CCL3
+ EQUAL? RARG,M-END \?CCL3
+ CALL1 END-DEMO
+ RSTACK
+?CCL3: EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "The remains of generations of royalty lie arranged on slabs through this underground tomb. A passage leads off to the south. In the center of the low ceiling is a small trap door, which is "
+ ICALL2 OPEN-CLOSED,TRAP-DOOR
+ FSET? HOLEY-SLAB,TOUCHBIT \?CND8
+ PRINTI ". Barely visible beneath one of the slabs, a dark moist opening leads downward"
+?CND8: PRINTC 46
+ RTRUE
+
+
+ .FUNCT BODIES-F
+ CALL2 TOUCHING?,BODIES
+ ZERO? STACK /FALSE
+ CALL2 PERFORM-PRSA,BONES
+ RSTACK
+
+
+ .FUNCT ORACLE-ENTER-F,RARG
+ FSET? OUTER-GATE,OPENBIT /?CTR2
+ ZERO? TIME-STOPPED /?CCL3
+?CTR2: ZERO? RARG \FALSE
+ ICALL1 RETURN-FROM-MAP
+ PRINTI "The hole under the slab has vanished!"
+ CRLF
+ RFALSE
+?CCL3: FSET? HOLEY-SLAB,TOUCHBIT \?CCL9
+ RETURN ORACLE
+?CCL9: ZERO? RARG \FALSE
+ ICALL1 CANT-GO
+ RFALSE
+
+
+ .FUNCT SLAB-F
+ EQUAL? PRSA,V?LOOK-UNDER \FALSE
+ EQUAL? PRSO,HOLEY-SLAB \FALSE
+ FSET? OUTER-GATE,OPENBIT /?CTR7
+ ZERO? TIME-STOPPED /?CCL8
+?CTR7: CALL2 DO-WALK,P?DOWN
+ RSTACK
+?CCL8: FSET HOLEY-SLAB,TOUCHBIT
+ SET 'COMPASS-CHANGED,TRUE-VALUE
+ PRINTR "Under the slab is a craggy hole, dripping with slime, leading downward. It looks just barely large enough to enter."
+
+
+ .FUNCT TRAP-DOOR-F
+ EQUAL? PRSA,V?OPEN \FALSE
+ FSET? TRAP-DOOR,OPENBIT /FALSE
+ EQUAL? HERE,CRYPT \FALSE
+ PRINTR "The trap door can't be opened from this side."
+
+
+ .FUNCT DUNGEON-HOLE-F
+ EQUAL? PRSA,V?LOOK-INSIDE \?CCL3
+ CALL2 LIT?,OUBLIETTE
+ ZERO? STACK /?CCL6
+ PRINT SOME-LIGHT
+ RTRUE
+?CCL6: PRINT ONLY-BLACKNESS
+ RTRUE
+?CCL3: EQUAL? PRSA,V?PUT \?CCL8
+ GETP PRSO,P?SIZE
+ GRTR? STACK,4 \?CCL11
+ EQUAL? PRSO,PERCH /?CCL13
+ CALL ULTIMATELY-IN?,PERCH,PRSO
+ ZERO? STACK /?CND12
+?CCL13: SET 'REMOVED-PERCH-LOC,OUBLIETTE
+?CND12: REMOVE PRSO
+ JUMP ?CND9
+?CCL11: MOVE PRSO,OUBLIETTE
+?CND9: PRINTR "Done."
+?CCL8: EQUAL? PRSA,V?EXAMINE \?CCL17
+ PRINTR "It's big enough to drop through, but a return trip doesn't look at all assured."
+?CCL17: EQUAL? PRSA,V?REACH-IN \?CCL19
+ PRINT NOTHING-IN-REACH
+ RTRUE
+?CCL19: EQUAL? PRSA,V?ENTER \FALSE
+ CALL2 DO-WALK,P?DOWN
+ RSTACK
+
+
+ .FUNCT OUBLIETTE-F,RARG
+ EQUAL? RARG,M-LOOK \?CCL3
+ PRINTI "You're trapped in a narrow prison cell accessible only from above. The upper portion of the cell is lost in gloom. The floor is muddy, and you sink almost to your "
+ ZERO? ALLIGATOR /?CCL6
+ PRINTI "alligatorish nostrils."
+ RTRUE
+?CCL6: PRINTI "knees."
+ RTRUE
+?CCL3: EQUAL? RARG,M-ENTER \?CCL8
+ ZERO? TIME-STOPPED \?CCL8
+ SET 'DO-J,TRUE-VALUE
+ CALL QUEUE,I-JESTER,3
+ RSTACK
+?CCL8: EQUAL? RARG,M-END \FALSE
+ IN? JESTER,HERE \FALSE
+ CALL2 SETUP-ORPHAN,STR?44
+ RSTACK
+
+ .SEGMENT "0"
+
+
+ .FUNCT G-HAT-F,TBL,LEN,?TMP1
+ ADD TBL,8 >?TMP1
+ GET TBL,1
+ INTBL? DOORBELL,?TMP1,STACK \?CCL3
+ RETURN DOORBELL
+?CCL3: EQUAL? PRSA,V?REMOVE,V?TAKE-OFF \?CCL5
+ FSET? HARDHAT,WORNBIT \?CCL8
+ FSET? SEAMANS-CAP,WORNBIT /FALSE
+?CCL8: FSET? HARDHAT,WORNBIT \?CCL12
+ RETURN HARDHAT
+?CCL12: FSET? SEAMANS-CAP,WORNBIT \FALSE
+ RETURN SEAMANS-CAP
+?CCL5: ADD TBL,8 >?TMP1
+ GET TBL,1
+ INTBL? J-HAT,?TMP1,STACK \FALSE
+ EQUAL? HERE,GAMING-ROOM \FALSE
+ RETURN J-HAT
+
+ .ENDSEG
+
+ .SEGMENT "SECRET"
+
+
+ .FUNCT CELL-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "This cell is the height of luxury for this dungeon -- the floor isn't covered with spikes, and there are actually a few corners which aren't dominated by giant spiders."
+ IN? COBWEBS,HERE \?CND4
+ PRINTC 32
+ PRINT CELL-WALL-DESC
+?CND4: PRINTI " The only exit is northwest."
+ RTRUE
+
+
+ .FUNCT GIANT-SPIDERS-F
+ CALL2 TOUCHING?,GIANT-SPIDERS
+ ZERO? STACK /FALSE
+ PRINTR "There's only one thing you need to remember in connection with giant spiders: You leave them alone, they'll leave you alone."
+
+
+ .FUNCT COBWEBS-F
+ EQUAL? PRSA,V?ENTER \?CCL3
+ PRINTR "Walk face first into a thick wall of yukko cobwebs? Mucho disgusto! Maybe if you cleared them away, first..."
+?CCL3: EQUAL? PRSA,V?CLEAN,V?TAKE-WITH,V?REMOVE /?CCL5
+ EQUAL? PRSA,V?MOVE \FALSE
+?CCL5: ZERO? PRSI \?CND8
+ CALL2 ULTIMATELY-IN?,BROOM
+ ZERO? STACK /?CND8
+ SET 'PRSI,BROOM
+?CND8: ZERO? PRSI \?CCL14
+ PRINTI "Yuk! Bleh! Ukky-poo! T"
+ FSET? GLOVE,WORNBIT /?CND15
+ PRINTI "hese cobwebs are way too gross to touch with your bare hands. Furthermore, t"
+?CND15: PRINTR "here are way too many to clean away without some kind of cleaning accessory."
+?CCL14: EQUAL? PRSI,BROOM /?CCL18
+ PRINTR "Don't bother to apply for any jobs as a maid."
+?CCL18: REMOVE COBWEBS
+ ICALL2 THIS-IS-IT,FLASK
+ MOVE FLASK,HERE
+ PRINTI "It's a dirty job, but someone's gotta do it. You clear away most of the cobwebs, revealing a blank wall. Sitting at the base of the wall is a "
+ PRINTD FLASK
+ PRINTC 33
+ CRLF
+ CALL2 INC-SCORE,12
+ RSTACK
+
+ .SEGMENT "0"
+
+
+ .FUNCT FLASK-F
+ EQUAL? PRSA,V?LOOK-INSIDE \?CCL3
+ PRINTR "You notice that objects behind the flask appear to be magnified."
+?CCL3: EQUAL? PRSA,V?EXAMINE \?CCL5
+ EQUAL? PRSI,FLASK \?CCL5
+ PRINTI "The flask distorts and magnifies the "
+ ICALL2 DPRINT,PRSO
+ PRINTI ", showing details not noticed earlier."
+ CRLF
+ PRINTI " "
+ RFALSE
+?CCL5: EQUAL? PRSA,V?DRINK-FROM \?CCL9
+ CALL DO-FIRST,STR?140,FLASK
+ RSTACK
+?CCL9: EQUAL? PRSA,V?THROW,V?MUNG,V?OPEN \FALSE
+ EQUAL? PRSA,V?OPEN /?CCL14
+ PRINTI "The flask breaks into pieces. "
+ JUMP ?CND12
+?CCL14: PRINTI "You remove the stopper. "
+?CND12: PRINTI "As you pass out, you realize that the vapors from the flask's contents are "
+ FSET? CLOWN-NOSE,WORNBIT \?CND15
+ PRINTI "potent enough to get past your clown nose, and are also quite "
+?CND15: CALL2 JIGS-UP,STR?365
+ RSTACK
+
+
+ .FUNCT LIQUID-F
+ EQUAL? PRSA,V?DRINK \FALSE
+ CALL DO-FIRST,STR?140,FLASK
+ RSTACK
+
+ .ENDSEG
+
+ .SEGMENT "SECRET"
+
+
+ .FUNCT TORTURE-CHAMBER-F,RARG
+ EQUAL? RARG,M-ENTER \?CCL3
+ ZERO? METRONOME-LOC \?CND4
+ RANDOM 100
+ LESS? 33,STACK /?CCL8
+ SET 'METRONOME-LOC,IRON-MAIDEN
+ JUMP ?CND4
+?CCL8: RANDOM 100
+ LESS? 50,STACK /?CCL10
+ SET 'METRONOME-LOC,SNAKE-PIT
+ JUMP ?CND4
+?CCL10: SET 'METRONOME-LOC,WATER-CHAMBER
+?CND4: SET 'METRONOME-COUNTER,0
+ RETURN METRONOME-COUNTER
+?CCL3: EQUAL? RARG,M-END \FALSE
+ FSET? METRONOME,TRYTAKEBIT \FALSE
+ CALL2 METRONOME-TORTURE,TRUE-VALUE
+ RSTACK
+
+
+ .FUNCT METRONOME-TORTURE,INDENT
+ INC 'METRONOME-COUNTER
+ EQUAL? METRONOME-COUNTER,1 /FALSE
+ ICALL1 RETURN-FROM-MAP
+ ZERO? INDENT /?CND3
+ PRINTI " "
+?CND3: EQUAL? METRONOME-COUNTER,2 \?CCL7
+ PRINTR "You hear a ticking sound."
+?CCL7: EQUAL? METRONOME-COUNTER,3 \?CCL9
+ PRINTR "The ticking grows louder."
+?CCL9: EQUAL? METRONOME-COUNTER,4 \?CCL11
+ PRINTR "The ticking is really getting to you. It seems to be controlling your heartbeat!"
+?CCL11: PRINTI "The ticking is unbearably deafening! You run screaming from the Torture Chamber!"
+ CRLF
+ CRLF
+ CALL2 GOTO,DUNGEON
+ RSTACK
+
+ .SEGMENT "0"
+
+
+ .FUNCT METRONOME-F
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ PRINTI "The metronome is"
+ ZERO? METRONOME-ON /?CCL6
+ PRINTR " ticking insistently."
+?CCL6: PRINTR "n't on."
+?CCL3: EQUAL? PRSA,V?ON \?CCL8
+ ZERO? METRONOME-ON /?CCL11
+ PRINTR "It is!"
+?CCL11: SET 'METRONOME-ON,TRUE-VALUE
+ ICALL QUEUE,I-METRONOME,-1
+ PRINTR "The metronome begins to tick."
+?CCL8: EQUAL? PRSA,V?OFF \FALSE
+ ZERO? METRONOME-ON /?CCL16
+ SET 'METRONOME-ON,FALSE-VALUE
+ ICALL2 DEQUEUE,I-METRONOME
+ PRINTR "The metronome stops ticking."
+?CCL16: PRINTR "It is!"
+
+
+ .FUNCT I-METRONOME,CALLED-BY-LISTEN,CNT
+ LOC METRONOME
+ EQUAL? STACK,FALSE-VALUE \?CND1
+ ICALL2 DEQUEUE,I-METRONOME
+?CND1: CALL2 VISIBLE?,METRONOME
+ ZERO? STACK /FALSE
+ EQUAL? CURRENT-SPLIT,MAP-TOP-LEFT-LOC /FALSE
+ RANDOM 30
+ ADD 3,STACK >CNT
+ ZERO? CALLED-BY-LISTEN \?CND8
+ PRINTI " "
+?CND8: PRINTI "The metronome insistently declares, ""Tick"
+?PRG10: PRINTI ", tick"
+ DEC 'CNT
+ ZERO? CNT \?PRG10
+ PRINTR "."""
+
+ .ENDSEG
+
+ .SEGMENT "SECRET"
+
+
+ .FUNCT TORTURE-DEVICE-F
+ EQUAL? PRSA,V?ENTER \?CCL3
+ EQUAL? PRSO,COMFY-CHAIR /?CND4
+ FSET? PRSO,OPENBIT /?CND4
+ ICALL DO-FIRST,STR?140,PRSO
+ RTRUE
+?CND4: PRINTI "You climb into the "
+ PRINTD PRSO
+ PRINTI ". "
+ EQUAL? PRSO,COMFY-CHAIR \?CCL10
+ CALL2 JIGS-UP,STR?367
+ RSTACK
+?CCL10: EQUAL? PRSO,IRON-MAIDEN \?CCL12
+ CALL2 JIGS-UP,STR?368
+ RSTACK
+?CCL12: EQUAL? PRSO,WATER-CHAMBER \?CCL14
+ CALL2 JIGS-UP,STR?369
+ RSTACK
+?CCL14: CALL2 JIGS-UP,STR?370
+ RSTACK
+?CCL3: EQUAL? PRSA,V?EXAMINE \?CCL16
+ EQUAL? PRSO,COMFY-CHAIR \?CCL19
+ PRINTR "It sure looks comfortable!"
+?CCL19: EQUAL? PRSO,WATER-CHAMBER \?CCL21
+ PRINTI "It's a small chamber where water is slowly dripped onto the victim's head until he or she goes mad."
+ JUMP ?CND17
+?CCL21: EQUAL? PRSO,IRON-MAIDEN \?CCL23
+ PRINTI "It's similar to a suit of armor, except that the inside is lined with sharp spikes."
+ JUMP ?CND17
+?CCL23: FSET? SNAKE-PIT,OPENBIT /?CCL26
+ PRINTI "Beneath the lid of the snake pit y"
+ JUMP ?CND24
+?CCL26: PRINTC 89
+?CND24: PRINTI "ou hear the hissing of a thousand hungry snakes."
+?CND17: PRINTI " The "
+ PRINTD PRSO
+ PRINTI " is "
+ ICALL2 OPEN-CLOSED,PRSO
+ PRINT PERIOD-CR
+ RTRUE
+?CCL16: EQUAL? PRSA,V?LOOK-INSIDE \?CCL28
+ FSET? METRONOME,TRYTAKEBIT \?CCL28
+ EQUAL? PRSO,METRONOME-LOC \?CCL33
+ ICALL PERFORM,V?OPEN,PRSO
+ RTRUE
+?CCL33: EQUAL? PRSO,COMFY-CHAIR \?CCL35
+ PRINTR "There's no one in the chair."
+?CCL35: FSET PRSO,OPENBIT
+ PRINTI "You open"
+ ICALL1 TPRINT-PRSO
+ PRINTR ", and find no one within."
+?CCL28: EQUAL? PRSA,V?OPEN \?CCL37
+ EQUAL? PRSO,METRONOME-LOC \?CCL37
+ FSET? METRONOME,TRYTAKEBIT \?CCL37
+ FCLEAR METRONOME,TRYTAKEBIT
+ MOVE METRONOME,HERE
+ FSET PRSO,OPENBIT
+ PRINTI "As you open the "
+ PRINTD PRSO
+ PRINTI ", a metronome falls from the shadowy recesses of the ceiling and lands with a muffled thud in the center of the room."
+ GRTR? METRONOME-COUNTER,1 \?CND41
+ PRINTI " Thankfully, the fall seems to have shut it off."
+?CND41: CRLF
+ CALL2 INC-SCORE,12
+ RSTACK
+?CCL37: EQUAL? PRSA,V?OPEN \FALSE
+ ZERO? TIME-STOPPED /FALSE
+ PRINT WONT-BUDGE
+ RTRUE
+
+ .ENDSEG
+
+ .SEGMENT "CASTLE"
+
+
+ .FUNCT WEST-HALL-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "The castle's newest wing can be found beyond the huge oak door which lies "
+ ICALL2 OPEN-CLOSED,WEST-DOOR
+ PRINTI " to the west. The only other exit is northeast."
+ RTRUE
+
+
+ .FUNCT WEST-DOOR-F
+ EQUAL? PRSA,V?UNLOCK \?CCL3
+ FSET? WEST-DOOR,LOCKEDBIT \?CCL3
+ EQUAL? PRSI,WEST-KEY \?CCL3
+ FCLEAR WEST-DOOR,LOCKEDBIT
+ CALL LOCKED-UNLOCKED,WEST-DOOR,TRUE-VALUE
+ RSTACK
+?CCL3: EQUAL? PRSA,V?LOCK \FALSE
+ FSET? WEST-DOOR,LOCKEDBIT /FALSE
+ EQUAL? PRSI,WEST-KEY \FALSE
+ FSET WEST-DOOR,LOCKEDBIT
+ CALL2 LOCKED-UNLOCKED,WEST-DOOR
+ RSTACK
+
+
+ .FUNCT WEST-WING-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "This wing exhibits more recent styling: smoothly dressed stone inlaid with marble patterns. Through the "
+ ICALL2 OPEN-CLOSED,WEST-DOOR
+ PRINTI " oak door to the east lie the primary halls of the castle. Other exits lead north, west, and south. "
+ PRINT FUDGE
+ RTRUE
+
+
+ .FUNCT DIRIGIBLE-HANGAR-ENTER-F,RARG
+ ZERO? NUT-EATEN /?CCL3
+ RETURN DIRIGIBLE-HANGAR
+?CCL3: ZERO? RARG \FALSE
+ IN? JESTER,HERE /?CCL7
+ ICALL1 RETURN-FROM-MAP
+ PRINTI "An invisible hand seems to stop you"
+ SUB MOVES,J-DISPOSED
+ LESS? STACK,4 \?CCL10
+ PRINTI ", and a familiar voice says, ""Surely you didn't think you'd be rid of me so easily!"""
+ CRLF
+ JUMP ?CND8
+?CCL10: PRINT PERIOD-CR
+?CND8: SET 'DO-J,TRUE-VALUE
+ ICALL1 I-JESTER
+ RFALSE
+?CCL7: ICALL1 RETURN-FROM-MAP
+ PRINT ERE-YOU-PASS
+ RFALSE
+
+
+ .FUNCT PEG-ROOM-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "You're in a nondescript room with an exit to the south. "
+ ZERO? PEG-PASSAGE-OPENED /?CND4
+ PRINTI "A previously hidden passage leads north. "
+?CND4: PRINTI "In the center of the room is a pegboard. Hanging on the wall are a set of instructions."
+ RTRUE
+
+
+ .FUNCT PBOZ-OBJECT-F
+ EQUAL? PRSA,V?PLAY \FALSE
+ EQUAL? HERE,PEG-ROOM \?CCL6
+ ICALL1 PEG-GAME
+ RTRUE
+?CCL6: PRINT YOU-CANT
+ PRINTR "play Peggleboz without a pegboard!"
+
+
+ .FUNCT PEGBOARD-F
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ PRINTR "The board has 21 holes, 20 of them filled with pegs. The holes are arranged in a roughly triangular shape."
+?CCL3: EQUAL? PRSA,V?TAKE \FALSE
+ PRINTR "The pegboard is an unmovable feature of the room."
+
+
+ .FUNCT PEGBOARD-PEGS-F
+ EQUAL? PRSA,V?TAKE,V?MOVE \FALSE
+ PRINTR "It would behoove you to read the instructions that are posted on the wall here."
+
+
+ .FUNCT PEG-GAME,FIRST-MOVE,PEG-SELECTED,CHAR,JUMPED-PEG,DONT-CLEAR,WON,CNT,?TMP2,?TMP1
+ SET 'FIRST-MOVE,TRUE-VALUE
+ CLEAR S-FULL
+ ICALL SPLIT-BY-PICTURE,PBOZ-SPLIT,TRUE-VALUE
+ ICALL2 ADJUST-TEXT-WINDOW,PBOZ-BOTTOM
+ ICALL1 SETUP-PBOZ
+?PRG1: ZERO? WON \?CND3
+ ZERO? PEG-SELECTED /?CCL7
+ ZERO? DONT-CLEAR \?CCL10
+ CLEAR S-TEXT
+ JUMP ?CND8
+?CCL10: SET 'DONT-CLEAR,FALSE-VALUE
+?CND8: PRINTI "You are moving the peg at letter "
+ HLIGHT H-BOLD
+ ADD LETTER-OFFSET,PEG-SELECTED
+ PRINTC STACK
+ HLIGHT H-NORMAL
+ PRINTI ". Select the letter for the destination point of that peg, or hit "
+ HLIGHT H-BOLD
+ ADD LETTER-OFFSET,PEG-SELECTED
+ PRINTC STACK
+ HLIGHT H-NORMAL
+ PRINTI " again to ""unselect"" that peg."
+ JUMP ?CND3
+?CCL7: ZERO? FIRST-MOVE \?CND11
+ ZERO? DONT-CLEAR \?CND11
+ CLEAR S-TEXT
+?CND11: ZERO? DONT-CLEAR \?CND3
+ CALL1 PEG-COUNT
+ EQUAL? STACK,1 \?CCL19
+ PRINTI "Type X to exit, Y to display your moves, and Z to start again"
+ ZERO? ACTIVE-MOUSE /?CND20
+ PRINTI " (or simply click on the appropriate spot with your mouse)"
+?CND20: PRINTC 46
+ JUMP ?CND3
+?CCL19: PRINTI "Type the letter corresponding to the peg you'd like to move"
+ ZERO? ACTIVE-MOUSE /?CND22
+ PRINTI ", or use your mouse to click on it"
+?CND22: PRINTC 46
+ ZERO? FIRST-MOVE /?CND3
+ SET 'FIRST-MOVE,FALSE-VALUE
+ PRINTI " Type X to exit Peggleboz, Y to display your moves so far, Z to reset the board"
+ ZERO? ACTIVE-MOUSE /?CND26
+ PRINTI " (or you can use your mouse to click on the appropriate spot)"
+?CND26: PRINTC 46
+?CND3: SET 'DONT-CLEAR,FALSE-VALUE
+ ZERO? PEG-SELECTED /?CCL30
+ MUL PEG-SELECTED,2
+ GET BOARD-TABLE,STACK >?TMP1
+ MUL PEG-SELECTED,2
+ ADD STACK,1
+ GET BOARD-TABLE,STACK
+ CALL BLINK,UNHL-PEG,HL-PEG,?TMP1,STACK,S-WINDOW >CHAR
+ JUMP ?CND28
+?CCL30: ZERO? DEMO-VERSION? /?CCL33
+ CALL2 INPUT-DEMO,1 >CHAR
+ JUMP ?CND28
+?CCL33: INPUT 1 >CHAR
+?CND28: ICALL1 MOUSE-INPUT?
+ EQUAL? CHAR,CLICK1,CLICK2 \?CND34
+ CALL1 PBOZ-CLICK >CHAR
+?CND34: GRTR? CHAR,96 \?CND36
+ LESS? CHAR,123 \?CND36
+ SUB CHAR,32 >CHAR
+?CND36: EQUAL? CHAR,88 \?CCL42
+ ICALL1 RESET-PEGBOARD
+ ICALL2 INIT-SL-WITH-SPLIT,TEXT-WINDOW-PIC-LOC
+ CLEAR S-TEXT
+ RTRUE
+?CCL42: EQUAL? CHAR,89 \?CCL44
+ SET 'DONT-CLEAR,TRUE-VALUE
+ ICALL1 DISPLAY-MOVES
+ JUMP ?PRG1
+?CCL44: EQUAL? CHAR,90 \?CCL46
+ ICALL1 RESET-PEGBOARD
+ SET 'WON,FALSE-VALUE
+ SET 'CNT,4
+ SCREEN S-WINDOW
+ ICALL1 DRAW-PEGS
+ SCREEN S-TEXT
+ CLEAR S-TEXT
+ SET 'PEG-SELECTED,FALSE-VALUE
+ JUMP ?PRG1
+?CCL46: ZERO? PEG-SELECTED \?CCL48
+ SUB CHAR,64 >PEG-SELECTED
+ GRTR? PEG-SELECTED,21 /?CTR50
+ LESS? PEG-SELECTED,1 \?CCL51
+?CTR50: CLEAR S-TEXT
+ SOUND 1
+ SET 'PEG-SELECTED,FALSE-VALUE
+ SET 'DONT-CLEAR,TRUE-VALUE
+ PRINTI "Illegal choice. Type a letter from A thru U to select a peg. Or, type X to exit, Y to display your moves, or Z to reset the board."
+ JUMP ?PRG1
+?CCL51: GET PEG-TABLE,PEG-SELECTED
+ ZERO? STACK \?PRG1
+ CLEAR S-TEXT
+ SOUND 1
+ SET 'DONT-CLEAR,TRUE-VALUE
+ PRINTI "There's no peg at point "
+ ADD LETTER-OFFSET,PEG-SELECTED
+ PRINTC STACK
+ PRINTC 46
+ SET 'PEG-SELECTED,FALSE-VALUE
+ JUMP ?PRG1
+?CCL48: SUB CHAR,64
+ EQUAL? PEG-SELECTED,STACK \?CCL56
+ SET 'DONT-CLEAR,TRUE-VALUE
+ SET 'PEG-SELECTED,FALSE-VALUE
+ CLEAR S-TEXT
+ PRINTI "Unselected."
+ JUMP ?PRG1
+?CCL56: CALL LEGAL-MOVE,PEG-SELECTED,CHAR >JUMPED-PEG
+ ZERO? JUMPED-PEG /?CCL58
+ PUT PEG-MOVE-TABLE,PEG-MOVE-NUMBER,PEG-SELECTED
+ ADD PEG-MOVE-NUMBER,1 >?TMP1
+ SUB CHAR,64
+ PUT PEG-MOVE-TABLE,?TMP1,STACK
+ ADD PEG-MOVE-NUMBER,2 >PEG-MOVE-NUMBER
+ PUT PEG-TABLE,JUMPED-PEG,0
+ PUT PEG-TABLE,PEG-SELECTED,0
+ SUB CHAR,64
+ PUT PEG-TABLE,STACK,1
+ SCREEN S-WINDOW
+ GET PEG-BG-PIC-TBL,PEG-SELECTED >?TMP2
+ MUL PEG-SELECTED,2
+ GET BOARD-TABLE,STACK >?TMP1
+ MUL PEG-SELECTED,2
+ ADD STACK,1
+ GET BOARD-TABLE,STACK
+ DISPLAY ?TMP2,?TMP1,STACK
+ GET PEG-BG-PIC-TBL,JUMPED-PEG >?TMP2
+ MUL JUMPED-PEG,2
+ GET BOARD-TABLE,STACK >?TMP1
+ MUL JUMPED-PEG,2
+ ADD STACK,1
+ GET BOARD-TABLE,STACK
+ DISPLAY ?TMP2,?TMP1,STACK
+ SUB CHAR,64
+ MUL STACK,2
+ GET BOARD-TABLE,STACK >?TMP1
+ SUB CHAR,64
+ MUL STACK,2
+ ADD STACK,1
+ GET BOARD-TABLE,STACK
+ DISPLAY UNHL-PEG,?TMP1,STACK
+ EQUAL? PEG-MOVE-NUMBER,2 \?CND59
+ ZERO? ACTIVE-MOUSE /?CND59
+ ICALL2 PICINF-PLUS-ONE,PBOZ-RESTART-BOX-LOC
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY RESTART-BOX,?TMP1,STACK
+ ICALL2 PICINF-PLUS-ONE,PBOZ-SHOW-MOVES-BOX-LOC
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY SHOW-MOVES-BOX,?TMP1,STACK
+?CND59: SET 'PEG-SELECTED,FALSE-VALUE
+ SCREEN S-TEXT
+ CLEAR S-TEXT
+ CALL1 PBOZ-WIN-CHECK
+ ZERO? STACK /?PRG1
+ SET 'WON,TRUE-VALUE
+ SET 'PEG-PASSAGE-OPENED,TRUE-VALUE
+ SOUND 1
+ SOUND 1
+ SOUND 1
+ PRINTI "A secret doorway to the north slides open. (Hit X to exit)."
+ CRLF
+ ICALL2 INC-SCORE,16
+ JUMP ?PRG1
+?CCL58: SET 'DONT-CLEAR,TRUE-VALUE
+ JUMP ?PRG1
+
+
+ .FUNCT PBOZ-CLICK,TL-X,TL-Y,BR-X,BR-Y,CNT,PEG-WIDTH,PEG-HEIGHT,EXPAND-X,EXPAND-Y
+ SET 'CNT,2
+ ICALL2 PICINF-PLUS-ONE,PBOZ-RESTART-BOX-LOC
+ GET PICINF-TBL,1 >TL-X
+ GET PICINF-TBL,0 >TL-Y
+ PICINF RESTART-BOX,PICINF-TBL /?BOGUS1
+?BOGUS1: GET PICINF-TBL,1
+ ADD TL-X,STACK >BR-X
+ GET PICINF-TBL,0
+ ADD TL-Y,STACK >BR-Y
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK /?CND2
+ RETURN 90
+?CND2: ICALL2 PICINF-PLUS-ONE,PBOZ-SHOW-MOVES-BOX-LOC
+ GET PICINF-TBL,1 >TL-X
+ GET PICINF-TBL,0 >TL-Y
+ PICINF SHOW-MOVES-BOX,PICINF-TBL /?BOGUS4
+?BOGUS4: GET PICINF-TBL,1
+ ADD TL-X,STACK >BR-X
+ GET PICINF-TBL,0
+ ADD TL-Y,STACK >BR-Y
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK /?CND5
+ RETURN 89
+?CND5: ICALL2 PICINF-PLUS-ONE,PBOZ-EXIT-BOX-LOC
+ GET PICINF-TBL,1 >TL-X
+ GET PICINF-TBL,0 >TL-Y
+ PICINF EXIT-BOX,PICINF-TBL /?BOGUS7
+?BOGUS7: GET PICINF-TBL,1
+ ADD TL-X,STACK >BR-X
+ GET PICINF-TBL,0
+ ADD TL-Y,STACK >BR-Y
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK /?CND8
+ RETURN 88
+?CND8: PICINF EXPAND-HOT-SPOT,PICINF-TBL /?BOGUS10
+?BOGUS10: GET PICINF-TBL,0 >EXPAND-Y
+ GET PICINF-TBL,1 >EXPAND-X
+ PICINF UNHL-PEG,PICINF-TBL /?BOGUS11
+?BOGUS11: GET PICINF-TBL,0 >PEG-HEIGHT
+ GET PICINF-TBL,1 >PEG-WIDTH
+?PRG12: GET BOARD-TABLE,CNT >TL-Y
+ ADD CNT,1
+ GET BOARD-TABLE,STACK >TL-X
+ ADD TL-Y,PEG-HEIGHT >BR-Y
+ ADD TL-X,PEG-WIDTH >BR-X
+ SUB TL-X,EXPAND-X >TL-X
+ ADD BR-X,EXPAND-X >BR-X
+ ADD BR-Y,EXPAND-Y >BR-Y
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK \?REP13
+ ADD CNT,2 >CNT
+ GRTR? CNT,43 \?PRG12
+ SOUND 1
+?REP13: GRTR? CNT,43 \?CCL20
+ RETURN CLICK1
+?CCL20: DIV CNT,2
+ ADD STACK,64
+ RSTACK
+
+
+ .FUNCT SETUP-PBOZ,I,TT,?TMP1
+ SET 'I,2
+ FSET PBOZ-OBJECT,TOUCHBIT
+ SET 'TT,PBOZ-PIC-TABLE
+?PRG1: GET TT,0
+ ICALL2 PICINF-PLUS-ONE,STACK
+ GET PICINF-TBL,0
+ PUT BOARD-TABLE,I,STACK
+ ADD I,1 >?TMP1
+ GET PICINF-TBL,1
+ PUT BOARD-TABLE,?TMP1,STACK
+ ADD I,2 >I
+ GRTR? I,43 /?REP2
+ ADD TT,2 >TT
+ JUMP ?PRG1
+?REP2: SCREEN S-FULL
+ DISPLAY PBOZ-BORDER,1,1
+ SCREEN S-WINDOW
+ PICSET PBOZ-PICSET-TBL
+ ICALL1 DRAW-PEGS
+ ZERO? ACTIVE-MOUSE /?CND5
+ ICALL2 PICINF-PLUS-ONE,PBOZ-RESTART-BOX-LOC
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY DIM-RESTART-BOX,?TMP1,STACK
+ ICALL2 PICINF-PLUS-ONE,PBOZ-SHOW-MOVES-BOX-LOC
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY DIM-SHOW-MOVES-BOX,?TMP1,STACK
+ ICALL2 PICINF-PLUS-ONE,PBOZ-EXIT-BOX-LOC
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY EXIT-BOX,?TMP1,STACK
+?CND5: SCREEN S-TEXT
+ RTRUE
+
+
+ .FUNCT DRAW-PEGS,NUM,?TMP2,?TMP1
+ SET 'NUM,1
+?PRG1: GET PEG-TABLE,NUM
+ EQUAL? STACK,1 \?CCL5
+ MUL NUM,2
+ GET BOARD-TABLE,STACK >?TMP1
+ MUL NUM,2
+ ADD STACK,1
+ GET BOARD-TABLE,STACK
+ DISPLAY UNHL-PEG,?TMP1,STACK
+ JUMP ?CND3
+?CCL5: GET PEG-BG-PIC-TBL,NUM >?TMP2
+ MUL NUM,2
+ GET BOARD-TABLE,STACK >?TMP1
+ MUL NUM,2
+ ADD STACK,1
+ GET BOARD-TABLE,STACK
+ DISPLAY ?TMP2,?TMP1,STACK
+?CND3: IGRTR? 'NUM,21 \?PRG1
+ RTRUE
+
+
+ .FUNCT RESET-PEGBOARD,CNT,?TMP1
+ ZERO? ACTIVE-MOUSE /?CND1
+ SCREEN S-WINDOW
+ ICALL2 PICINF-PLUS-ONE,PBOZ-RESTART-BOX-LOC
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY DIM-RESTART-BOX,?TMP1,STACK
+ ICALL2 PICINF-PLUS-ONE,PBOZ-SHOW-MOVES-BOX-LOC
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY DIM-SHOW-MOVES-BOX,?TMP1,STACK
+ SCREEN S-TEXT
+?CND1: SET 'PEG-MOVE-NUMBER,0
+ PUT PEG-TABLE,1,1
+ ADD PEG-TABLE,2 >?TMP1
+ ADD PEG-TABLE,4
+ COPYT ?TMP1,STACK,-40
+ PUT PEG-TABLE,7,0
+ COPYT PEG-MOVE-TABLE,0,80
+ RTRUE
+
+
+ .FUNCT LEGAL-MOVE,SELECTED-PEG,CHAR,TBL,TBL-SPOT,JUMPED-PEG
+ SUB CHAR,64 >CHAR
+ GET LEGAL-MOVE-TABLE,SELECTED-PEG >TBL
+ GET TBL,0
+ EQUAL? STACK,CHAR \?CCL3
+ SET 'TBL-SPOT,0
+ JUMP ?CND1
+?CCL3: GET TBL,2
+ EQUAL? STACK,CHAR \?CCL5
+ SET 'TBL-SPOT,2
+ JUMP ?CND1
+?CCL5: GET TBL,4
+ EQUAL? STACK,CHAR \?CCL7
+ SET 'TBL-SPOT,4
+ JUMP ?CND1
+?CCL7: GET TBL,6
+ EQUAL? STACK,CHAR \?CCL9
+ SET 'TBL-SPOT,6
+?CND1: ADD TBL-SPOT,1
+ GET TBL,STACK >JUMPED-PEG
+ GET PEG-TABLE,CHAR
+ EQUAL? STACK,1 \?CCL12
+ CLEAR S-TEXT
+ SOUND 1
+ PRINTI "Illegal move. There's already a peg at spot "
+ ADD LETTER-OFFSET,CHAR
+ PRINTC STACK
+ PRINTC 46
+ RFALSE
+?CCL9: CLEAR S-TEXT
+ SOUND 1
+ PRINTI "Illegal move. You can jump a peg only to a spot which is two spots away."
+ RFALSE
+?CCL12: GET PEG-TABLE,JUMPED-PEG
+ ZERO? STACK /?CCL13
+ RETURN JUMPED-PEG
+?CCL13: CLEAR S-TEXT
+ SOUND 1
+ PRINTI "Illegal move. There's no peg at spot "
+ ADD LETTER-OFFSET,JUMPED-PEG
+ PRINTC STACK
+ PRINTI " to jump."
+ RFALSE
+
+
+ .FUNCT PBOZ-WIN-CHECK,CNT,PEG-NUM
+ SET 'CNT,1
+ ZERO? PEG-PASSAGE-OPENED \FALSE
+?PRG3: EQUAL? CNT,22 /?REP4
+ GET PEG-TABLE,CNT
+ EQUAL? STACK,1 \?CND7
+ INC 'PEG-NUM
+?CND7: INC 'CNT
+ JUMP ?PRG3
+?REP4: EQUAL? PEG-NUM,1 \FALSE
+ GET PEG-TABLE,7
+ EQUAL? STACK,1 /TRUE
+ RFALSE
+
+
+ .FUNCT PEG-COUNT,CNT,PEG-NUM
+ SET 'CNT,1
+?PRG1: EQUAL? CNT,22 /?REP2
+ GET PEG-TABLE,CNT
+ EQUAL? STACK,1 \?CND5
+ INC 'PEG-NUM
+?CND5: INC 'CNT
+ JUMP ?PRG1
+?REP2: RETURN PEG-NUM
+
+
+ .FUNCT DISPLAY-MOVES,X,Y,CNT
+ CLEAR S-TEXT
+ ZERO? PEG-MOVE-NUMBER \?CND1
+ PRINTI "You haven't moved yet!"
+ RTRUE
+?CND1: FONT 4
+?PRG3: MOD CNT,10
+ DIV STACK,2
+ ADD STACK,1 >Y
+ DIV CNT,10
+ MUL STACK,12
+ ADD STACK,1 >X
+ ICALL CCURSET,Y,X
+ DIV CNT,2
+ ADD STACK,1
+ PRINTN STACK
+ PRINTI ") "
+ GET PEG-MOVE-TABLE,CNT
+ ADD LETTER-OFFSET,STACK
+ PRINTC STACK
+ PRINTI " -> "
+ ADD CNT,1
+ GET PEG-MOVE-TABLE,STACK
+ ADD LETTER-OFFSET,STACK
+ PRINTC STACK
+ SUB PEG-MOVE-NUMBER,2
+ EQUAL? CNT,STACK /?REP4
+ ADD CNT,2 >CNT
+ JUMP ?PRG3
+?REP4: FONT 1
+ RSTACK
+
+
+ .FUNCT GAMING-ROOM-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ FSET? ZORKMID-BILL,TOUCHBIT /FALSE
+ SET 'DO-J,TRUE-VALUE
+ CALL QUEUE,I-JESTER,1
+ RSTACK
+
+
+ .FUNCT CARPET-F
+ EQUAL? PRSA,V?RAISE,V?LOOK-UNDER,V?MOVE /?CCL3
+ EQUAL? PRSA,V?ROLL \FALSE
+?CCL3: PRINTR "The carpet is quite well attached to the floor."
+
+ .SEGMENT "0"
+
+
+ .FUNCT DUMBELL-F
+ EQUAL? PRSA,V?RAISE \?CCL3
+ PRINTR "You can barely get them off the ground, let alone press them."
+?CCL3: EQUAL? PRSA,V?PUSH-DIR \?CCL5
+ ICALL PERFORM,V?ROLL-DIR,PRSO,PRSI
+ RTRUE
+?CCL5: EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTR "It's a set of 100-ugh weights, small enough to hold in one hand (but unless you a pretty awesome athleter, not nearly light enough to hold in one hand)."
+
+ .ENDSEG
+
+ .SEGMENT "CASTLE"
+
+
+ .FUNCT EAST-HALL-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "The castle's east wing lies through a massive door to the east, which is "
+ ICALL2 OPEN-CLOSED,EAST-DOOR
+ PRINTI ". The only other exit from the hall is northwest."
+ RTRUE
+
+
+ .FUNCT EAST-DOOR-F
+ EQUAL? PRSA,V?UNLOCK \?CCL3
+ FSET? EAST-DOOR,LOCKEDBIT \?CCL3
+ EQUAL? PRSI,EAST-KEY \?CCL3
+ FCLEAR EAST-DOOR,LOCKEDBIT
+ CALL LOCKED-UNLOCKED,EAST-DOOR,TRUE-VALUE
+ RSTACK
+?CCL3: EQUAL? PRSA,V?LOCK \FALSE
+ FSET? EAST-DOOR,LOCKEDBIT /FALSE
+ EQUAL? PRSI,EAST-KEY \FALSE
+ FSET EAST-DOOR,LOCKEDBIT
+ CALL2 LOCKED-UNLOCKED,EAST-DOOR
+ RSTACK
+
+ .SEGMENT "0"
+
+
+ .FUNCT WAND-F
+ EQUAL? PRSA,V?READ,V?EXAMINE \?CCL3
+ PRINTR "The name ""Fisha"" is engraved on the wand in tiny script, followed by the phrase ""16 minute model."""
+?CCL3: EQUAL? PRSA,V?POINT \FALSE
+ EQUAL? PRSO,WAND \FALSE
+ MOVE WAND,PROTAGONIST
+ EQUAL? PRSI,WAND \?CCL10
+ PRINTR "Point the wand at itself!?! It isn't made of rubber!"
+?CCL10: ZERO? TIME-STOPPED /?CCL12
+ PRINTR "The wand's magic seems as frozen as time itself."
+?CCL12: ZERO? WAND-LIFE \?CND8
+ PRINTR "Nothing. The wand seems to be used up."
+?CND8: DEC 'WAND-LIFE
+ GETP PRSI,P?INANIMATE-DESC
+ ZERO? STACK /?CCL16
+ FSET? PRSI,ANIMATEDBIT \?CCL16
+ EQUAL? PRSI,FOX \?CND19
+ FSET PRSI,WEARBIT
+?CND19: GETP PRSI,P?ANIMATE-ROUTINE
+ ICALL QUEUE,STACK,17
+ FCLEAR PRSI,ANIMATEDBIT
+ FCLEAR PRSI,ACTORBIT
+ FSET PRSI,TOUCHBIT
+ ICALL2 THIS-IS-IT,PRSI
+ GETP PRSI,P?WAND-TEXT
+ PRINT STACK
+ CRLF
+ RTRUE
+?CCL16: FSET? PRSI,BLACKBIT /?CTR21
+ FSET? PRSI,WHITEBIT \?CCL22
+?CTR21: PRINTI "The "
+ ICALL2 DPRINT,PRSO
+ PRINTR " seems to grow sluggish for a moment, but there is no other effect."
+?CCL22: EQUAL? PRSA,V?POINT \?CCL26
+ EQUAL? PRSI,JESTER \?CCL26
+ PRINTI "The jester's expression turns stony. In fact, the jester himself turns stony, as he becomes a statue! After a moment, hairline cracks begin forming across the statue. The cracks widen and multiply, and the entire statue collapses into a cloud of dust! You hear an echo of laughter as the dust disperses."
+ IN? SHELL-TABLE,HERE \?CND29
+ PRINTI " The table and shells disappear as well."
+?CND29: CRLF
+ ICALL1 REMOVE-J
+ SET 'J-DISPOSED,MOVES
+ RTRUE
+?CCL26: EQUAL? PRSI,BEDBUG \?CCL32
+ REMOVE BEDBUG
+ PRINTR "The bedbug freezes, becoming a small armored tank. You are surrounded by raucous laughter from an invisible source, and the bedbug/tank disappears!"
+?CCL32: EQUAL? PRSI,EVEN-LARGER-FLY,LARGER-FLY,LARGE-FLY /?CTR33
+ EQUAL? PRSI,LARGEST-FLY \?CCL34
+?CTR33: PRINTR "Zap! A bolt of magic just misses the fly. Oh, well. It seems that even though it's large for a fly, it's small for a magic wand target."
+?CCL34: EQUAL? PRSI,OTTO \?CCL38
+ REMOVE OTTO
+ ICALL QUEUE,I-STONE-TO-OTTO,17
+ PRINTI "Otto "
+ FSET? SPYGLASS,TRYTAKEBIT \?CND39
+ IN? SPYGLASS,OTTO /?CND39
+ MOVE SPYGLASS,OTTO
+ PRINTI "grabs the spyglass just before he "
+?CND39: PRINTR "transforms into a massive stone toad, just like the ones that flank the Flatheadia Courthouse. His weight is now too much for even the largest of lily pads to bear, and he sinks into the swamp with a sickening slurp."
+?CCL38: EQUAL? PRSI,BROGMOID \?CCL44
+ PRINTR "A few of the brogmoid's cells may have frozen; if the wand were twenty bloits long, it might have a chance of affecting this enormous brogmoid."
+?CCL44: EQUAL? PRSI,PRICKLY-WITCH,SICKLY-WITCH \?CCL46
+ PRINTR "A magical shield springs up around the witch. ""Your weak powers are useless against us, simple adventurer!"" cackles the crone."
+?CCL46: FSET? PRSI,PLANTBIT \?CCL48
+ PRINTI "No effect;"
+ ICALL1 TPRINT-PRSI
+ PRINTR " wasn't all that animate to begin with."
+?CCL48: EQUAL? PRSI,UNICORNS \?CCL50
+ CALL2 JIGS-UP,STR?381
+ RSTACK
+?CCL50: EQUAL? PRSI,THOUSANDS-OF-SNAKES \?CCL52
+ PRINTR "One of the snakes stops moving, but is instantly swallowed up by the writhing mass."
+?CCL52: EQUAL? PRSI,ME \?CCL54
+ CALL2 JIGS-UP,STR?382
+ RSTACK
+?CCL54: EQUAL? PRSI,EXECUTIONER \?CCL56
+ CALL2 JIGS-UP,STR?383
+ RSTACK
+?CCL56: PRINTI "You feel a crackle of magical energy, but there doesn't seem to be any effect on"
+ CALL2 TRPRINT,PRSI
+ RSTACK
+
+ .ENDSEG
+
+ .SEGMENT "LOWER"
+
+
+ .FUNCT G-BOOTH-F,TBL,LEN
+ IN? PROTAGONIST,LEFT-BOOTH \?CCL3
+ RETURN LEFT-BOOTH
+?CCL3: IN? PROTAGONIST,RIGHT-BOOTH \FALSE
+ RETURN RIGHT-BOOTH
+
+
+ .FUNCT BOOTH-F,VARG
+ ZERO? VARG /?CCL3
+ EQUAL? VARG,M-ENTER \FALSE
+?CCL3: ZERO? VARG /?CCL7
+ FSET? PRSO,TOUCHBIT /FALSE
+ PRINTC 32
+ ICALL PERFORM,V?EXAMINE,PRSO
+ RTRUE
+?CCL7: EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTR "The only feature of the booth is an ominous black button."
+
+
+ .FUNCT G-BUTTON-F,TBL,LEN
+ IN? PROTAGONIST,RIGHT-BOOTH \?CCL3
+ RETURN RIGHT-BOOTH-BUTTON
+?CCL3: IN? PROTAGONIST,LEFT-BOOTH \?CCL5
+ RETURN LEFT-BOOTH-BUTTON
+?CCL5: RETURN NOT-HERE-OBJECT
+
+
+ .FUNCT BOOTH-BUTTON-F,OTHER-BOOTH,THE-FLY
+ EQUAL? PRSA,V?PUSH \FALSE
+ ZERO? ALLIGATOR /?CND4
+ PRINTR "Impossible, in your current state."
+?CND4: REMOVE LEFT-BOOTH-BUTTON
+ REMOVE RIGHT-BOOTH-BUTTON
+ IN? PROTAGONIST,RIGHT-BOOTH \?CCL8
+ SET 'OTHER-BOOTH,LEFT-BOOTH
+ JUMP ?CND6
+?CCL8: SET 'OTHER-BOOTH,RIGHT-BOOTH
+?CND6: FIRST? OTHER-BOOTH >THE-FLY /?BOGUS9
+?BOGUS9: ZERO? THE-FLY /?CTR11
+ NEXT? THE-FLY \?CCL12
+?CTR11: PRINT NOTHING-HAPPENS
+ JUMP ?CND10
+?CCL12: ICALL QUEUE,I-UNTURN,5
+ SET 'TURNED-INTO,THE-FLY
+ ICALL2 DEQUEUE,I-UNALLIGATOR
+ PRINTI "You turn into"
+ ICALL2 APRINT,THE-FLY
+ EQUAL? THE-FLY,WORM \?CCL17
+ CALL2 VISIBLE?,ROOSTER
+ ZERO? STACK /?CCL17
+ FSET? ROOSTER,ANIMATEDBIT \?CCL17
+ ICALL2 JIGS-UP,STR?390
+ JUMP ?CND15
+?CCL17: EQUAL? THE-FLY,ROOSTER \?CCL22
+ CALL2 VISIBLE?,FOX
+ ZERO? STACK /?CCL22
+ FSET? FOX,ANIMATEDBIT \?CCL22
+ ICALL2 JIGS-UP,STR?391
+ JUMP ?CND15
+?CCL22: FIRST? PROTAGONIST \?CCL27
+ PRINTI ", dropping your possessions."
+ LOC PROTAGONIST
+ ICALL ROB,PROTAGONIST,STACK
+ JUMP ?CND15
+?CCL27: PRINTC 46
+?CND15: CRLF
+?CND10: MOVE LEFT-BOOTH-BUTTON,LEFT-BOOTH
+ MOVE RIGHT-BOOTH-BUTTON,RIGHT-BOOTH
+ RTRUE
+
+
+ .FUNCT I-UNTURN
+ ICALL1 RETURN-FROM-MAP
+ PRINTI " Waves of relief. You're no longer"
+ ICALL2 ARPRINT,TURNED-INTO
+ SET 'TURNED-INTO,FALSE-VALUE
+ RTRUE
+
+
+ .FUNCT TO-SPEAK-OF,STRING
+ PRINTI "Ummm..."
+ ICALL2 APRINT,TURNED-INTO
+ PRINTI " has no "
+ PRINT STRING
+ PRINTR " to speak of."
+
+
+ .FUNCT GOOD-MEAL,OBJ
+ REMOVE OBJ
+ PRINTI "Yum!"
+ GRTR? HUNGER-COUNT,0 \?CCL3
+ PRINTI " Your hunger fades."
+ CRLF
+ ICALL2 DEQUEUE,I-HUNGER
+ SET 'HUNGER-COUNT,0
+ CALL2 INC-SCORE,20
+ RSTACK
+?CCL3: CRLF
+ RTRUE
+
+ .SEGMENT "0"
+
+
+ .FUNCT TOBOGGAN-F,VARG
+ ZERO? VARG \FALSE
+ EQUAL? PRSA,V?EXAMINE \?CCL5
+ CALL NOUN-USED?,TOBOGGAN,W?INSCRIPTION
+ ZERO? STACK /?CCL8
+ ICALL PERFORM,V?READ,TOBOGGAN
+ RTRUE
+?CCL8: PRINTI "This one-person sled bears a small inscription. "
+ RFALSE
+?CCL5: EQUAL? PRSA,V?ENTER \FALSE
+ EQUAL? HERE,GLACIER \FALSE
+ MOVE TOBOGGAN,MIRROR-LAKE
+ ZERO? ENCHANTED-ORB \?CND13
+ RANDOM 100
+ LESS? 25,STACK /?CCL17
+ SET 'ENCHANTED-ORB,MILKY-ORB
+ JUMP ?CND13
+?CCL17: RANDOM 100
+ LESS? 33,STACK /?CCL19
+ SET 'ENCHANTED-ORB,SMOKY-ORB
+ JUMP ?CND13
+?CCL19: RANDOM 100
+ LESS? 50,STACK /?CCL21
+ SET 'ENCHANTED-ORB,FIERY-ORB
+ JUMP ?CND13
+?CCL21: SET 'ENCHANTED-ORB,GLITTERY-ORB
+?CND13: PRINTI "As you sit on the toboggan, it begins to slide down the mountain, gathering speed as it goes. The passing landscape begins to blur, and then even the blur is gone as the icy wind forces your eyes shut. Suddenly, with a jolt like a mighty hand grabbing you, you are still! You open your eyes"
+ PRINT ELLIPSIS
+ CALL2 GOTO,TOBOGGAN
+ RSTACK
+
+ .ENDSEG
+
+ .SEGMENT "LOWER"
+
+
+ .FUNCT CAGE-F
+ EQUAL? PRSA,V?OPEN \?CCL3
+ IN? SNAKE,CAGE \?CCL6
+ FSET? SNAKE,ANIMATEDBIT \?CCL6
+ CALL2 JIGS-UP,STR?396
+ RSTACK
+?CCL6: FSET CAGE,TOUCHBIT
+ RFALSE
+?CCL3: EQUAL? PRSA,V?COUNT \?CCL10
+ PRINTR "Thousands."
+?CCL10: EQUAL? PRSA,V?ENTER \FALSE
+ PRINTR "The cage is too small for a human."
+
+ .SEGMENT "0"
+
+
+ .FUNCT SNAKE-F
+ EQUAL? PRSA,V?RESEARCH \?CCL3
+ CALL NOUN-USED?,SNAKE,W?SNAKE
+ ZERO? STACK /?CCL3
+ PRINTR """A common animal, best kept caged."""
+?CCL3: FSET? SNAKE,ANIMATEDBIT \?CCL7
+ EQUAL? PRSA,V?LET-OUT \?CCL10
+ ICALL PERFORM,V?OPEN,CAGE
+ RTRUE
+?CCL10: EQUAL? PRSA,V?MEASURE,V?EXAMINE \FALSE
+ PRINTR "The snake is thin and perhaps as much as twenty feet long."
+?CCL7: EQUAL? PRSA,V?TIE \?CCL14
+ EQUAL? PRSO,SNAKE \?CCL14
+ EQUAL? PRSI,SPIRE \?CCL19
+ SET 'ROPE-PLACED,TRUE-VALUE
+ MOVE SNAKE,HERE
+ PRINTR "You tie the rope to the spire, dropping the other end down the cliff face. It reaches most of the way toward the lower ledge."
+?CCL19: FSET? PRSI,PLANTBIT \?CCL21
+ CALL1 WASTES
+ RSTACK
+?CCL21: PRINT YOU-CANT
+ PRINTI "tie the rope to"
+ CALL2 TRPRINT,PRSI
+ RSTACK
+?CCL14: EQUAL? PRSA,V?UNTIE \?CCL23
+ ZERO? ROPE-PLACED /?CCL23
+ SET 'ROPE-PLACED,FALSE-VALUE
+ PRINTR "You untie the rope from the spire."
+?CCL23: EQUAL? PRSA,V?CLIMB-DOWN \?CCL27
+ ZERO? ROPE-PLACED /?CCL27
+ CALL2 DO-WALK,P?DOWN
+ RSTACK
+?CCL27: EQUAL? PRSA,V?MEASURE,V?EXAMINE \FALSE
+ PRINTR "The rope is about twenty feet long."
+
+
+ .FUNCT I-W-SNAKE,TOLD
+ FSET SNAKE,ANIMATEDBIT
+ IN? SNAKE,LAKE-BOTTOM \?CCL3
+ REMOVE SNAKE
+ JUMP ?CND1
+?CCL3: CALL2 VISIBLE?,SNAKE
+ ZERO? STACK /?CCL5
+ ICALL1 RETURN-FROM-MAP
+ SET 'TOLD,TRUE-VALUE
+ PRINTI " The rope ripples with increasing force. It has returned to the form of a snake! The snake squirms with anger"
+ EQUAL? HERE,UPPER-LEDGE \?CCL8
+ ZERO? ROPE-PLACED /?CCL8
+ PRINTI ", uncurls from the spire, and drops out of sight!"
+ CRLF
+ JUMP ?CND1
+?CCL8: IN? SNAKE,CAGE \?CCL12
+ FSET? CAGE,OPENBIT /?CCL12
+ PRINT PERIOD-CR
+ JUMP ?CND1
+?CCL12: CALL2 ULTIMATELY-IN?,SNAKE
+ ZERO? STACK /?CCL16
+ IN? SNAKE,WALDO /?CCL16
+ ICALL2 JIGS-UP,STR?399
+ JUMP ?CND1
+?CCL16: LOC SNAKE
+ FSET? STACK,ACTORBIT \?CND19
+ PRINTI ", nearly bites"
+ LOC SNAKE
+ ICALL2 TPRINT,STACK
+ PRINTI " on the wrist, drops to the ground,"
+?CND19: PRINTI " and wriggles quickly out of sight."
+ CRLF
+ JUMP ?CND1
+?CCL5: EQUAL? HERE,LOWER-LEDGE \?CND1
+ ZERO? ROPE-PLACED /?CND1
+ ICALL1 RETURN-FROM-MAP
+ SET 'TOLD,TRUE-VALUE
+ PRINTI " A writhing snake drops from above! It strikes out at you but, fortunately, misses. Hissing angrily, it disappears into a narrow crack."
+ CRLF
+?CND1: SET 'ROPE-PLACED,FALSE-VALUE
+ IN? SNAKE,CAGE \?CCL25
+ FSET? CAGE,OPENBIT \?CND24
+?CCL25: REMOVE SNAKE
+?CND24: ZERO? TOLD \TRUE
+ RFALSE
+
+ .ENDSEG
+
+ .SEGMENT "LOWER"
+
+
+ .FUNCT VAULT-DOOR-F
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ EQUAL? HERE,LOWEST-HALL \?CCL3
+ PRINTI "A large dial is set into the center of the door. "
+ RFALSE
+?CCL3: EQUAL? PRSA,V?LOCK \?CCL7
+ EQUAL? PRSO,VAULT-DOOR \?CCL7
+ FSET? VAULT-DOOR,OPENBIT \?CCL12
+ CALL DO-FIRST,STR?402,VAULT-DOOR
+ RSTACK
+?CCL12: FSET? VAULT-DOOR,LOCKEDBIT \?CCL14
+ PRINTR "It is!"
+?CCL14: RANDOM 2570 >P-NUMBER
+ ICALL PERFORM,V?SET,DIAL,INTNUM
+ RTRUE
+?CCL7: EQUAL? PRSA,V?UNLOCK \FALSE
+ FSET? PRSI,KEYBIT \FALSE
+ PRINTR "This is a combination lock, not a key lock."
+
+
+ .FUNCT DIAL-F
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ PRINTI "The dial is currently turned to "
+ PRINTN DIAL-NUMBER
+ PRINTR ". It can be set to any number between 1 and 2570."
+?CCL3: EQUAL? PRSA,V?SET-DIR \?CCL5
+ EQUAL? PRSI,LEFT-RIGHT \?CCL5
+ ICALL PERFORM,V?SET,DIAL
+ RTRUE
+?CCL5: EQUAL? PRSA,V?SET \FALSE
+ ZERO? PRSI \?CCL12
+ PRINTR "[You must say what number to turn the dial to, as in TURN DIAL TO 920.]"
+?CCL12: EQUAL? PRSI,INTNUM /?CCL14
+ CALL1 IMPOSSIBLES
+ RSTACK
+?CCL14: GRTR? P-NUMBER,2570 /?CTR15
+ LESS? P-NUMBER,1 \?CCL16
+?CTR15: PRINTR "That's not one of the numbers on the dial."
+?CCL16: EQUAL? DIAL-NUMBER,P-NUMBER \?CCL20
+ PRINTI "The dial is already set to "
+ PRINTN P-NUMBER
+ PRINT PERIOD-CR
+ RTRUE
+?CCL20: FSET? VAULT-DOOR,OPENBIT /?CCL22
+ FSET? VAULT-DOOR,LOCKEDBIT /?CCL22
+ SET 'DIAL-NUMBER,P-NUMBER
+ FSET VAULT-DOOR,LOCKEDBIT
+ PRINTR "The tumblers tumble as the vault door re-locks."
+?CCL22: FSET? GLOVE,WORNBIT \?CCL26
+ FSET? VAULT-DOOR,LOCKEDBIT \?CCL26
+ RANDOM 2570 >DIAL-NUMBER
+ FCLEAR VAULT-DOOR,LOCKEDBIT
+ PRINTI "As you turn the dial with your gloved hand, you can almost feel the tumblers turning as though they were an extension of your own fingers! Fascinated, you keep spinning, and as you pass "
+ PRINTN DIAL-NUMBER
+ PRINTR ", you feel a sense of tactile perfection, and stop. A faint click ripples up your arm."
+?CCL26: SET 'DIAL-NUMBER,P-NUMBER
+ PRINTI "The dial is now set to "
+ PRINTN DIAL-NUMBER
+ PRINT PERIOD-CR
+ RTRUE
+
+
+ .FUNCT VAULT-F,RARG
+ ZERO? RARG \FALSE
+ EQUAL? PRSA,V?LOCK,V?CLOSE,V?OPEN /?PRD7
+ EQUAL? PRSA,V?UNLOCK \FALSE
+?PRD7: EQUAL? PRSO,GLOBAL-HERE,VAULT \FALSE
+ CALL PERFORM-PRSA,VAULT-DOOR,PRSI
+ RSTACK
+
+ .SEGMENT "0"
+
+
+ .FUNCT NW-SE-PASSAGE-F,OARG
+ EQUAL? OARG,M-OBJDESC? /TRUE
+ PRINTI " "
+ CALL2 D-PASSAGE,NW-SE-PASSAGE
+ RSTACK
+
+
+ .FUNCT N-S-PASSAGE-F,OARG
+ EQUAL? OARG,M-OBJDESC? /TRUE
+ PRINTI " "
+ CALL2 D-PASSAGE,N-S-PASSAGE
+ RSTACK
+
+
+ .FUNCT PASSAGE-F
+ EQUAL? PRSA,V?TAKE \?CCL3
+ FSET? PRSO,TRYTAKEBIT \?CCL3
+ MOVE PRSO,PROTAGONIST
+ MOVE NOTICE,HERE
+ FCLEAR N-S-PASSAGE,TRYTAKEBIT
+ FCLEAR NW-SE-PASSAGE,TRYTAKEBIT
+ FSET PRSO,TOUCHBIT
+ PRINTI "As you take"
+ ICALL1 TPRINT-PRSO
+ PRINTR ", a notice flutters to the ground."
+?CCL3: EQUAL? PRSA,V?EXAMINE \?CCL7
+ FSET? PRSO,TAKEBIT \?CCL10
+ PRINTR "The passage is made out of the same material as donut holes. Once installed, it should be wide enough to walk through, and it's probably about a hundredth of a bloit long."
+?CCL10: ICALL2 D-PASSAGE,PRSO
+ CRLF
+ RTRUE
+?CCL7: EQUAL? PRSA,V?ENTER \FALSE
+ FSET? PRSO,TAKEBIT \?CCL15
+ PRINTR "The passage hasn't been installed yet!"
+?CCL15: EQUAL? PRSO,N-S-PASSAGE \?CCL17
+ CALL2 DO-WALK,N-S-PASSAGE-DIR
+ RSTACK
+?CCL17: CALL2 DO-WALK,NW-SE-PASSAGE-DIR
+ RSTACK
+
+
+ .FUNCT D-PASSAGE,PASSAGE,?TMP1
+ FSET? PASSAGE,TOUCHBIT /?CCL3
+ EQUAL? PASSAGE,N-S-PASSAGE \?CCL6
+ PRINTI "Discarded in the corner is a north-south passage, slightly damaged but perfectly usable."
+ RTRUE
+?CCL6: PRINTI "A northwest-southeast passage is lying here. It is marked as being slightly irregular, but nobody other than one of the bureaucratic Passage Inspectors would ever notice."
+ RTRUE
+?CCL3: FSET? PASSAGE,TAKEBIT \?CCL8
+ PRINTI "A magic "
+ ICALL2 DPRINT,PASSAGE
+ PRINTI " is just lying around in the middle of the room, uninstalled."
+ RTRUE
+?CCL8: PRINTI "A magic "
+ ICALL2 DPRINT,PASSAGE
+ PRINTI " has been installed in the "
+ EQUAL? PASSAGE,N-S-PASSAGE \?CCL11
+ EQUAL? HERE,CONSTRUCTION \?CCL14
+ GET NORTH-EXITS,0 >?TMP1
+ ADD CONSTRUCTION-LOC,100
+ EQUAL? ?TMP1,STACK \?CCL17
+ PRINTI "north"
+ JUMP ?CND9
+?CCL17: PRINTI "south"
+ JUMP ?CND9
+?CCL14: EQUAL? N-S-PASSAGE-DIR,P?NORTH \?CCL19
+ PRINTI "north"
+ JUMP ?CND9
+?CCL19: PRINTI "south"
+ JUMP ?CND9
+?CCL11: EQUAL? HERE,CONSTRUCTION \?CCL22
+ GET SE-EXITS,0 >?TMP1
+ ADD CONSTRUCTION-LOC,100
+ EQUAL? ?TMP1,STACK \?CCL25
+ PRINTI "southeast"
+ JUMP ?CND9
+?CCL25: PRINTI "northwest"
+ JUMP ?CND9
+?CCL22: EQUAL? NW-SE-PASSAGE-DIR,P?NW \?CCL27
+ PRINTI "northwest"
+ JUMP ?CND9
+?CCL27: PRINTI "southeast"
+?CND9: PRINTI " wall."
+ RTRUE
+
+ .ENDSEG
+
+ .SEGMENT "LOWER"
+
+
+ .FUNCT PITS-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "This cavern, deep in the bowels of the Great Underground Empire, "
+ ICALL1 D-PITS-FLOOR
+ PRINTI ". A rickety ladder leads upward."
+ RTRUE
+
+
+ .FUNCT D-PITS-FLOOR
+ FSET? LANTERN,TRYTAKEBIT \?CCL3
+ PRINTI "is spotted with an incredible quantity of pits. Judging from the closest of them, the pits are bottomless"
+ RTRUE
+?CCL3: PRINTI "has a large number of bottomless pits, all of which have been filled in"
+ FSET? HERE,TOUCHBIT \?CCL6
+ PRINTI ", except one."
+ JUMP ?CND4
+?CCL6: PRINTI " -- no, wait! It seems that one pit did not become filled in!"
+?CND4: PRINTI " The open pit seems to have handholds leading downward"
+ RTRUE
+
+
+ .FUNCT PIT-ENTER-F,RARG
+ FSET? LANTERN,TRYTAKEBIT \?CCL3
+ ZERO? RARG \FALSE
+ ICALL1 RETURN-FROM-MAP
+ PRINTI "Entering a bottomless pit means certain death!"
+ CRLF
+ RFALSE
+?CCL3: RETURN LEDGE-IN-PIT
+
+
+ .FUNCT PITS-OBJECT-F
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ EQUAL? HERE,PITS \?CCL3
+ PRINTI "The floor "
+ ICALL1 D-PITS-FLOOR
+ PRINT PERIOD-CR
+ RTRUE
+?CCL3: EQUAL? PRSA,V?LOOK-INSIDE,V?EXAMINE \?CCL7
+ PRINTR "The pit looks bottomless."
+?CCL7: EQUAL? PRSA,V?PUT,V?THROW \?CCL9
+ EQUAL? P-PRSA-WORD,W?THROW,W?HURL,W?TOSS /?PRD12
+ EQUAL? P-PRSA-WORD,W?CAST \?CCL9
+?PRD12: EQUAL? PRSO,PIT-BOMB \?CCL9
+ ICALL PERFORM,V?THROW,PIT-BOMB,FALSE-VALUE
+ RTRUE
+?CCL9: EQUAL? PRSA,V?PUT,V?THROW \?CCL16
+ EQUAL? PRSI,PITS-OBJECT \?CCL16
+ REMOVE PRSO
+ EQUAL? PRSO,PERCH /?CCL20
+ CALL ULTIMATELY-IN?,PERCH,PRSO
+ ZERO? STACK /?CND19
+?CCL20: SET 'REMOVED-PERCH-LOC,BROGMOID
+?CND19: PRINTI "Bottomless or not, the pit swallows"
+ ICALL1 TPRINT-PRSO
+ PRINTR " forever."
+?CCL16: EQUAL? PRSA,V?LEAP /?CTR23
+ EQUAL? PRSA,V?ENTER \?CCL24
+ EQUAL? P-PRSA-WORD,W?JUMP,W?LEAP \?CCL24
+?CTR23: CALL2 JIGS-UP,STR?407
+ RSTACK
+?CCL24: EQUAL? PRSA,V?ENTER \FALSE
+ CALL2 DO-WALK,P?DOWN
+ RSTACK
+
+ .SEGMENT "0"
+
+
+ .FUNCT LANTERN-F
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ FSET? LANTERN,TRYTAKEBIT \?CCL6
+ PRINTR "You can't see much from this distance."
+?CCL6: CALL NOUN-USED?,LANTERN,W?MONOGRAM
+ ZERO? STACK /?CCL8
+ ICALL PERFORM,V?READ,LANTERN
+ RTRUE
+?CCL8: FSET? LANTERN,LIGHTBIT /?CCL10
+ PRINTR "The lamp is either broken or burned out."
+?CCL10: PRINTI "There seems to be a faint monogram engraved on it. "
+ RFALSE
+?CCL3: EQUAL? PRSA,V?READ \?CCL12
+ FSET? LANTERN,TRYTAKEBIT \?CCL12
+ ICALL PERFORM,V?EXAMINE,LANTERN
+ RTRUE
+?CCL12: EQUAL? PRSA,V?WALK-TO,V?TAKE \?CCL16
+ FSET? LANTERN,TRYTAKEBIT \?CCL16
+ PRINTR "The pits make the cavern uncrossable; ergo, you can't reach the lantern."
+?CCL16: EQUAL? PRSA,V?THROW-TO,V?THROW \?CCL20
+ EQUAL? PRSI,LANTERN \?CCL20
+ FSET? LANTERN,TRYTAKEBIT \?CCL20
+ REMOVE PRSO
+ EQUAL? PRSO,PERCH /?CCL25
+ CALL ULTIMATELY-IN?,PERCH,PRSO
+ ZERO? STACK /?CND24
+?CCL25: SET 'REMOVED-PERCH-LOC,BROGMOID
+?CND24: PRINTI "Sigh. Your throw is just short of the lamp, and"
+ ICALL1 TPRINT-PRSO
+ PRINTR " disappears into one of the pits."
+?CCL20: EQUAL? PRSA,V?THROW \?CCL29
+ EQUAL? PRSO,LANTERN \?CCL29
+ ICALL2 DEQUEUE,I-LANTERN
+ FCLEAR LANTERN,ONBIT
+ FCLEAR LANTERN,LIGHTBIT
+ PRINTI "The lamp smashes into the floor, breaking it."
+ CRLF
+ CALL1 NOW-DARK?
+ RSTACK
+?CCL29: EQUAL? PRSA,V?ON \FALSE
+ FSET? LANTERN,LIGHTBIT \?CCL36
+ ICALL QUEUE,I-LANTERN,-1
+ RFALSE
+?CCL36: PRINTR "The lamp refuses to light."
+
+
+ .FUNCT I-LANTERN
+ FSET? LANTERN,ONBIT /?CND1
+ ICALL2 DEQUEUE,I-LANTERN
+ RFALSE
+?CND1: DEC 'LANTERN-COUNTER
+ ZERO? LANTERN-COUNTER \?CND3
+ FCLEAR LANTERN,ONBIT
+ FCLEAR LANTERN,LIGHTBIT
+?CND3: EQUAL? LANTERN-COUNTER,200,100,50 /?PRD9
+ EQUAL? LANTERN-COUNTER,25,0 \FALSE
+?PRD9: CALL2 VISIBLE?,LANTERN
+ ZERO? STACK /FALSE
+ ICALL1 RETURN-FROM-MAP
+ PRINTI " "
+ EQUAL? LANTERN-COUNTER,200 \?CCL14
+ PRINTR "The lamp appears a bit dimmer."
+?CCL14: EQUAL? LANTERN-COUNTER,100 \?CCL16
+ PRINTR "The lamp is definitely dimmer now."
+?CCL16: EQUAL? LANTERN-COUNTER,50 \?CCL18
+ PRINTR "The lamp is nearly out."
+?CCL18: EQUAL? LANTERN-COUNTER,25 \?CCL20
+ PRINTI "You'd better have more light than from the "
+ ICALL2 DPRINT,LANTERN
+ PRINT PERIOD-CR
+ RTRUE
+?CCL20: PRINTI "The lantern flickers and dies."
+ CRLF
+ CALL1 NOW-DARK?
+ RSTACK
+
+ .ENDSEG
+
+ .SEGMENT "LOWER"
+
+
+ .FUNCT LEDGE-IN-PIT-PS
+ EQUAL? PRSA,V?EXIT \FALSE
+ CALL1 V-WALK-AROUND
+ RSTACK
+
+
+ .FUNCT UNDER-THE-WORLD-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ ZERO? ALLIGATOR /?CCL6
+ ICALL1 RETURN-FROM-MAP
+ CALL2 JIGS-UP,STR?418
+ RSTACK
+?CCL6: FSET? UNDER-THE-WORLD,TOUCHBIT /FALSE
+ ICALL1 RETURN-FROM-MAP
+ PRINTI "The well suddenly opens onto a vast abyss! You grab onto a few protruding roots, preventing a terrible fall..."
+ CRLF
+ CRLF
+ RTRUE
+
+
+ .FUNCT ROOTS-F
+ EQUAL? HERE,OUTER-BAILEY \?CCL3
+ CALL2 PERFORM-PRSA,TREE-STUMP
+ RSTACK
+?CCL3: EQUAL? PRSA,V?TELL,V?LISTEN \FALSE
+ ZERO? PLANT-TALKER /FALSE
+ PRINTR "It is as unlikely for these roots to speak as it is for your toes to begin conversing with each other."
+
+
+ .FUNCT EAR-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "You are sitting in one of the folds of a giant ear belonging to the giant brogmoid who is holding up the world. A wide channel leading deeper into the ear is blocked by a virtual forest of ear fungus"
+ ZERO? EAR-PASSAGE-OPEN /?CND4
+ PRINTI ", except for a small tunnel through the fungus which leads farther in"
+?CND4: PRINTI ". The only exit is down."
+ RTRUE
+
+
+ .FUNCT EAR-FUNGUS-F,ARG
+ EQUAL? ARG,M-WINNER \?CCL3
+ CALL1 PLANT-STUNNED
+ RSTACK
+?CCL3: EQUAL? PRSA,V?PUSH,V?CLEAN,V?MOVE /?CTR4
+ EQUAL? PRSA,V?MUNG,V?KICK \?CCL5
+?CTR4: PRINTR "The fungi wall doesn't budge."
+?CCL5: EQUAL? PRSA,V?LISTEN \FALSE
+ ZERO? PLANT-TALKER /FALSE
+ EQUAL? FUNGUS-NUMBER,12 \?CND12
+ RANDOM 12
+ SUB STACK,1 >FUNGUS-NUMBER
+?CND12: PRINTI "You hear a vast murmur of fungi, discussing such topics as the woeful lack of moisture within this ear"
+ ZERO? EAR-PASSAGE-OPEN \?CND14
+ PRINTI ". One conversation catches your attention: a family of fungi bewailing their long lost cousin, "
+ GET FUNGUS-TABLE,FUNGUS-NUMBER
+ PRINT STACK
+?CND14: PRINT PERIOD-CR
+ RTRUE
+
+
+ .FUNCT G-FUNGUS-F,STR,LEN
+ EQUAL? PRSA,V?RESEARCH \FALSE
+ RETURN EAR-FUNGUS
+
+
+ .FUNCT BROGMOID-F
+ EQUAL? PRSA,V?WALK-TO,V?ENTER \?CCL3
+ EQUAL? HERE,UNDER-THE-WORLD,HANGING-FROM-ROOTS \?CCL6
+ CALL2 DO-WALK,P?EAST
+ RSTACK
+?CCL6: EQUAL? HERE,SHOULDER \?CCL8
+ CALL2 DO-WALK,P?UP
+ RSTACK
+?CCL8: CALL2 DO-WALK,P?IN
+ RSTACK
+?CCL3: CALL2 TOUCHING?,BROGMOID
+ ZERO? STACK /?CCL10
+ EQUAL? HERE,UNDER-THE-WORLD,HANGING-FROM-ROOTS \?CCL10
+ CALL2 CANT-REACH,BROGMOID
+ RSTACK
+?CCL10: EQUAL? PRSA,V?EXAMINE \?CCL14
+ EQUAL? HERE,ON-TOP-OF-THE-WORLD \?CCL17
+ PRINTR "Most of the brogmoid is lost in the mists which stretch above the world."
+?CCL17: PRINTR "The brogmoid is fairly ordinary, other than the fact that it's about a zillion times as large as any brogmoid you've ever seen before."
+?CCL14: EQUAL? PRSA,V?CLEAN \?CCL19
+ CALL NOUN-USED?,BROGMOID,W?EAR
+ ZERO? STACK /?CCL19
+ ICALL PERFORM,V?CLEAN,EAR-FUNGUS
+ RTRUE
+?CCL19: EQUAL? PRSA,V?RESEARCH \FALSE
+ CALL NOUN-USED?,BROGMOID,W?BROGMOID,W?BROGMOIDS
+ ZERO? STACK /FALSE
+ PRINTR """In rare cases, these squat creatures can achieve the intelligence levels of a three-year-old human. Domesticated brogmoids are tame and can even be taught to perform simple tasks. In the wild, they can be seen in huge packs sorting through rock piles for edible rocks. (See also BROGMOIDISM.)"""
+
+ .ENDSEG
+
+ .ENDI
diff --git a/castle.zil b/castle.zil
new file mode 100644
index 0000000..53a62bf
--- /dev/null
+++ b/castle.zil
@@ -0,0 +1,4823 @@
+"CASTLE for
+
+ ZORK ZERO
+ (c) Copyright 1988 Infocom, Inc. All Rights Reserved."
+
+<BEGIN-SEGMENT CASTLE>
+
+<ROOM GREAT-HALL
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Great Hall")
+ (LDESC
+"This is the huge central chamber of Dimwit's castle. The ceiling was
+lowered at some point in the past, which helped reduce the frequency of
+storm clouds forming in the upper regions of the hall. Arched openings
+lead off in the four cardinal directions. A wide stair leads up to the
+balcony, and an equally wide but ominously dark stair leads downward.")
+ (NORTH TO ENTRANCE-HALL)
+ (SOUTH TO AUDIENCE-CHAMBER)
+ (EAST TO COURTYARD)
+ (WEST TO FORMAL-GARDEN)
+ (UP TO BALCONY)
+ (DOWN PER LOWER-HALL-ENTER-F)
+ (FLAGS RLANDBIT ONBIT)
+ (GLOBAL STAIRS BANNER)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-5>)>
+
+<ROUTINE LOWER-HALL-ENTER-F ("OPTIONAL" (RARG <>)) ;"called by NEXT-ROOM?"
+ <COND (<OR <FSET? ,OUTER-GATE ,OPENBIT>
+ ,TIME-STOPPED>
+ <COND (<NOT .RARG>
+ <RETURN-FROM-MAP>
+ <TELL
+"Near the bottom of the flight, the steps are blocked by
+newly-fallen rubble!" CR>)>
+ <RFALSE>)
+ (T
+ ,LOWER-HALL)>>
+
+<OBJECT CALENDAR
+ (DESC "calendar")
+ (LDESC "A calendar for 883 GUE is lying here.")
+ (SYNONYM CALENDAR)
+ (FLAGS READBIT TAKEBIT)
+ (SIZE 3)
+ (TEXT
+"[This is the \"Lives of the Twelve Flatheads Calendar\" which you can find
+in your Zork Zero package.]")>
+
+<OBJECT CALENDAR-ITEMS ;"vocab. for items in calendar pics but not in game"
+ (LOC GENERIC-OBJECTS)
+ (DESC "it")
+ (SYNONYM POISON AX AXE COBRA SKULL KNIFE DAGGER TROPHY
+ STICK BALL HELMET EPAULET EPAULETTE MEDAL TEMPLATE PENCIL
+ TRIANGLE CRAYON COMPASS ELEPHANT VOLCANO BRUSH AVOCADO INKWELL
+ RAVEN STAMP CIGAR BURNER CELERY MATCH BOWTIE)
+ (ADJECTIVE HOCKEY RUBBER BUNSEN)>
+
+<OBJECT LOCKET-MOOSE
+ (LOC GENERIC-OBJECTS)
+ (DESC "it")
+ (SYNONYM LOCKET MOOSE)>
+
+<OBJECT PROCLAMATION
+ (DESC "proclamation")
+ (FDESC "A proclamation hangs on the wall.")
+ (OWNER WALL)
+ (SYNONYM PROCLAMATION DECREE)
+ (FLAGS READBIT TAKEBIT BURNBIT TRYTAKEBIT)
+ (SIZE 2)
+ (TEXT
+"\"The one who can stop the Curse of Megaboz, and save the land from
+destruction, shall be rewarded with half the wealth of the Empire.|
+ (signed) Wurb Flathead|
+ King of Quendor|
+ Protector of the Empire|
+ Ruler of all the Known Lands\"")
+ (ACTION PROCLAMATION-F)>
+
+;<BEGIN-SEGMENT 0>
+
+<ROUTINE PROCLAMATION-F ()
+ <COND (<AND <VERB? TAKE>
+ <FSET? ,PROCLAMATION ,TRYTAKEBIT>>
+ <COND (<EQUAL? <ITAKE T> ,M-FATAL>
+ <RTRUE>)
+ (T
+ <PUTP ,PROCLAMATION ,P?ACTION <>>
+ <PUTP ,PROCLAMATION ,P?OWNER <>>
+ <FCLEAR ,PROCLAMATION ,TRYTAKEBIT>
+ <TELL "You rip the decree from the wall." CR>)>)>>
+
+;<END-SEGMENT>
+
+;<BEGIN-SEGMENT CASTLE>
+
+<ROOM ENTRANCE-HALL
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Entrance Hall")
+ (NORTH TO INNER-BAILEY IF PORTCULLIS IS OPEN ELSE
+ "The closed portcullis covers the doorway.")
+ (SOUTH TO GREAT-HALL)
+ (EAST TO BANQUET-HALL)
+ (WEST TO PARLOR)
+ (FLAGS RLANDBIT ONBIT)
+ (GLOBAL PORTCULLIS)
+ (RIDDLE
+"Some say I fly, but I'm not a bird; I'm often wasted, or so I've heard.
+Though I go on endlessly, there's never enough of me! What am I?\"")
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-5>)
+ (ACTION ENTRANCE-HALL-F)>
+
+<ROUTINE ENTRANCE-HALL-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"This is where visitors enter the castle proper, through the wide
+doorway to the north. ">
+ <COND (<NOT <FSET? ,PORTCULLIS ,OPENBIT>>
+ <TELL
+"The doorway is currently blocked by a sturdy portcullis. ">)>
+ <TELL
+"Oddly, there is a doorbell on the inside of the doorway. Other doorways
+lead east, west, and south.">)
+ (<AND <EQUAL? .RARG ,M-END>
+ <IN? ,JESTER ,HERE>
+ <NOT <FSET? ,PORTCULLIS ,OPENBIT>>>
+ <SETUP-ORPHAN "answer">)>>
+
+<OBJECT TIME-OBJECT
+ (LOC GLOBAL-OBJECTS)
+ (DESC "time")
+ (SYNONYM TIME)
+ (FLAGS NARTICLEBIT)>
+
+<OBJECT DOORBELL
+ (LOC ENTRANCE-HALL)
+ (DESC "doorbell")
+ (SYNONYM DOORBELL BELL)
+ (ADJECTIVE DOOR)
+ (FLAGS NDESCBIT)
+ (GENERIC G-HAT-F) ;"jester's hat has synonym BELL"
+ (ACTION DOORBELL-F)>
+
+<ROUTINE DOORBELL-F ()
+ <COND (<VERB? PUSH TOUCH>
+ <TELL "\"Ding, dong!\"" CR>
+ <COND (<NOT <IN? ,JESTER ,HERE>>
+ <SETG DO-J T>
+ <I-JESTER T>)>
+ <RTRUE>)>>
+
+<OBJECT PORTCULLIS
+ (LOC LOCAL-GLOBALS)
+ (DESC "portcullis")
+ (SYNONYM PORTCULLIS)
+ (ADJECTIVE STURDY HEAVY IRON)
+ (FLAGS DOORBIT)
+ (ACTION PORTCULLIS-F)>
+
+<ROUTINE PORTCULLIS-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"The portcullis, which is a heavy iron latticework used to block this
+entrance doorway, is ">
+ <OPEN-CLOSED ,PORTCULLIS>
+ <TELL ,PERIOD-CR>)
+ (<AND <VERB? OPEN>
+ <NOT <FSET? ,PORTCULLIS ,OPENBIT>>>
+ <TELL
+"You try to lift the portcullis, but with no effect (aside from nearly
+breaking your back)." CR>)
+ (<AND <VERB? CLOSE>
+ <FSET? ,PORTCULLIS ,OPENBIT>>
+ <TELL ,WONT-BUDGE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT VILLAGE>
+
+<OBJECT MOAT
+ (LOC LOCAL-GLOBALS)
+ (DESC "moat")
+ (SYNONYM MOAT)
+ (FLAGS WATERBIT)
+ (ACTION MOAT-F)>
+
+<ROUTINE MOAT-F ()
+ <COND (<AND <TOUCHING? ,MOAT>
+ <EQUAL? ,HERE ,PARAPET ,UPPER-BARBICAN>>
+ <CANT-REACH ,MOAT>)>>
+
+<ROOM INNER-BAILEY
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Inner Bailey")
+ (LDESC
+"You are on a narrow grassy strip between the castle (which can be entered
+to the south) and the moat. A young elm grows by the side of the moat. A
+causeway leads out into the moat to the northwest.")
+ (SOUTH TO ENTRANCE-HALL IF PORTCULLIS IS OPEN)
+ (NW TO CAUSEWAY)
+ (FLAGS RLANDBIT OUTSIDEBIT ONBIT)
+ (SYNONYM BAILEY)
+ (ADJECTIVE INNER)
+ (GLOBAL PORTCULLIS MOAT CAUSEWAY)
+ (MAP-LOC <PTABLE VILLAGE-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-6>)
+ (ICON INNER-BAILEY-ICON)
+ (ACTION INNER-BAILEY-F)>
+
+<ROUTINE INNER-BAILEY-F ("OPT" (RARG <>))
+ <COND (<AND ,DEMO-VERSION? <EQUAL? .RARG ,M-END>>
+ <END-DEMO>)>>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT WORM
+ (LOC INNER-BAILEY)
+ (DESC "worm")
+ (FDESC "A common earthworm is wriggling through the grass.")
+ (SYNONYM WORM EARTHWORM PIECE RUBBER)
+ (ADJECTIVE COMMON)
+ (FLAGS TAKEBIT ANIMATEDBIT)
+ (INANIMATE-DESC "piece of rubber")
+ (WAND-TEXT "Instantly, the worm stops wriggling.")
+ (ANIMATE-ROUTINE I-W-WORM)
+ (SIZE 1)
+ (ACTION WORM-F)>
+
+<ROUTINE WORM-F ()
+ <COND (<VERB? EAT>
+ <COND (<EQUAL? ,TURNED-INTO ,ROOSTER>
+ <GOOD-MEAL ,WORM>)
+ (T
+ <TELL "Yukko!" CR>)>)
+ (<AND <VERB? RESEARCH>
+ <NOUN-USED? ,WORM ,W?WORM ,W?EARTHWORM>>
+ <TELL "\"A low form of ground-dwelling animal life.\"" CR>)>>
+
+<ROUTINE I-W-WORM ("AUX" (L <LOC ,WORM>))
+ <FSET ,WORM ,ANIMATEDBIT>
+ <COND (<IN? ,WORM ,LAKE-BOTTOM>
+ <REMOVE ,WORM>)
+ (<EQUAL? <META-LOC ,WORM> ,HERE>
+ <RETURN-FROM-MAP>
+ <TELL " The worm ">
+ <COND (<AND <NOT <EQUAL? .L ,PROTAGONIST ,HERE>>
+ <NOT <FSET? .L ,DROPBIT>>>
+ <MOVE ,WORM ,HERE>
+ <FSET .L ,OPENBIT>
+ <TELL "wriggles out of" T .L>)
+ (T
+ <TELL "has resumed wriggling">)>
+ <TELL ,PERIOD-CR>)
+ (T
+ <MOVE ,WORM <META-LOC ,WORM>>
+ <RFALSE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT VILLAGE>
+
+<OBJECT SMALL-ELM
+ (LOC INNER-BAILEY)
+ (DESC "small elm tree")
+ (SYNONYM TREE ELM)
+ (ADJECTIVE YOUNG SMALL ELM)
+ (FLAGS NDESCBIT PLANTBIT)
+ (ACTION TREE-F)>
+
+<ROUTINE TREE-F ("OPTIONAL" (ARG <>))
+ <COND (<EQUAL? .ARG ,M-WINNER>
+ <PLANT-STUNNED>)
+ (<VERB? GET-NEAR>
+ <TELL "You are now standing at the base of the tree." CR>)
+ (<AND <VERB? LISTEN>
+ ,PLANT-TALKER>
+ <COND (<PRSO? ,MIGHTY-ELM>
+ <TELL
+"The mighty elm rumbles in a voice that bespeaks great age and weariness. It
+seems to be pining for its simple, happier, younger days. Most particularly,
+it seems to be fondly recalling a playful squirrel named \"Rosebud.\"" CR>)
+ (<PRSO? ,SMALL-ELM>
+ <TELL
+"The little elm's roots have, apparently, just reached down to a particularly
+yummy patch of decayed mulch, and the young elm is humming rhapsodically about
+the yumminess of the minerals therein." CR>)
+ (T
+ <TELL
+"The two elms are exchanging off-color jokes, most of which seem to involve
+various methods of pollen transfer." CR>)>)
+ (<VERB? CLIMB CLIMB-UP>
+ <COND (<PRSO? ,SMALL-ELM>
+ <TELL
+"Your weight is too much for this little tree." CR>)
+ (T
+ <TELL ,POORLY-CONFIGURED>)>)
+ (<AND <VERB? LISTEN>
+ ,PLANT-TALKER>
+ <TELL
+"The tree's speech is very childlike and difficult to understand, but it
+seems to be fantasizing about the day when it will be tall enough to see
+over the castle walls." CR>)
+ (<VERB? MEASURE>
+ <TELL "You can">
+ <COND (<PRSO? ,MIGHTY-ELM>
+ <TELL "'t come close to getting">)
+ (T
+ <COND (<PRSO? ,SMALL-ELM>
+ <TELL " easily">)
+ (T
+ <TELL " just barely">)>
+ <TELL " get">)>
+ <TELL " your arms around the tree." CR>)>>
+
+<ROOM CAUSEWAY
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Causeway")
+ (LDESC
+"You are on a peninsula of dirt and gravel which extends into the moat from
+the southeast. A tall barbican towers over the end of the causeway, to the
+northwest.")
+ (SE TO INNER-BAILEY)
+ (NW TO BARBICAN)
+ (FLAGS RLANDBIT OUTSIDEBIT ONBIT)
+ (SYNONYM CAUSEWAY)
+ (GLOBAL MOAT BARBICAN)
+ (MAP-LOC <PTABLE VILLAGE-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-5>)
+ (ICON CAUSEWAY-ICON)>
+
+<ROOM BARBICAN
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Barbican")
+ (NW TO DRAWBRIDGE IF DRAWBRIDGE IS OPEN)
+ (SE TO CAUSEWAY)
+ (UP TO UPPER-BARBICAN)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM BARBICAN TOWER GATE-TOWER)
+ (ADJECTIVE TALL LOWER)
+ (GLOBAL MOAT DRAWBRIDGE FIXED-LADDER UPPER-BARBICAN)
+ (MAP-LOC <PTABLE VILLAGE-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-4>)
+ (ICON BARBICAN-ICON)
+ (ACTION BARBICAN-F)>
+
+<ROUTINE BARBICAN-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"This dimly lit room is the bottom level of the gate-tower which guards the
+castle's drawbridge. It lies at the tip of a peninsula into the moat; the rest
+of the peninsula is to the southeast. A drawbridge to the northwest is ">
+ <OPEN-CLOSED ,DRAWBRIDGE>
+ <TELL ", and a ladder leads to an upper level.">)>>
+
+<ROOM UPPER-BARBICAN
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Upper Barbican")
+ (LDESC
+"This upper level is key to defending the outer perimeter of the castle, with
+its commanding view of the causeway, moat and baileys. The floor is filled
+with \"murder holes\" for dropping heavy cannonballs onto unwanted visitors
+who penetrate as far as the barbican's lower level, just below. A large cast
+iron wheel is mounted in the center of the room. The only exit is a ladder
+leading down.")
+ (DOWN TO BARBICAN)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM BARBICAN TOWER)
+ (ADJECTIVE UPPER)
+ (GLOBAL FIXED-LADDER MOAT)
+ (MAP-LOC <PTABLE VILLAGE-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-4>)
+ (ICON UPPER-BARBICAN-ICON)>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT CANNONBALL
+ (LOC UPPER-BARBICAN)
+ (DESC "cannonball")
+ (SYNONYM CANNONBALL BALL)
+ (ADJECTIVE HEAVY)
+ (FLAGS TAKEBIT)
+ (SIZE 50)
+ (ACTION CANNONBALL-F)>
+
+<ROUTINE CANNONBALL-F ()
+ <COND (<AND <VERB? PUT-ON>
+ <EQUAL? ,P-PRSA-WORD ,W?DROP>
+ <PRSO? ,CANNONBALL>>
+ <MOVE ,CANNONBALL ,HERE>
+ <COND (<FSET? ,PRSI ,PARTBIT>
+ <TELL "Ouch!!!" CR>)
+ (<G? <GETP ,PRSI ,P?SIZE> 10>
+ <TELL "This has no effect." CR>)
+ (T
+ <TELL "Miraculously," T ,PRSI " survives." CR>)>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT VILLAGE>
+
+<OBJECT MURDER-HOLE
+ (LOC UPPER-BARBICAN)
+ (DESC "murder hole")
+ (SYNONYM HOLE)
+ (ADJECTIVE MURDER)
+ (FLAGS NDESCBIT)
+ (ACTION MURDER-HOLE-F)>
+
+<ROUTINE MURDER-HOLE-F ("AUX" TAKER)
+ <COND (<VERB? LOOK-INSIDE>
+ <TELL "You can just make out the barbican below." CR>)
+ (<VERB? REACH-IN>
+ <TELL ,NOTHING-IN-REACH>)
+ (<AND <VERB? PUT PUT-THROUGH>
+ <PRSI? ,MURDER-HOLE>>
+ <COND (<AND <PRSO? ,CANNONBALL>
+ <VISIBLE? ,CANDLE>
+ <FSET? ,CANDLE ,ONBIT>>
+ <COND (<NOT <ULTIMATELY-IN? ,CANDLE>>
+ <MOVE ,CANDLE ,PROTAGONIST>)>
+ <TELL
+"As you drop the cannonball through the murder hole, you hear a sickening
+\"splat,\" followed by a woman's scream!|
+ \"Emily, what is it!\"|
+ \"It's Victor -- he's been murdered!\"|
+ \"I'll summon the Inspector! Ah, here he is now!\" You hear whispered
+questions and answers from the room below, followed by footsteps on the
+stairs. The jester enters, wearing a trenchcoat and smoking a large pipe.|
+ \"I'm afraid I'm going to have to order Sgt. Duffy to place you under
+arrest, sir.\" You grow dizzy with confusion, and your surroundings swirl
+wildly about you" ,ELLIPSIS>
+ <GOTO ,DUNGEON>)
+ (T
+ <TELL "You hear a \"thunk\" from down below." CR>)>
+ <COND (<OR <SET TAKER <FIND-IN ,BARBICAN ,WHITEBIT>>
+ <SET TAKER <FIND-IN ,BARBICAN ,BLACKBIT>>>
+ <MOVE ,PRSO .TAKER>
+ <COND (<PRSO? ,PIGEON>
+ <MOVE-TO-PERCH .TAKER>)>)
+ (T
+ <MOVE ,PRSO ,BARBICAN>)>
+ <RTRUE>)>>
+
+<OBJECT WHEEL
+ (LOC UPPER-BARBICAN)
+ (DESC "wheel")
+ (SYNONYM WHEEL)
+ (ADJECTIVE LARGE CAST IRON)
+ (FLAGS NDESCBIT)
+ (ACTION WHEEL-F)>
+
+<ROUTINE WHEEL-F ()
+ <COND (<VERB? SET SET-DIR>
+ <COND (<FSET? ,DRAWBRIDGE ,OPENBIT>
+ <FCLEAR ,DRAWBRIDGE ,OPENBIT>)
+ (T
+ <FSET ,DRAWBRIDGE ,OPENBIT>)>
+ <FSET ,BARBICAN ,REDESCBIT>
+ <TELL "You hear a clattering clanking noise from below." CR>
+ <ROB ,DRAWBRIDGE ,BARBICAN>
+ <RTRUE>)>>
+
+<ROOM DRAWBRIDGE
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Drawbridge")
+ (SE TO BARBICAN)
+ (NW TO OUTER-BAILEY)
+ (FLAGS RLANDBIT ONBIT OUTSIDEBIT)
+ (SYNONYM BRIDGE DRAWBRIDGE)
+ (ADJECTIVE DRAW STURDY WOODEN)
+ (GLOBAL DRAWBRIDGE MOAT)
+ (MAP-LOC <PTABLE VILLAGE-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-3>)
+ (ICON DRAWBRIDGE-ICON)
+ (ACTION DRAWBRIDGE-F)>
+
+<ROUTINE DRAWBRIDGE-F ("OPTIONAL" RARG)
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"You are standing on a sturdy wooden drawbridge across a moat. ">
+ <COND (<NOT ,TIME-STOPPED>
+ <TELL
+"The surface of the moat roils from the thrashing of countless
+ravenous beasts. ">)>
+ <TELL
+"The drawbridge runs from a tall barbican at the southeast to a wide meadow
+at the northwest.">)
+ (.RARG
+ <RFALSE>)
+ (<VERB? EXAMINE>
+ <TELL "The drawbridge is ">
+ <OPEN-CLOSED ,DRAWBRIDGE>
+ <TELL ,PERIOD-CR>)
+ (<OR <AND <VERB? OPEN LOWER>
+ <NOT <FSET? ,DRAWBRIDGE ,OPENBIT>>>
+ <AND <VERB? CLOSE RAISE>
+ <FSET? ,DRAWBRIDGE ,OPENBIT>>>
+ <TELL "There's no apparent way to do that." CR>)>>
+
+<END-SEGMENT>
+\
+<BEGIN-SEGMENT CASTLE>
+
+<ROOM PARLOR
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Parlor")
+ (LDESC
+"This is where many of Dimwit's guests would come and sit after dinner,
+for wine, conversation, and any other whim that might pop into Dimwit's
+head. There are doorways to the east, west and south.")
+ (EAST TO ENTRANCE-HALL)
+ (SOUTH TO FORMAL-GARDEN)
+ (WEST TO TORCH-ROOM)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM PARLOR)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-4>)
+ (ICON PARLOR-ICON)
+ (ACTION PARLOR-F)>
+
+<ROUTINE PARLOR-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-ENTER> ;"spenseweed shared with Lake Bottom"
+ <MOVE ,SPENSEWEED ,FISH-TANK>
+ <FCLEAR ,SPENSEWEED ,NDESCBIT>)>>
+
+<OBJECT FISH-TANK
+ (LOC PARLOR)
+ (DESC "fish tank")
+ (SYNONYM TANK AQUARIUM)
+ (ADJECTIVE FISH)
+ (CAPACITY 50)
+ (FLAGS CONTBIT SEARCHBIT OPENBIT TRYTAKEBIT WATERBIT)
+ (ACTION FISH-TANK-F)>
+
+<GLOBAL DESCRIBED-TANK-AS-LARGE <>>
+
+<GLOBAL DESCRIBED-TANK-AS-SMALL <>>
+
+<ROUTINE FISH-TANK-F ()
+ <COND (<AND <VERB? TAKE>
+ <PRSO? ,FISH-TANK>>
+ <COND (,DESCRIBED-TANK-AS-SMALL
+ <TELL
+"The fish tank is much too large to carry! [Okay, I was exaggerating
+when I called the tank \"itsy-bitsy.\"]" CR>)
+ (T
+ <SETG DESCRIBED-TANK-AS-LARGE T>
+ <TELL
+"This tank is bigger than a lot of swimming pools!" CR>)>)
+ (<AND <PRSO? ,FOX ,ROOSTER ,FLAMINGO>
+ <FSET? ,PRSO ,ANIMATEDBIT>>
+ <TELL
+"The " D ,PRSO " raises such a fuss that it becomes impossible." CR>)>>
+
+<OBJECT SPENSEWEED
+ (OWNER SPENSEWEED)
+ (LOC FISH-TANK)
+ (DESC "clump of spenseweed")
+ (SYNONYM CLUMP SPENSEWEED WEED)
+ (ADJECTIVE SPENSE)
+ (FLAGS TRYTAKEBIT PLANTBIT)
+ (RESEARCH
+"\"A deep-rooting underwater plant. Once established, it can usually only be
+removed by using certain spells of wilting. The misconception that spenseweed
+is a common roadside weed has been perpetuated by grossly inaccurate entries
+in the last several editions of THE LORE AND LEGENDS OF QUENDOR.\"")
+ (ACTION SPENSEWEED-F)>
+
+<ROUTINE SPENSEWEED-F ("OPTIONAL" (ARG <>))
+ <COND (<EQUAL? .ARG ,M-WINNER>
+ <PLANT-STUNNED>)
+ (<AND <IN? ,PROTAGONIST ,DB>
+ <TOUCHING? ,SPENSEWEED>>
+ <CANT-REACH ,SPENSEWEED>)
+ (<AND <VERB? TAKE DIG>
+ <PRSO? ,SPENSEWEED>>
+ <TELL ,DEEPLY-ROOTED>)
+ (<AND <VERB? LISTEN>
+ ,PLANT-TALKER>
+ <TELL
+"It's difficult to interpret the gurgly voice of the spenseweed, but it seems
+to be fretting about the possibility of plant-eating fish being introduced into
+the aquarium." CR>)>>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT LOBSTER
+ (LOC FISH-TANK)
+ (DESC "lobster")
+ (SYNONYM LOBSTER NUTCRACKER CRACKER)
+ (ADJECTIVE NUT)
+ (FLAGS TRYTAKEBIT TAKEBIT ANIMATEDBIT)
+ (INANIMATE-DESC "nutcracker")
+ (WAND-TEXT
+"The lobster stops moving. Frozen as it is, with pincers outstretched, it looks
+like nothing less than a large nutcracker. In fact, it IS a nutcracker!")
+ (ANIMATE-ROUTINE I-W-LOBSTER)
+ (ACTION LOBSTER-F)>
+
+<ROUTINE LOBSTER-F ()
+ <COND (<AND <VERB? RESEARCH>
+ <NOUN-USED? ,LOBSTER ,W?LOBSTER>>
+ <PRINT "\"A common aquarium pet.\"">
+ <CRLF>)
+ (<AND <VERB? TAKE>
+ <FSET? ,LOBSTER ,ANIMATEDBIT>>
+ <COND (,TIME-STOPPED
+ <QUEUE I-LOBSTER-PINCH -1>
+ <RFALSE>)
+ (<FSET? ,GLOVE ,WORNBIT>
+ <QUEUE I-LOBSTER-PINCH 2>
+ <MOVE ,LOBSTER ,PROTAGONIST>
+ <TELL
+"Your gloved hand moves with blazing speed, lifting the lobster and
+avoiding its snapping pincers." CR>)
+ (T
+ <TELL
+"The lobster snaps its pincers at you. You snatch your hand away
+just in time." CR>)>)
+ (<AND <VERB? KILL MUNG>
+ <PRSI? ,CANNONBALL ,HAMMER>>
+ <TELL
+"You pulverize the lobster into invisible jelly. Heartless; but then again,
+I understand there are a large group of people who release boiling these
+creatures alive." CR>)
+ (<AND <VERB? EAT>
+ <FSET? ,LOBSTER ,ANIMATEDBIT>>
+ <TELL
+"1) It's not cooked. 2) It would probably bite your nose off if you tried. 3)
+You don't have any tableware. 4) You don't have any melted butter. 5) It isn't
+kosher." CR>)>>
+
+<ROUTINE I-W-LOBSTER ()
+ <COND (,TIME-STOPPED
+ <QUEUE I-W-LOBSTER 3>
+ <RFALSE>)>
+ <FSET ,LOBSTER ,ANIMATEDBIT>
+ <COND (<IN? ,LOBSTER ,LAKE-BOTTOM>
+ <REMOVE ,LOBSTER>)
+ (<AND <IN? ,LOBSTER ,PROTAGONIST>
+ <NOT <IN? ,LOBSTER ,WALDO>>>
+ <RETURN-FROM-MAP>
+ <TELL
+" Youch! The nutcracker just pinched you! As you drop it, you realize that it
+has turned back into a lobster.">
+ <COND (<EQUAL? ,HERE ,HANGING-FROM-ROOTS ,UNDER-THE-WORLD>
+ <REMOVE ,LOBSTER>
+ <TELL " The poor creature plunges into the void.">)
+ (T
+ <MOVE ,LOBSTER ,HERE>)>
+ <CRLF>)
+ (<VISIBLE? ,LOBSTER>
+ <RETURN-FROM-MAP>
+ <TELL
+" You notice the nutcracker waving its pincers. It seems that the
+nutcracker is once again a lobster." CR>)
+ (T
+ <RFALSE>)>>
+
+<ROUTINE I-LOBSTER-PINCH ()
+ <COND (,TIME-STOPPED
+ <RFALSE>)
+ (<NOT <FSET? ,LOBSTER ,ANIMATEDBIT>>
+ <RFALSE>)>
+ <DEQUEUE I-LOBSTER-PINCH>
+ <COND (<AND <ULTIMATELY-IN? ,LOBSTER>
+ <NOT <IN? ,LOBSTER ,WALDO>>>
+ <RETURN-FROM-MAP>
+ <TELL
+" Youch! The lobster gives you a painful nip, and you drop it
+like a hot potato.">
+ <COND (<EQUAL? ,HERE ,HANGING-FROM-ROOTS ,UNDER-THE-WORLD>
+ <REMOVE ,LOBSTER>
+ <TELL " The poor creature plunges into the void.">)
+ (T
+ <MOVE ,LOBSTER ,HERE>)>
+ <CRLF>)
+ (T
+ <RFALSE>)>>
+
+<OBJECT STARFISH
+ (LOC FISH-TANK)
+ (DESC "starfish")
+ (PLURAL "starfish")
+ (SYNONYM STARFISH FISH STAR)
+ (ADJECTIVE STAR)
+ (FLAGS TAKEBIT ANIMATEDBIT)
+ (INANIMATE-DESC "star")
+ (WAND-TEXT
+"The starfish, as still as it was before, becomes even more still.")
+ (ANIMATE-ROUTINE I-W-STARFISH)
+ (ACTION STARFISH-F)>
+
+<ROUTINE STARFISH-F ()
+ <COND (<AND <VERB? RESEARCH>
+ <NOUN-USED? ,STARFISH ,W?STARFISH>>
+ <PRINT "\"A common aquarium pet.\"">
+ <CRLF>)>>
+
+<ROUTINE I-W-STARFISH ()
+ <COND (,TIME-STOPPED
+ <QUEUE I-W-STARFISH 3>
+ <RFALSE>)>
+ <FSET ,STARFISH ,ANIMATEDBIT>
+ <COND (<IN? ,STARFISH ,LAKE-BOTTOM>
+ <REMOVE ,STARFISH>)
+ (<VISIBLE? ,STARFISH>
+ <RETURN-FROM-MAP>
+ <TELL
+" With the tiniest wiggle, the star gives evidence that it is once again
+a starfish." CR>)
+ (T
+ <RFALSE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT CASTLE>
+
+<ROOM TORCH-ROOM
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Torch Room")
+ (LDESC
+"This is a small room for the storage of torches. The torches kept here
+are generally short-lived, for the purpose of brief forays into the
+darker regions of the castle. To the east is the lone exit.")
+ (EAST TO PARLOR)
+ (OUT TO PARLOR)
+ (FLAGS RLANDBIT ONBIT)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-3>)
+ (ICON TORCH-ROOM-ICON)>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT BICKERING-TORCH
+ (LOC TORCH-ROOM)
+ (DESC "bickering torch")
+ (PLURAL "torches")
+ (SYNONYM TORCH TORCHES)
+ (ADJECTIVE BICKERING)
+ (FLAGS TAKEBIT TRYTAKEBIT)
+ (ACTION BICKERING-TORCH-F)>
+
+<ROUTINE BICKERING-TORCH-F ()
+ <COND (<VERB? TAKE>
+ <QUEUE I-BICKERING-TORCH -1>
+ <RFALSE>)
+ (<VERB? EXAMINE ON BURN>
+ <BURNED-OUT ,BICKERING-TORCH>)>>
+
+<ROUTINE BURNED-OUT (OBJ)
+ <TELL "The " D .OBJ " has burned out and cannot be rekindled." CR>>
+
+<ROUTINE I-BICKERING-TORCH ()
+ <COND (,TIME-STOPPED
+ <RFALSE>)
+ (<NOT <ULTIMATELY-IN? ,BICKERING-TORCH>>
+ <DEQUEUE I-BICKERING-TORCH>
+ <RFALSE>)
+ (<AND <PROB 30>
+ <NOT <EQUAL? ,CURRENT-SPLIT ,MAP-TOP-LEFT-LOC>>>
+ <TELL
+" The bickering torch says, \"" <PICK-ONE ,BITCHES> "\"" CR>)
+ (T
+ <RFALSE>)>>
+
+<CONSTANT BITCHES
+ <LTABLE
+ 0
+ "All the other torches were picking on me."
+ "Everyone likes the flickering torch better than me."
+ "I saw the guttering torch wasting oil!"
+ "How come I didn't get made out of top-quality wood like
+the other torches?"
+ "The muttering torch was talking about burning down the castle.">>
+
+<OBJECT FLICKERING-TORCH
+ (LOC TORCH-ROOM)
+ (SDESC "flickering torch")
+ (PLURAL "torches")
+ (SYNONYM TORCH TORCHES)
+ (ADJECTIVE FLICKERING)
+ (FLAGS TAKEBIT TRYTAKEBIT FLAMEBIT ONBIT)
+ (ACTION FLICKERING-TORCH-F)>
+
+<ROUTINE FLICKERING-TORCH-F ()
+ <COND (<AND <VERB? TAKE>
+ <FSET? ,FLICKERING-TORCH ,ONBIT>
+ <EQUAL? ,FLICKERING-TORCH-COUNT 0>>
+ <SETG FLICKERING-TORCH-COUNT <+ <RANDOM 3> 9>>
+ <QUEUE I-FLICKERING-TORCH -1>
+ <RFALSE>)
+ (<AND <VERB? OFF>
+ <FSET? ,FLICKERING-TORCH ,ONBIT>>
+ <FCLEAR ,FLICKERING-TORCH ,ONBIT>
+ <FCLEAR ,FLICKERING-TORCH ,FLAMEBIT>
+ <DEQUEUE I-FLICKERING-TORCH>
+ <TELL "\"Pffft.\"" CR>
+ <NOW-DARK?>)
+ (<AND <VERB? EXAMINE ON OFF BURN>
+ <NOT <FSET? ,FLICKERING-TORCH ,ONBIT>>>
+ <BURNED-OUT ,FLICKERING-TORCH>)>>
+
+<GLOBAL FLICKERING-TORCH-COUNT 0>
+
+<ROUTINE I-FLICKERING-TORCH ()
+ <SETG FLICKERING-TORCH-COUNT <- ,FLICKERING-TORCH-COUNT 1>>
+ <COND (<NOT <FSET? ,FLICKERING-TORCH ,ONBIT>> ;"e.g. dunked in water"
+ <PUTP ,FLICKERING-TORCH ,P?SDESC "formerly flickering torch">
+ <DEQUEUE I-FLICKERING-TORCH>
+ <RFALSE>)
+ (<EQUAL? ,FLICKERING-TORCH-COUNT 0>
+ <PUTP ,FLICKERING-TORCH ,P?SDESC "formerly flickering torch">
+ <FCLEAR ,FLICKERING-TORCH ,ONBIT>
+ <FCLEAR ,FLICKERING-TORCH ,FLAMEBIT>
+ <DEQUEUE I-FLICKERING-TORCH>)>
+ <COND (<NOT <VISIBLE? ,FLICKERING-TORCH>>
+ <RFALSE>)
+ (<NOT <FSET? ,FLICKERING-TORCH ,ONBIT>>
+ <RETURN-FROM-MAP>
+ <IN-THE-SKY "flick">)
+ (<PROB 40>
+ <RETURN-FROM-MAP>
+ <TELL
+" The flame of the flickering torch dances wildly on the
+brink of extinction." CR>)
+ (T
+ <RFALSE>)>>
+
+<ROUTINE IN-THE-SKY (STRING)
+ <TELL
+" The " .STRING "ering torch gives its last " .STRING "er before going to
+that great Torch Room in the sky." CR>
+ <NOW-DARK?>>
+
+<OBJECT MUTTERING-TORCH
+ (LOC TORCH-ROOM)
+ (DESC "muttering torch")
+ (PLURAL "torches")
+ (SYNONYM TORCH TORCHES)
+ (ADJECTIVE MUTTERING)
+ (FLAGS TAKEBIT TRYTAKEBIT)
+ (ACTION MUTTERING-TORCH-F)>
+
+<ROUTINE MUTTERING-TORCH-F ()
+ <COND (<VERB? TAKE>
+ <QUEUE I-MUTTERING-TORCH -1>
+ <RFALSE>)
+ (<VERB? EXAMINE ON BURN>
+ <BURNED-OUT ,MUTTERING-TORCH>)>>
+
+<ROUTINE I-MUTTERING-TORCH ()
+ <COND (,TIME-STOPPED
+ <RFALSE>)
+ (<NOT <ULTIMATELY-IN? ,MUTTERING-TORCH>>
+ <DEQUEUE I-MUTTERING-TORCH>
+ <RFALSE>)
+ (<AND <PROB 30>
+ <NOT <EQUAL? ,CURRENT-SPLIT ,MAP-TOP-LEFT-LOC>>>
+ <TELL
+" The muttering torch mutters something about "
+<PICK-ONE ,MUTTERS> ,PERIOD-CR>)
+ (T
+ <RFALSE>)>>
+
+<CONSTANT MUTTERS
+ <LTABLE
+ 0
+ "human palm odors"
+ "the unfairness of existence as a torch"
+ "being held too tightly"
+ "the callous discarding of burned-out torches"
+ "the uncomfortableness of most sconces">>
+
+<OBJECT GUTTERING-TORCH
+ (LOC TORCH-ROOM)
+ (SDESC "guttering torch")
+ (PLURAL "torches")
+ (SYNONYM TORCH TORCHES)
+ (ADJECTIVE GUTTERING)
+ (FLAGS TAKEBIT TRYTAKEBIT ONBIT FLAMEBIT)
+ (ACTION GUTTERING-TORCH-F)>
+
+<ROUTINE GUTTERING-TORCH-F ()
+ <COND (<AND <VERB? TAKE>
+ <FSET? ,GUTTERING-TORCH ,ONBIT>
+ <EQUAL? ,GUTTERING-TORCH-COUNT 0>>
+ <SETG GUTTERING-TORCH-COUNT <+ <RANDOM 3> 9>>
+ <QUEUE I-GUTTERING-TORCH -1>
+ <RFALSE>)
+ (<AND <VERB? OFF>
+ <FSET? ,GUTTERING-TORCH ,ONBIT>>
+ <FCLEAR ,GUTTERING-TORCH ,ONBIT>
+ <FCLEAR ,GUTTERING-TORCH ,FLAMEBIT>
+ <DEQUEUE I-GUTTERING-TORCH>
+ <TELL "\"Pffft.\"" CR>
+ <NOW-DARK?>)
+ (<AND <VERB? EXAMINE ON OFF BURN>
+ <NOT <FSET? ,GUTTERING-TORCH ,ONBIT>>>
+ <BURNED-OUT ,GUTTERING-TORCH>)>>
+
+<GLOBAL GUTTERING-TORCH-COUNT 0>
+
+<ROUTINE I-GUTTERING-TORCH ()
+ <SETG GUTTERING-TORCH-COUNT <- ,GUTTERING-TORCH-COUNT 1>>
+ <COND (<NOT <FSET? ,GUTTERING-TORCH ,ONBIT>> ;"e.g. dunked in water"
+ <PUTP ,GUTTERING-TORCH ,P?SDESC "formerly guttering torch">
+ <DEQUEUE I-GUTTERING-TORCH>
+ <RFALSE>)
+ (<EQUAL? ,GUTTERING-TORCH-COUNT 0>
+ <PUTP ,GUTTERING-TORCH ,P?SDESC "formerly guttering torch">
+ <FCLEAR ,GUTTERING-TORCH ,ONBIT>
+ <FCLEAR ,GUTTERING-TORCH ,FLAMEBIT>
+ <DEQUEUE I-GUTTERING-TORCH>)>
+ <COND (<NOT <VISIBLE? ,GUTTERING-TORCH>>
+ <RFALSE>)
+ (<NOT <FSET? ,GUTTERING-TORCH ,ONBIT>>
+ <RETURN-FROM-MAP>
+ <IN-THE-SKY "gutt">)
+ (<PROB 40>
+ <RETURN-FROM-MAP>
+ <TELL
+" The guttering torch sputters on the verge of burning out, but
+then decides to keep burning for at least another minute." CR>)
+ (T
+ <RFALSE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT CASTLE>
+
+<ROOM FORMAL-GARDEN
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Formal Garden")
+ (LDESC
+"Dimwit designed this garden to match a fairy tale he enjoyed as a child,
+and subsequent kings added their own touches, creating a hugely confusing
+maze of flowers and shrubbery and statuary and trees and fountains and pools
+and bridges and gazebos. Now somewhat overgrown, the garden is seemingly
+endless, but you recall that the primary exits lie to the north, east, and
+southwest.")
+ (NORTH TO PARLOR)
+ (EAST TO GREAT-HALL)
+ (SW TO WEST-HALL)
+ (FLAGS RLANDBIT ONBIT OUTSIDEBIT)
+ (SYNONYM GARDEN)
+ (ADJECTIVE FORMAL)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-4>)
+ (ICON FORMAL-GARDEN-ICON)
+ (THINGS <> FLOWER GARDEN-FLOWER-PS)>
+
+<ROUTINE GARDEN-FLOWER-PS ()
+ <COND (<VERB? PICK>
+ <TELL "Ouch! Thorns!" CR>)
+ (<VERB? EXAMINE>
+ <TELL "Breathtakingly beautiful." CR>)
+ (<AND <VERB? LISTEN>
+ ,PLANT-TALKER>
+ <PERFORM-PRSA ,FLORA>)>>
+
+<OBJECT FLORA
+ (LOC FORMAL-GARDEN)
+ (DESC "flora")
+ (SYNONYM SHRUB SHRUBS SHRUBBERY TREE FLORA PLANT PLANTS)
+ (FLAGS PLANTBIT NDESCBIT NARTICLEBIT PLURALBIT)
+ (ACTION FLORA-F)>
+
+<ROUTINE FLORA-F ("OPTIONAL" (ARG <>))
+ <COND (<EQUAL? .ARG ,M-WINNER>
+ <PLANT-STUNNED>)
+ (<VERB? EXAMINE>
+ <TELL "Breathtakingly beautiful." CR>)
+ (<AND <VERB? LISTEN>
+ ,PLANT-TALKER>
+ <TELL
+"The many shrub and trees and flowers create a cacophony of plant-talk
+that makes it impossible to understand any of it!" CR>)>>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT FLAMINGO
+ (LOC FORMAL-GARDEN)
+ (DESC "flamingo")
+ (FDESC
+"You spot a flash of pink amongst the flora. It's a flamingo!")
+ (SYNONYM FLAMINGO BIRD ORNAMENT)
+ (ADJECTIVE LAWN)
+ (FLAGS TRYTAKEBIT TAKEBIT ANIMATEDBIT)
+ (INANIMATE-DESC "lawn ornament")
+ (WAND-TEXT "The flamingo becomes motionless.")
+ (ANIMATE-ROUTINE I-W-FLAMINGO)
+ (SIZE 10)
+ (ACTION FLAMINGO-F)>
+
+<ROUTINE FLAMINGO-F ("OPT" (ARG <>))
+ <COND (<NOT <FSET? ,FLAMINGO ,ANIMATEDBIT>>
+ <RFALSE>)
+ (<AND <VERB? RESEARCH>
+ <NOUN-USED? ,FLAMINGO ,W?FLAMINGO>>
+ <TELL "\"A common garden animal.\"" CR>)
+ (<AND <VERB? FEED>
+ <ULTIMATELY-IN? ,BAR-OF-FOOD>>
+ <PERFORM ,V?GIVE ,BAR-OF-FOOD ,FLAMINGO>
+ <RTRUE>)
+ (<AND <VERB? SHOW>
+ <PRSO? ,BAR-OF-FOOD>>
+ <TELL
+"The flamingo feigns disinterest, but vast volumes of drool betray its
+true feelings." CR>)
+ (<AND <VERB? GIVE>
+ <PRSO? ,BAR-OF-FOOD>>
+ <REMOVE ,BAR-OF-FOOD>
+ <TELL
+"The flamingo greedily snatches" T ,BAR-OF-FOOD " in its beak and
+gulps it down." CR>)
+ (,TIME-STOPPED
+ <RFALSE>)
+ (<VERB? TAKE CATCH>
+ <TELL
+"The flamingo prances away, leaving you clutching at air." CR>)
+ (<VERB? TOUCH>
+ <TELL "The bird nearly nips off a finger." CR>)>>
+
+<ROUTINE I-W-FLAMINGO ("AUX" (L <LOC ,FLAMINGO>))
+ <COND (,TIME-STOPPED
+ <QUEUE I-W-FLAMINGO 3>
+ <RFALSE>)>
+ <FSET ,FLAMINGO ,ANIMATEDBIT>
+ <COND (<IN? ,FLAMINGO ,LAKE-BOTTOM>
+ <REMOVE ,FLAMINGO>)
+ (<EQUAL? <META-LOC ,FLAMINGO> ,HERE>
+ <RETURN-FROM-MAP>
+ <TELL
+" Based on its angry squawks, the lawn ornament has returned to
+its former state">
+ <COND (<IN? ,FLAMINGO ,FISH-TANK>
+ <TELL
+". The flamingo sprays you with water as it leaps out of the fish tank">)
+ (<AND <NOT <EQUAL? .L ,PROTAGONIST ,HERE>>
+ <NOT <FSET? .L ,DROPBIT>>>
+ <MOVE ,FLAMINGO ,HERE>
+ <FSET .L ,OPENBIT>
+ <TELL " and popped out of" T .L>)
+ (<AND <ULTIMATELY-IN? ,FLAMINGO>
+ <NOT <IN? ,FLAMINGO ,WALDO>>>
+ <TELL
+". The flamingo gives you a vicious peck and hops to the ground">)>
+ <COND (<AND <ULTIMATELY-IN? ,FLAMINGO>
+ <FSET? <LOC ,PROTAGONIST> ,DROPBIT>>
+ <MOVE ,FLAMINGO <LOC ,PROTAGONIST>>)
+ (<NOT <FSET? <LOC ,FLAMINGO> ,DROPBIT>>
+ <MOVE ,FLAMINGO ,HERE>)>
+ <TELL ,PERIOD-CR>)
+ (T
+ <COND (<AND <ULTIMATELY-IN? ,FLAMINGO>
+ <FSET? <LOC ,PROTAGONIST> ,DROPBIT>>
+ <MOVE ,FLAMINGO <LOC ,PROTAGONIST>>)
+ (<NOT <FSET? <LOC ,FLAMINGO> ,DROPBIT>>
+ <MOVE ,FLAMINGO <META-LOC ,FLAMINGO>>)>
+ <RFALSE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT CASTLE>
+
+<ROOM COURTYARD
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Courtyard")
+ (NORTH TO BANQUET-HALL)
+ (WEST TO GREAT-HALL)
+ (SE TO EAST-HALL)
+ (FLAGS RLANDBIT ONBIT OUTSIDEBIT)
+ (SYNONYM COURTYARD)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-6>)
+ (ACTION COURTYARD-F)>
+
+<ROUTINE COURTYARD-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"This open area is paved with marble and surrounded by imposing stone walls. ">
+ <COND (<RUNNING? ,I-PROLOGUE>
+ <TELL
+"Servants are cleaning up after a tremendous carnival">)
+ (T
+ <TELL
+"Dimwit would occasionally order carnivals to be set up in this court,
+on totally cloudless days">)>
+ <TELL
+". At the distant edges of the courtyard, you can see exits to the north,
+west, and southeast.">)>>
+
+<ROOM BALCONY
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Balcony")
+ (LDESC
+"This wide balcony, itself larger than most castles, overlooks the Great
+Hall. Banners and pennants are draped from the railing into the hall below,
+which can be reached via the wide stair. A passage leads off to the south.")
+ (DOWN TO GREAT-HALL)
+ (SOUTH TO GALLERY)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM BALCONY)
+ (GLOBAL STAIRS BANNER)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-4>)
+ (ICON BALCONY-ICON)>
+
+<OBJECT BANNER
+ (LOC LOCAL-GLOBALS)
+ (DESC "banner")
+ (SYNONYM BANNER BANNERS PENNANT PENNANTS)
+ (ADJECTIVE COLORFUL)
+ (ACTION BANNER-F)>
+
+<ROUTINE BANNER-F ()
+ <COND (<VERB? READ EXAMINE>
+ <TELL
+"These colorful banners display various royal crests and insignias." CR>)
+ (<VERB? CLIMB-DOWN>
+ <TELL
+"Okay, but for future reference, the stairs are easier" ,ELLIPSIS>
+ <GOTO ,GREAT-HALL>)>>
+
+<ROOM GALLERY
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Gallery")
+ (LDESC
+"Twelve large paintings cover the walls of this long, tall room. The main
+exit is north, but there's also a small opening to the south.")
+ (NORTH TO BALCONY)
+ (SOUTH TO CLOSET)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM GALLERY)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-4>)
+ (ICON GALLERY-ICON)>
+
+<OBJECT REBUS
+ (LOC GALLERY)
+ (DESC "rebus")
+ (DESCFCN REBUS-F)
+ (SYNONYM REBUS)
+ (ADJECTIVE LARGE FRAMED)
+ (FLAGS READBIT SEARCHBIT CONTBIT SURFACEBIT OPENBIT)
+ (OWNER WALL)
+ (RESEARCH
+"\"A rebus is an illustration whose component pictures spell out a word
+or words, usually through the addition and subtraction of sounds or letters.
+The most famous creator of rebuses was Frobesius Fublius.\"")
+ (ACTION REBUS-F)>
+
+<ROUTINE REBUS-F ("OPTIONAL" (OARG <>) "AUX" CNT)
+ <SET CNT <CCOUNT ,REBUS>>
+ <COND (.OARG
+ <COND (<EQUAL? .OARG ,M-OBJDESC?>
+ <RTRUE>)>
+ <TELL
+" A large framed rebus occupies a central position at the far end of
+the gallery. It appears to have been recently hung.">
+ <COND (<G? .CNT 0>
+ <TELL " The rebus is ">
+ <COND (<G? .CNT 3>
+ <TELL "mostly">)
+ (T
+ <TELL "partially">)>
+ <TELL " obscured by a">
+ <COND (<EQUAL? .CNT 1>
+ <TELL
+"n animal -- or a representation of an animal">)
+ (T
+ <TELL
+" number of animals -- or representations of animals">)>
+ <TELL " -- which appear">
+ <COND (<EQUAL? .CNT 1>
+ <TELL "s">)>
+ <TELL " to be magically layered onto its surface:">
+ <FCLEAR ,REBUS-CAMEL ,NDESCBIT>
+ <FCLEAR ,REBUS-MOUSE ,NDESCBIT>
+ <FCLEAR ,REBUS-GOOSE ,NDESCBIT>
+ <FCLEAR ,REBUS-SNAKE ,NDESCBIT>
+ <FCLEAR ,REBUS-FISH ,NDESCBIT>
+ <FCLEAR ,REBUS-SLIME-MONSTER ,NDESCBIT>
+ <D-CONTENTS ,REBUS 2>
+ <FSET ,REBUS-CAMEL ,NDESCBIT>
+ <FSET ,REBUS-MOUSE ,NDESCBIT>
+ <FSET ,REBUS-GOOSE ,NDESCBIT>
+ <FSET ,REBUS-SNAKE ,NDESCBIT>
+ <FSET ,REBUS-FISH ,NDESCBIT>
+ <FSET ,REBUS-SLIME-MONSTER ,NDESCBIT>)>
+ <RTRUE>)
+ (<VERB? OPEN CLOSE>
+ <TELL ,HUH>)
+ (<AND <VERB? PUT PUT-ON>
+ <PRSI? ,REBUS>>
+ <TELL ,HUH>)
+ (<VERB? READ EXAMINE>
+ <CLEAR -1>
+ <SCREEN ,S-FULL>
+ <DISPLAY <COND (<IN? ,REBUS-MOUSE ,REBUS> ,REBUS-6)
+ (<IN? ,REBUS-GOOSE ,REBUS> ,REBUS-5)
+ (<IN? ,REBUS-SLIME-MONSTER ,REBUS> ,REBUS-4)
+ (<IN? ,REBUS-CAMEL ,REBUS> ,REBUS-3)
+ (<IN? ,REBUS-SNAKE ,REBUS> ,REBUS-2)
+ (<IN? ,REBUS-FISH ,REBUS> ,REBUS-1)
+ (T ,REBUS-0)> 1 1>
+ <COND (,DEMO-VERSION?
+ <INPUT-DEMO 1>)
+ (T
+ <INPUT 1>)>
+ <MOUSE-INPUT?>
+ <V-$REFRESH>
+ <RTRUE>)>>
+
+<OBJECT REBUS-CAMEL
+ (LOC REBUS)
+ (DESC "flattened camel")
+ (SYNONYM CAMEL ANIMAL REPRESENTATION)
+ (ADJECTIVE FLATTENED LAYERED)
+ (FLAGS NDESCBIT)
+ (OWNER REBUS)
+ (GENERIC G-CAMEL-F)
+ (ACTION REBUS-ANIMAL-F)>
+
+<OBJECT REBUS-MOUSE
+ (LOC REBUS)
+ (DESC "flattened mouse")
+ (SYNONYM MOUSE ANIMAL REPRESENTATION)
+ (ADJECTIVE FLATTENED LAYERED)
+ (FLAGS NDESCBIT)
+ (OWNER REBUS)
+ (ACTION REBUS-ANIMAL-F)>
+
+<OBJECT REBUS-SNAKE
+ (LOC REBUS)
+ (DESC "flattened snake")
+ (SYNONYM SNAKE ANIMAL REPRESENTATION)
+ (ADJECTIVE FLATTENED LAYERED)
+ (FLAGS NDESCBIT)
+ (OWNER REBUS)
+ (ACTION REBUS-ANIMAL-F)>
+
+<OBJECT REBUS-GOOSE
+ (LOC REBUS)
+ (DESC "flattened goose")
+ (SYNONYM GOOSE ANIMAL REPRESENTATION)
+ (ADJECTIVE FLATTENED LAYERED)
+ (FLAGS NDESCBIT)
+ (OWNER REBUS)
+ (ACTION REBUS-ANIMAL-F)>
+
+<OBJECT REBUS-FISH
+ (LOC REBUS)
+ (DESC "flattened fish")
+ (SYNONYM FISH ANIMAL REPRESENTATION)
+ (ADJECTIVE FLATTENED LAYERED)
+ (FLAGS NDESCBIT)
+ (OWNER REBUS)
+ (ACTION REBUS-ANIMAL-F)>
+
+<OBJECT REBUS-SLIME-MONSTER
+ (LOC REBUS)
+ (DESC "flattened slime monster")
+ (SYNONYM MONSTER ANIMAL REPRESENTATION)
+ (ADJECTIVE SLIME FLATTENED LAYERED)
+ (FLAGS NDESCBIT)
+ (OWNER REBUS)
+ (ACTION REBUS-ANIMAL-F)>
+
+<ROUTINE REBUS-ANIMAL-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"The " 'PRSO " seems to be magically flattened upon the rebus surface." CR>)
+ (<VERB? TAKE MOVE>
+ <TELL ,WONT-BUDGE>)
+ (<VERB? TOUCH>
+ <TELL "The " 'PRSO " feels cold to the touch." CR>)>>
+
+<OBJECT PAINTINGS
+ (LOC GALLERY)
+ (DESC "twelve paintings")
+ (SYNONYM PAINTINGS PORTRAITS)
+ (ADJECTIVE TWELVE FIRST SECOND THIRD FOURTH FIFTH SIXTH SEVENTH EIGHTH
+ NINTH TENTH ELEVENTH TWELVTH)
+ (FLAGS NDESCBIT NARTICLEBIT TRYTAKEBIT)
+ (GENERIC G-PAINTING-F)
+ (OWNER WALL)
+ (ACTION PAINTINGS-F)>
+
+<ROUTINE PAINTINGS-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"These are Leonardo Flathead's famous portraits of the Twelve Flatheads,
+including his own self-portrait, which been have reproduced in many places
+[such as the \"Lives of the Twelve Flatheads Calendar\" which you'll find
+in your Zork Zero package]." CR>)
+ (<VERB? TAKE MOVE>
+ <TELL
+"The portraits are all securely fastened to the wall." CR>)
+ (<VERB? COUNT>
+ <TELL "12." CR>)>>
+
+<OBJECT BABE-PORTRAIT
+ (LOC GALLERY)
+ (DESC "portrait of Babe Flathead")
+ (SYNONYM PAINTING PORTRAIT BABE FLATHEAD)
+ (ADJECTIVE BABE)
+ (FLAGS NDESCBIT)
+ (OWNER <TABLE (PURE LENGTH) WALL BABE-PORTRAIT>)
+ (ACTION PAINTING-F)>
+
+<OBJECT FRANK-LLOYD-PORTRAIT
+ (LOC GALLERY)
+ (DESC "portrait of Frank Lloyd Flathead")
+ (SYNONYM PAINTING PORTRAIT FRANK LLOYD FLATHEAD)
+ (ADJECTIVE FRANK LLOYD)
+ (FLAGS NDESCBIT)
+ (OWNER <TABLE (PURE LENGTH) WALL FRANK-LLOYD-PORTRAIT>)
+ (ACTION PAINTING-F)>
+
+<OBJECT JOHN-PAUL-PORTRAIT
+ (LOC GALLERY)
+ (DESC "portrait of John Paul Flathead")
+ (SYNONYM PAINTING PORTRAIT JOHN PAUL FLATHEAD)
+ (ADJECTIVE JOHN PAUL)
+ (FLAGS NDESCBIT)
+ (OWNER <TABLE (PURE LENGTH) WALL JOHN-PAUL-PORTRAIT>)
+ (ACTION PAINTING-F)>
+
+<OBJECT RALPH-WALDO-PORTRAIT
+ (LOC GALLERY)
+ (DESC "portrait of Ralph Waldo Flathead")
+ (SYNONYM PAINTING PORTRAIT RALPH WALDO FLATHEAD)
+ (ADJECTIVE RALPH WALDO)
+ (FLAGS NDESCBIT)
+ (OWNER <TABLE (PURE LENGTH) WALL RALPH-WALDO-PORTRAIT>)
+ (ACTION PAINTING-F)>
+
+<OBJECT LUCREZIA-PORTRAIT
+ (LOC GALLERY)
+ (DESC "portrait of Lucrezia Flathead")
+ (SYNONYM PAINTING PORTRAIT LUCREZIA FLATHEAD)
+ (ADJECTIVE LUCREZIA)
+ (FLAGS NDESCBIT)
+ (OWNER <TABLE (PURE LENGTH) WALL LUCREZIA-PORTRAIT>)
+ (ACTION PAINTING-F)>
+
+<OBJECT LEONARDO-PORTRAIT
+ (LOC GALLERY)
+ (DESC "portrait of Leonardo Flathead")
+ (SYNONYM PAINTING PORTRAIT SELF-PORTRAIT LEONARDO FLATHEAD)
+ (ADJECTIVE LEONARDO)
+ (FLAGS NDESCBIT)
+ (OWNER <TABLE (PURE LENGTH) WALL LEONARDO-PORTRAIT>)
+ (ACTION PAINTING-F)>
+
+<OBJECT THOMAS-ALVA-PORTRAIT
+ (LOC GALLERY)
+ (DESC "portrait of Thomas Alva Flathead")
+ (SYNONYM PAINTING PORTRAIT THOMAS ALVA FLATHEAD)
+ (ADJECTIVE THOMAS ALVA)
+ (FLAGS NDESCBIT)
+ (OWNER <TABLE (PURE LENGTH) WALL THOMAS-ALVA-PORTRAIT>)
+ (ACTION PAINTING-F)>
+
+<OBJECT JOHN-D-PORTRAIT
+ (LOC GALLERY)
+ (DESC "portrait of John D. Flathead")
+ (SYNONYM PAINTING PORTRAIT JOHN DAVISON FLATHEAD DOWN)
+ (ADJECTIVE JOHN DAVISON DOWN ;"for middle initial")
+ (FLAGS NDESCBIT)
+ (OWNER <TABLE (PURE LENGTH) WALL JOHN-D-PORTRAIT>)
+ (ACTION PAINTING-F)>
+
+<OBJECT JOHANN-SEBASTIAN-PORTRAIT
+ (LOC GALLERY)
+ (DESC "portrait of Johann Sebastian Flathead")
+ (SYNONYM PAINTING PORTRAIT JOHANN SEBASTIAN FLATHEAD)
+ (ADJECTIVE JOHANN SEBASTIAN)
+ (FLAGS NDESCBIT)
+ (OWNER <TABLE (PURE LENGTH) WALL JOHANN-SEBASTIAN-PORTRAIT>)
+ (ACTION PAINTING-F)>
+
+<OBJECT STONEWALL-PORTRAIT
+ (LOC GALLERY)
+ (DESC "portrait of Stonewall Flathead")
+ (SYNONYM PAINTING PORTRAIT STONEWALL FLATHEAD)
+ (ADJECTIVE STONEWALL)
+ (FLAGS NDESCBIT)
+ (OWNER <TABLE (PURE LENGTH) WALL STONEWALL-PORTRAIT>)
+ (ACTION PAINTING-F)>
+
+<OBJECT J-PIERPONT-PORTRAIT
+ (LOC GALLERY)
+ (OWNER <TABLE (PURE LENGTH) WALL J-PIERPONT-PORTRAIT>)
+ (DESC "portrait of J. Pierpont Flathead")
+ (SYNONYM PAINTING PORTRAIT J PIERPONT FLATHEAD)
+ (ADJECTIVE J PIERPONT)
+ (FLAGS NDESCBIT)
+ (ACTION PAINTING-F)>
+
+<OBJECT DIMWIT-PORTRAIT
+ (LOC GALLERY)
+ (DESC "portrait of Dimwit Flathead")
+ (SYNONYM PAINTING PORTRAIT DIMWIT FLATHEAD)
+ (ADJECTIVE DIMWIT LORD)
+ (FLAGS NDESCBIT)
+ (GENERIC G-DIMWIT-F)
+ (OWNER <TABLE (PURE LENGTH) WALL DIMWIT-PORTRAIT>)
+ (ACTION PAINTING-F)>
+
+<ROUTINE PAINTING-F ()
+ <COND (<VERB? EXAMINE TAKE MOVE>
+ <PERFORM-PRSA ,PAINTINGS>)
+ (<VERB? RESEARCH>
+ <TELL
+"\"One of the Twelve Flatheads. For more information, we recommend Boswell
+Barwell's 'The Lives of the Twelve Flatheads.'\" [Excerpts of which can be
+found in the calendar from your Zork Zero package.]" CR>)>>
+
+<ROOM CLOSET
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Closet")
+ (LDESC
+"You are in some sort of storage closet, which opens to the north. A ladder
+leads upward.")
+ (NORTH TO GALLERY)
+ (UP TO ROOF)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM CLOSET)
+ (GLOBAL FIXED-LADDER)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-4>)
+ (THINGS <> SHADOW PHIL-SHADOW-PS)>
+
+<OBJECT CLOSET-REBUS-BUTTON
+ (LOC CLOSET)
+ (SDESC "blinking key-shaped button")
+ (FDESC
+"In the shadow of one of the shelves is a key-shaped button, which is blinking
+rhythmically.")
+ (SYNONYM BUTTON)
+ (ADJECTIVE KEY-SHAPED BLINKING)
+ (ACTION REBUS-BUTTON-F)>
+
+;<BEGIN-SEGMENT 0>
+<BEGIN-SEGMENT ORACLE>
+<BEGIN-SEGMENT LAKE>
+<BEGIN-SEGMENT VILLAGE>
+
+<ROUTINE REBUS-BUTTON-F ()
+ <COND (<VERB? PUSH>
+ <COND (<OR <FSET? ,PRSO ,TOUCHBIT>
+ ,TIME-STOPPED>
+ <TELL ,NOTHING-HAPPENS>)
+ (T
+ <FSET ,PRSO ,TOUCHBIT>
+ <PUTP ,PRSO ,P?SDESC "key-shaped button">
+ <TELL "The button produces a ">
+ <COND (<IN? ,REBUS-MOUSE ,REBUS>
+ <REMOVE ,REBUS-MOUSE>
+ <TELL "squeak">)
+ (<IN? ,REBUS-GOOSE ,REBUS>
+ <REMOVE ,REBUS-GOOSE>
+ <TELL "honk">)
+ (<IN? ,REBUS-SLIME-MONSTER ,REBUS>
+ <REMOVE ,REBUS-SLIME-MONSTER>
+ <TELL "squish">)
+ (<IN? ,REBUS-CAMEL ,REBUS>
+ <REMOVE ,REBUS-CAMEL>
+ <TELL "bray">)
+ (<IN? ,REBUS-SNAKE ,REBUS>
+ <REMOVE ,REBUS-SNAKE>
+ <TELL "hiss">)
+ (T
+ <REMOVE ,REBUS-FISH>
+ <TELL "splash">)>
+ <TELL "ing noise and stops blinking." CR>)>)>>
+
+<END-SEGMENT>
+<BEGIN-SEGMENT 0>
+
+<OBJECT BAG
+ (LOC CLOSET)
+ (DESC "bag")
+ (FDESC
+"The shelves are all dusty and bare -- except for one small bag with some
+printing on it.")
+ (SYNONYM BAG PRINTING)
+ (ADJECTIVE SMALL)
+ (FLAGS TAKEBIT CONTBIT SEARCHBIT READBIT)
+ (SIZE 2)
+ (TEXT
+"\"Hello, Flamingo Owner! The enclosed food provides a balanced, nutritious
+diet for your flamingo. Our food is specially formulated for the finicky
+flamingo. WARNING: Poisonous to humans. Another fine product of the Frobozz
+Magic Flamingo Food Company.\"")
+ (ACTION BAG-F)>
+
+<ROUTINE BAG-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL "There's writing on the outside of the bag. ">
+ <RFALSE> ;"open-closed")>>
+
+<OBJECT BAR-OF-FOOD
+ (LOC BAG)
+ (OWNER BAR-OF-FOOD)
+ (DESC "bar of food")
+ (PLURAL "bars of food")
+ (SYNONYM BAR FOOD)
+ (FLAGS TAKEBIT)
+ (SIZE 3)
+ (ACTION BAR-OF-FOOD-F)>
+
+<ROUTINE BAR-OF-FOOD-F ()
+ <COND (<VERB? EAT>
+ <COND (<EQUAL? ,TURNED-INTO ,FLAMINGO>
+ <GOOD-MEAL ,BAR-OF-FOOD>)
+ (T
+ <JIGS-UP "Aarrgghh! Poison!">)>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT CASTLE>
+
+<ROOM ROOF
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Roof")
+ (LDESC
+"You stand atop the main building of the castle. A tall tower is visible to
+the south, but can't be reached from here. The only exit is down a ladder.")
+ (DOWN TO CLOSET)
+ (FLAGS RLANDBIT ONBIT OUTSIDEBIT)
+ (GLOBAL FIXED-LADDER)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-3>)
+ (ICON ROOF-ICON)
+ (THINGS TALL TOWER TOWER-PS)>
+
+<ROUTINE TOWER-PS ()
+ <COND (<TOUCHING? ,PSEUDO-OBJECT>
+ <CANT-REACH ,PSEUDO-OBJECT>)>>
+
+<ROOM AUDIENCE-CHAMBER
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Audience Chamber")
+ (LDESC
+"This is a tremendous meeting room where thousands of visitors would queue up
+every day for an audience with Dimwit or one of his successors. Such visitors
+were usually wasting their time; Dimwit rarely had the patience to see even
+one person a day. A plush red carpet leads from the main doorway on the north
+wall to the golden throne, fringed with red tassels, which towers above the
+floor. Behind the throne, a smaller doorway leads south.")
+ (NORTH TO GREAT-HALL)
+ (SOUTH TO THRONE-ROOM)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM CHAMBER)
+ (ADJECTIVE AUDIENCE)
+ (GLOBAL CARPET)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-5>)>
+
+<OBJECT LARGE-THRONE
+ (LOC AUDIENCE-CHAMBER)
+ (DESC "large golden throne")
+ (SYNONYM THRONE TASSLES)
+ (ADJECTIVE GOLDEN LARGE TOWERING RED)
+ (CAPACITY 50)
+ (FLAGS NDESCBIT VEHBIT SURFACEBIT CONTBIT OPENBIT SEARCHBIT)
+ (ACTION THRONE-F)>
+
+<ROOM THRONE-ROOM
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Throne Room")
+ (NORTH TO AUDIENCE-CHAMBER)
+ (SOUTH TO SECRET-PASSAGE IF SECRET-PASSAGE-OPEN)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM ROOM)
+ (ADJECTIVE THRONE)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-5>)
+ (ICON THRONE-ROOM-ICON)
+ (ACTION THRONE-ROOM-F)>
+
+<ROUTINE THRONE-ROOM-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"This is a smaller version of the room to the north, meaning that a person
+can walk all the way across it without stopping to rest. The throne, though
+smaller and more comfortable looking, is just as gaudy. It is in this chamber
+that Dimwit would meet with his \"advisors,\" raising taxes and plotting
+grandiose schemes. A doorway leads north">
+ <COND (,SECRET-PASSAGE-OPEN
+ <TELL ", and a secret passage is open to the south">)>
+ <TELL ".">)>>
+
+<OBJECT SCEPTRE
+ (LOC THRONE-ROOM)
+ (DESC "sceptre")
+ (FDESC
+"An overdone sceptre, ornamented with colored enamel and tapering to a sharp
+point, is lying by the throne.")
+ (SYNONYM SCEPTRE SCEPTER)
+ (ADJECTIVE SHARP ENAMELED ORNAMENTED OVERDONE)
+ (FLAGS TAKEBIT MAGICBIT)
+ (SIZE 5)
+ (VALUE 12)>
+
+<OBJECT SMALL-THRONE
+ (LOC THRONE-ROOM)
+ (DESC "small throne")
+ (SYNONYM THRONE)
+ (ADJECTIVE GAUDY SMALL COMFORTABLE)
+ (CAPACITY 25)
+ (FLAGS NDESCBIT VEHBIT SURFACEBIT CONTBIT OPENBIT SEARCHBIT)
+ (ACTION THRONE-F)>
+
+<ROUTINE THRONE-F ("OPTIONAL" (VARG <>))
+ <COND (<AND ,DEMO-VERSION?
+ <EQUAL? .VARG ,M-ENTER>
+ <EQUAL? ,PRSO ,SMALL-THRONE>>
+ <TELL !\ >
+ <OPEN-SECRET-PASSAGE?>
+ <RFATAL>)
+ (.VARG
+ <RFALSE>)
+ (<VERB? CLIMB-UP> ;"for CLIMB UP ON THRONE"
+ <PERFORM ,V?ENTER ,PRSO>
+ <RTRUE>)
+ (<VERB? LOOK-BEHIND>
+ <TELL "Behind the throne">
+ <COND (<EQUAL? ,HERE ,AUDIENCE-CHAMBER>
+ <TELL ", a doorway leads south." CR>)
+ (,SECRET-PASSAGE-OPEN
+ <TELL ", a secret passage beckons to the south!" CR>)
+ (T
+ <TELL " is nothing but a blank wall." CR>)>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT SECRET>
+
+;"secret passage and beyond"
+
+<GLOBAL SECRET-PASSAGE-DISCOVERED <>>
+
+<GLOBAL SECRET-PASSAGE-OPEN <>>
+
+<GLOBAL SECRET-PASSAGE-SCORE 18>
+
+<ROOM SECRET-PASSAGE
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Secret Passage")
+ (LDESC "You are in a secret passage running north and south.")
+ (NORTH TO THRONE-ROOM IF SECRET-PASSAGE-OPEN ELSE
+ "The passage ends at a blank wall!")
+ (SOUTH TO TEE)
+ (FLAGS RLANDBIT)
+ (ICON SECRET-PASSAGE-ICON)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-7>)
+ (THINGS <> SHADOW PHIL-SHADOW-PS)
+ (ACTION SECRET-PASSAGE-F)>
+
+<ROUTINE SECRET-PASSAGE-F ("OPT" (RARG <>))
+ <COND (<AND ,DEMO-VERSION? <EQUAL? .RARG ,M-END>>
+ <END-DEMO>)>>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT CANDLE
+ (LOC SECRET-PASSAGE)
+ (DESC "candle")
+ (FDESC
+"Although no one has entered this secret passage in years, a lit candle is
+mounted here, its flame casting dancing shadows across the uneven walls.")
+ (SYNONYM CANDLE)
+ (FLAGS LIGHTBIT FLAMEBIT ONBIT TAKEBIT)
+ (ACTION CANDLE-F)>
+
+<ROUTINE CANDLE-F ("AUX" FLAME)
+ <COND (<VERB? EXAMINE>
+ <COND (<FSET? ,CANDLE ,ONBIT>
+ <TELL "The flame burns tall and bright." CR>)
+ (T
+ <TELL "The candle has been snuffed." CR>)>)
+ (<AND <VERB? ON>
+ <NOT <FSET? ,CANDLE ,FLAMEBIT>>>
+ <COND (<SET FLAME <FIND-IN ,HERE ,FLAMEBIT "with">>
+ <FSET ,CANDLE ,FLAMEBIT>
+ <FSET ,CANDLE ,ONBIT>
+ <TELL "You re-light the candle." CR>)
+ (T
+ <TELL "You have no flame to light the candle." CR>)>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT SECRET>
+
+<ROOM TEE
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Tee")
+ (LDESC
+"A secret passage from the north ends here at this east-west corridor.")
+ (NORTH TO SECRET-PASSAGE)
+ (EAST TO TOP-OF-STAIR)
+ (WEST TO FOREBLDG)
+ (FLAGS RLANDBIT)
+ (ICON TEE-ICON)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-7>)>
+
+<ROOM FOREBLDG
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Forebuilding")
+ (LDESC
+"The secret passage from the east ends here. An easily defensible hallway
+rises into the keep, to the southwest.")
+ (EAST TO TEE)
+ (SW TO DONJON)
+ (UP TO DONJON)
+ (FLAGS RLANDBIT)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-6>)>
+
+<ROOM DONJON
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Donjon")
+ (LDESC
+"You are in the lowest level of the castle's keep. A stone stair winds
+up into the keep, and a sloping passage leads northeast.")
+ (NE TO FOREBLDG)
+ (DOWN TO FOREBLDG)
+ (UP TO SOLAR)
+ (FLAGS RLANDBIT)
+ (GLOBAL STAIRS)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-5>)>
+
+<ROOM SOLAR
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Solar")
+ (LDESC
+"This is the king's solar, where he would bathe and dress and meet his
+most trusted advisors and intimate guests. Dim light enters through narrow,
+slitted windows. The solar has obviously lain unused for many decades. The
+circular stair continues up and down, and a doorway leads west.")
+ (UP TO BASTION)
+ (DOWN TO DONJON)
+ (WEST TO DIMWITS-ROOM)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM SOLAR)
+ (GLOBAL STAIRS WINDOW)
+ (RIDDLE
+"You can find me at the beginning of youth, in the center of every eye,
+and at the end of eternity. What am I?\"")
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-5>)
+ (ACTION SOLAR-F)>
+
+<ROUTINE SOLAR-F ("OPT" (RARG <>))
+ <COND (<AND <EQUAL? .RARG ,M-END>
+ <IN? ,EAST-KEY ,JESTER>
+ <IN? ,JESTER ,HERE>>
+ <SETUP-ORPHAN "answer">)>>
+
+<OBJECT LETTER-Y
+ (LOC GLOBAL-OBJECTS)
+ (DESC "the letter y")
+ (SYNONYM Y)
+ (ADJECTIVE LETTER)
+ (FLAGS NARTICLEBIT)>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT EAST-KEY
+ (LOC SOLAR)
+ (DESC "iron key")
+ (FDESC
+"Sitting on a cushioned window seat, illuminated by a shaft of sunlight, rests
+an ancient iron key.")
+ (SYNONYM KEY)
+ (ADJECTIVE ANCIENT IRON)
+ (FLAGS KEYBIT TAKEBIT TRYTAKEBIT VOWELBIT)
+ (SIZE 2)
+ (ACTION EAST-KEY-F)>
+
+<ROUTINE EAST-KEY-F ()
+ <COND (<AND <VERB? TAKE>
+ <FSET? ,EAST-KEY ,TRYTAKEBIT>>
+ <COND (<IN? ,EAST-KEY ,JESTER>
+ <TELL ,ANSWER-MY-RIDDLE>)
+ (T
+ <TELL "You begin reaching for the key..." CR>
+ <SETG DO-J T>
+ <I-JESTER>)>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT SECRET>
+
+<ROOM DIMWITS-ROOM
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Dimwit's Room")
+ (LDESC
+"You stare around in awe as you realize that you are within the private
+bedroom of Lord Dimwit Flathead. The canopied bed alone is larger than most
+of the farms in your home province. Light seeps in through slitted windows,
+and doorways lead east and south.")
+ (EAST TO SOLAR)
+ (SOUTH TO CLOTHES-CLOSET)
+ (FLAGS RLANDBIT)
+ (SYNONYM ROOM)
+ (OWNER DIMWIT)
+ (GLOBAL WINDOW)
+ (ICON DIMWITS-ROOM-ICON)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-4>)>
+
+<OBJECT DIMWITS-BED
+ (LOC DIMWITS-ROOM)
+ (DESC "Dimwit's bed")
+ (SYNONYM BED)
+ (ADJECTIVE LARGE CANOPIED)
+ (OWNER DIMWIT)
+ (CAPACITY 250)
+ (FLAGS NARTICLEBIT SEARCHBIT VEHBIT DROPBIT NDESCBIT CONTBIT
+ OPENBIT SURFACEBIT)>
+
+<ROOM CLOTHES-CLOSET
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Magic Clothes Closet")
+ (LDESC
+"This is a small closet. Well, it's small by the standards of this castle;
+in a pinch, it could probably sleep a few regiments. The only exit is north.")
+ (NORTH TO DIMWITS-ROOM)
+ (FLAGS RLANDBIT)
+ (SYNONYM CLOSET)
+ (ADJECTIVE MAGIC CLOTHES)
+ (ICON MAGIC-CLOSET-ICON)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-4>)>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT CLOAK
+ (LOC CLOTHES-CLOSET)
+ (DESC "cloak")
+ (SYNONYM CLOAK LABEL WRITING)
+ (ADJECTIVE MAGIC)
+ (FLAGS WEARBIT TAKEBIT)
+ (OWNER CLOAK) ;"read writing on cloak"
+ (ACTION CLOAK-F)>
+
+<GLOBAL CLOAK-LOC <>> ;"set to CLOTHES-CLOSET in GO as a default"
+
+<ROUTINE CLOAK-F ()
+ <COND (<VERB? EXAMINE>
+ <COND (<NOUN-USED? ,CLOAK ,W?CLOAK>
+ <TELL
+"The colors of the cloak seem to shimmer like a Mithican chameleon. There's
+a small label with writing on it." CR>)
+ (T
+ <PERFORM ,V?READ ,CLOAK>
+ <RTRUE>)>)
+ (<VERB? READ>
+ <TELL "\"Frobozz Magic Cloak Company.\"" CR>)
+ (<AND <EQUAL? ,HERE ,OUBLIETTE>
+ <VERB? WEAR TAKE-OFF>>
+ <TELL "There's not enough elbow room here." CR>)
+ (<AND <VERB? WEAR>
+ <NOT <EQUAL? ,HERE ,PLAIN>>
+ <NOT <FSET? ,CLOAK ,WORNBIT>>
+ <NOT <FSET? ,OUTER-GATE ,OPENBIT>>
+ <NOT <IN? ,CLOAK ,WALDO>>
+ <NOT ,TIME-STOPPED>>
+ <COND (<EQUAL? ,HERE ,CONSTRUCTION>
+ <STORE ,CONSTRUCTION-OFFSET
+ ,CONSTRUCTION-LOC ,CONSTRUCTION>)
+ (<EQUAL? ,HERE ,FR-OFFICES>
+ <STORE ,OFFICES-OFFSET ,FLOOR-NUMBER ,FR-OFFICES>)
+ (<EQUAL? ,HERE ,OFFICES-NORTH>
+ <STORE ,OFFICES-N-OFFSET ,FLOOR-NUMBER ,OFFICES-NORTH>)
+ (<EQUAL? ,HERE ,OFFICES-SOUTH>
+ <STORE ,OFFICES-S-OFFSET ,FLOOR-NUMBER ,OFFICES-SOUTH>)
+ (<EQUAL? ,HERE ,OFFICES-EAST>
+ <STORE ,OFFICES-E-OFFSET ,FLOOR-NUMBER ,OFFICES-EAST>)
+ (<EQUAL? ,HERE ,OFFICES-WEST>
+ <STORE ,OFFICES-W-OFFSET ,FLOOR-NUMBER ,OFFICES-WEST>)>
+ <FSET ,CLOAK ,WORNBIT>
+ <SETG CLOAK-LOC
+ <COND (<FSET? <LOC ,PROTAGONIST> ,TAKEBIT> ,HERE)
+ (T <LOC ,PROTAGONIST>)>>
+ ;"otherwise you can end up (for example) in toboggan in knight"
+ <MOVE ,PROTAGONIST ,HERE>
+ <SETG RANK <+ </ ,PLAIN-LOC 8> 1>>
+ <SETG FILE <+ <MOD ,PLAIN-LOC 8> 1>>
+ <CAST-HUNGER-SPELL>
+ <TELL
+"As you wrap the cloak around you, the world changes" ,ELLIPSIS>
+ <UNSTORE ,PLAIN-OFFSET ,PLAIN-LOC ,PLAIN>
+ <GOTO ,PLAIN>)
+ (<AND <VERB? TAKE-OFF>
+ <FSET? ,CLOAK ,WORNBIT>
+ <EQUAL? ,HERE ,PLAIN>>
+ <FCLEAR ,CLOAK ,WORNBIT>
+ <STORE ,PLAIN-OFFSET ,PLAIN-LOC ,PLAIN>
+ <TELL
+"As the cloak is removed, the world changes again" ,ELLIPSIS>
+ ;<COND (<AND <EQUAL? ,CLOAK-LOC ,DRAWBRIDGE>
+ <NOT <FSET? ,DRAWBRIDGE ,OPENBIT>>>
+ ;"no longer possible"
+ <JIGS-UP
+"You appear in midair, a few feet above a moat, just about where a drawbridge
+might be if it were open. You thrash about (in a manner that in some later
+era would make animated cartoonists jealous), but despite your best effort,
+you plunge into the moat and are devoured by ravenous alligators.">)>
+ <COND (<EQUAL? ,CLOAK-LOC ,CONSTRUCTION>
+ <SETG RANK <+ </ ,CONSTRUCTION-LOC 8> 1>>
+ <SETG FILE <+ <MOD ,CONSTRUCTION-LOC 8> 1>>
+ <UNSTORE ,CONSTRUCTION-OFFSET
+ ,CONSTRUCTION-LOC ,CLOAK-LOC>)
+ (<OR <EQUAL? ,CLOAK-LOC ,FR-OFFICES
+ ,OFFICES-NORTH ,OFFICES-SOUTH>
+ <EQUAL? ,CLOAK-LOC ,OFFICES-EAST ,OFFICES-WEST>>
+ <OFFICE-UNSTORE ,FLOOR-NUMBER>)>
+ <GOTO ,CLOAK-LOC>
+ <COND (<AND <EQUAL? ,CLOAK-LOC ,ORACLE-OBJECT>
+ <IN? ,RUBY ,DEPRESSION>> ;"yes, this is possible"
+ <TELL
+" You have only a moment to take in your surroundings. ">
+ <PERFORM ,V?ENTER ,ORACLE-OBJECT>)>
+ <RTRUE>)>>
+
+<OBJECT GLOVE
+ (LOC CLOTHES-CLOSET)
+ (DESC "glove")
+ (SYNONYM GLOVE WRITING EMBROIDER)
+ (ADJECTIVE TINY EMBROIDER)
+ (SIZE 3)
+ (FLAGS TAKEBIT WEARBIT READBIT)
+ (OWNER GLOVE) ;"read writing on glove"
+ (ACTION GLOVE-F)>
+
+<ROUTINE GLOVE-F ()
+ <COND (<VERB? EXAMINE>
+ <COND (<AND <FSET? ,GOGGLES ,WORNBIT>
+ <FSET? ,GLOVE ,WORNBIT>>
+ <DISCOVER-X-RAY>
+ <TELL "You can see your hand within the glove." CR>)
+ (<NOUN-USED? ,GLOVE ,W?GLOVE>
+ <TELL
+"Tiny writing is embroidered at the edge of the glove." CR>)
+ (T
+ <PERFORM ,V?READ ,GLOVE>
+ <RTRUE>)>)
+ (<VERB? READ>
+ <TELL "\"Frobozz Magic Glove Company.\"" CR>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT SECRET>
+
+<ROOM BASTION
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Bastion")
+ (LDESC
+"This room occupies a taller tower rising from the corner of the keep.
+The slitted windows are wider here, presumably to accomodate the weaponry
+of the period. The stair winds up and down from here.")
+ (UP TO PARAPET)
+ (DOWN TO SOLAR)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM BASTION)
+ (GLOBAL STAIRS WINDOW)
+ (ICON BASTION-ICON)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-5>)>
+
+<ROOM PARAPET
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Parapet")
+ (LDESC
+"You are on the roof of the tower, a virtual museum of state-of-the-art
+castle defense from the eighth century. A fortified parapet, resting on
+stone corbels, rims the roof. Machicolations, holes between the corbels,
+allow massive weights to be dropped on invaders below. (More often, they
+were dropped rather painfully on the soldier's own toe.) Crenellations
+are spaced around the parapet, providing openings for armaments and
+offering a commanding view of the castle grounds: the main castle just
+below, and beyond the moat, the castle's village and garrison. The sole
+exit is the stairway down.")
+ (DOWN TO BASTION)
+ (FLAGS RLANDBIT OUTSIDEBIT ONBIT)
+ (SYNONYM PARAPET TOWER)
+ (GLOBAL STAIRS MOAT VILLAGE)
+ (ICON PARAPET-ICON)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-5>)
+ (ACTION FLY-ROOM-F)>
+
+<OBJECT MACHICOLATION
+ (LOC PARAPET)
+ (DESC "machicolation")
+ (SYNONYM MACHICOLATION HOLE)
+ (FLAGS NDESCBIT)
+ (ACTION MACHICOLATION-F)>
+
+<ROUTINE MACHICOLATION-F ()
+ <COND (<AND <VERB? PUT PUT-THROUGH>
+ <PRSI? ,MACHICOLATION>>
+ <REMOVE ,PRSO>
+ <COND (<OR <PRSO? ,PERCH>
+ <ULTIMATELY-IN? ,PERCH ,PRSO>>
+ <SETG REMOVED-PERCH-LOC ,GROUND>)>
+ <TELL
+"You hear a distant \"thunk,\" as" T ,PRSO " imbeds itself into the ground.
+The lack of an accompanying distant \"ouch!\" would seem to indicate that
+there are no invaders below." CR>)
+ (<VERB? LOOK-INSIDE>
+ <TELL ,YOU-SEE " light at the bottom of the hole." CR>)
+ (<VERB? REACH-IN>
+ <TELL ,NOTHING-IN-REACH>)>>
+
+<ROOM TOP-OF-STAIR
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Top of Stair")
+ (LDESC
+"A secret passage from the west ends here, at the top of these dark,
+cobwebby stairs.")
+ (WEST TO TEE)
+ (DOWN TO BOTTOM-OF-STAIR)
+ (FLAGS RLANDBIT)
+ (GLOBAL STAIRS)
+ (ICON TOP-OF-STAIR-ICON)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-8>)>
+
+<ROOM BOTTOM-OF-STAIR
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Bottom of Stair")
+ (LDESC
+"You are in the center of a gloomy, north-south passage. A crude
+stairway leads upward.")
+ (NORTH TO OUTSIDE-CRYPT)
+ (SOUTH TO DUNGEON)
+ (UP TO TOP-OF-STAIR)
+ (FLAGS RLANDBIT)
+ (GLOBAL STAIRS)
+ (ICON BOTTOM-OF-STAIR-ICON)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-9>)>
+
+<ROOM OUTSIDE-CRYPT
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Outside Crypt")
+ (LDESC
+"A hall from the south ends here at the entrance to a spooky crypt.")
+ (SOUTH TO BOTTOM-OF-STAIR)
+ (NORTH TO CRYPT)
+ (IN TO CRYPT)
+ (FLAGS RLANDBIT)
+ (GLOBAL CRYPT)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-9>)>
+
+<ROOM CRYPT
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Crypt")
+ (UP TO CHAPEL IF TRAP-DOOR IS OPEN)
+ (DOWN PER ORACLE-ENTER-F)
+ (SOUTH TO OUTSIDE-CRYPT)
+ (OUT TO OUTSIDE-CRYPT)
+ (FLAGS RLANDBIT)
+ (SYNONYM CRYPT TOMB)
+ (ADJECTIVE SPOOKY UNDERGROUND)
+ (GLOBAL TRAP-DOOR SLIME BODIES)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-9>)
+ (ACTION CRYPT-F)>
+
+<ROUTINE CRYPT-F ("OPT" (RARG <>))
+ <COND (<AND ,DEMO-VERSION? <EQUAL? .RARG ,M-END>>
+ <END-DEMO>)
+ (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"The remains of generations of royalty lie arranged on slabs through this
+underground tomb. A passage leads off to the south. In the center of the
+low ceiling is a small trap door, which is ">
+ <OPEN-CLOSED ,TRAP-DOOR>
+ <COND (<FSET? ,HOLEY-SLAB ,TOUCHBIT>
+ <TELL
+". Barely visible beneath one of the slabs, a dark moist opening
+leads downward">)>
+ <TELL ".">)>>
+
+<OBJECT BODIES
+ (LOC LOCAL-GLOBALS)
+ (DESC "bodies")
+ (SYNONYM BODIES REMAINS)
+ (FLAGS PLURALBIT NDESCBIT NARTICLEBIT)
+ (ACTION BODIES-F)>
+
+<ROUTINE BODIES-F ()
+ <COND (<TOUCHING? ,BODIES>
+ <PERFORM-PRSA ,BONES>)>>
+
+<ROUTINE ORACLE-ENTER-F ("OPTIONAL" (RARG <>)) ;"called by NEXT-ROOM?"
+ <COND (<OR <FSET? ,OUTER-GATE ,OPENBIT>
+ ,TIME-STOPPED>
+ <COND (<NOT .RARG>
+ <RETURN-FROM-MAP>
+ <TELL "The hole under the slab has vanished!" CR>)>
+ <RFALSE>)
+ (<FSET? ,HOLEY-SLAB ,TOUCHBIT>
+ ,ORACLE)
+ (T
+ <COND (<NOT .RARG>
+ <CANT-GO>)>
+ <RFALSE>)>>
+
+<OBJECT FLATTEST-SLAB
+ (LOC CRYPT)
+ (DESC "flattest slab")
+ (SYNONYM SLAB)
+ (ADJECTIVE FLATTEST)
+ (FLAGS NDESCBIT)
+ (ACTION SLAB-F)>
+
+<OBJECT SHORTEST-SLAB
+ (LOC CRYPT)
+ (DESC "shortest slab")
+ (SYNONYM SLAB)
+ (ADJECTIVE SHORTEST)
+ (FLAGS NDESCBIT)
+ (ACTION SLAB-F)>
+
+<OBJECT LONGEST-SLAB
+ (LOC CRYPT)
+ (DESC "longest slab")
+ (SYNONYM SLAB)
+ (ADJECTIVE LONGEST)
+ (FLAGS NDESCBIT)
+ (ACTION SLAB-F)>
+
+<OBJECT DUSTIEST-SLAB
+ (LOC CRYPT)
+ (DESC "dustiest slab")
+ (SYNONYM SLAB)
+ (ADJECTIVE DUSTIEST)
+ (FLAGS NDESCBIT)
+ (ACTION SLAB-F)>
+
+<OBJECT DARKEST-SLAB
+ (LOC CRYPT)
+ (DESC "darkest slab")
+ (SYNONYM SLAB)
+ (ADJECTIVE DARKEST)
+ (FLAGS NDESCBIT)
+ (ACTION SLAB-F)>
+
+<OBJECT OLDEST-SLAB
+ (LOC CRYPT)
+ (DESC "oldest slab")
+ (SYNONYM SLAB)
+ (ADJECTIVE OLDEST)
+ (FLAGS NDESCBIT)
+ (ACTION SLAB-F)>
+
+<OBJECT NEWEST-SLAB
+ (LOC CRYPT)
+ (DESC "newest slab")
+ (SYNONYM SLAB)
+ (ADJECTIVE NEWEST)
+ (FLAGS NDESCBIT)
+ (ACTION SLAB-F)>
+
+<ROUTINE SLAB-F ()
+ <COND (<AND <VERB? LOOK-UNDER>
+ <PRSO? ,HOLEY-SLAB>>
+ <COND (<OR <FSET? ,OUTER-GATE ,OPENBIT>
+ ,TIME-STOPPED>
+ <DO-WALK ,P?DOWN>)
+ (T
+ <FSET ,HOLEY-SLAB ,TOUCHBIT>
+ <SETG COMPASS-CHANGED T>
+ <TELL
+"Under the slab is a craggy hole, dripping with slime, leading
+downward. It looks just barely large enough to enter." CR>)>)>>
+
+<GLOBAL HOLEY-SLAB <>>
+
+<CONSTANT SLAB-TABLE
+ <PTABLE FLATTEST-SLAB
+ SHORTEST-SLAB
+ LONGEST-SLAB
+ DUSTIEST-SLAB
+ DARKEST-SLAB
+ OLDEST-SLAB
+ NEWEST-SLAB>>
+
+<OBJECT TRAP-DOOR
+ (LOC LOCAL-GLOBALS)
+ (DESC "trap door")
+ (SYNONYM DOOR TRAPDOOR)
+ (ADJECTIVE SMALL TRAP)
+ (FLAGS DOORBIT)
+ (ACTION TRAP-DOOR-F)>
+
+<ROUTINE TRAP-DOOR-F ()
+ <COND (<AND <VERB? OPEN>
+ <NOT <FSET? ,TRAP-DOOR ,OPENBIT>>
+ <EQUAL? ,HERE ,CRYPT>>
+ <TELL "The trap door can't be opened from this side." CR>)>>
+
+<ROOM DUNGEON
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Dungeon")
+ (LDESC
+"A century's worth of prisoners have languished in this dismal prison.
+In addition to a hole in the floor, passages lead north, southeast, and
+southwest.")
+ (NORTH TO BOTTOM-OF-STAIR)
+ (DOWN TO OUBLIETTE)
+ (SE TO CELL)
+ (SW TO TORTURE-CHAMBER)
+ (FLAGS RLANDBIT)
+ (SYNONYM DUNGEON)
+ (ICON DUNGEON-ICON)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-9>)>
+
+<OBJECT DUNGEON-HOLE
+ (LOC DUNGEON)
+ (DESC "hole")
+ (SYNONYM HOLE)
+ (ADJECTIVE SMALL)
+ (FLAGS NDESCBIT)
+ (OWNER GROUND)
+ (ACTION DUNGEON-HOLE-F)>
+
+<ROUTINE DUNGEON-HOLE-F ()
+ <COND (<VERB? LOOK-INSIDE>
+ <COND (<LIT? ,OUBLIETTE>
+ <TELL ,SOME-LIGHT>)
+ (T
+ <TELL ,ONLY-BLACKNESS>)>)
+ (<VERB? PUT>
+ <COND (<G? <GETP ,PRSO ,P?SIZE> 4>
+ <COND (<OR <PRSO? ,PERCH>
+ <ULTIMATELY-IN? ,PERCH ,PRSO>>
+ <SETG REMOVED-PERCH-LOC ,OUBLIETTE>)>
+ <REMOVE ,PRSO>)
+ (T
+ <MOVE ,PRSO ,OUBLIETTE>)>
+ <TELL "Done." CR>)
+ (<VERB? EXAMINE>
+ <TELL
+"It's big enough to drop through, but a return trip doesn't look
+at all assured." CR>)
+ (<VERB? REACH-IN>
+ <TELL ,NOTHING-IN-REACH>)
+ (<VERB? ENTER>
+ <DO-WALK ,P?DOWN>)>>
+
+<ROOM OUBLIETTE
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Oubliette")
+ (UP SORRY "You're trapped.")
+ (OUT SORRY "You're trapped.")
+ (FLAGS RLANDBIT)
+ (SYNONYM OUBLIETTE)
+ (RIDDLE
+"I look just like my brother; we have the same father and mother! We're
+identical in every way; we were born on the very same day. I'm younger
+by seconds, but as everyone reckons, I'm not a twin, and never have been.
+What am I?\"")
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-9>)
+ (ACTION OUBLIETTE-F)>
+
+<GLOBAL OUBLIETTE-SCORE 20>
+
+<ROUTINE OUBLIETTE-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"You're trapped in a narrow prison cell accessible only from above. The
+upper portion of the cell is lost in gloom. The floor is muddy, and you
+sink almost to your ">
+ <COND (,ALLIGATOR
+ <TELL "alligatorish nostrils.">)
+ (T
+ <TELL "knees.">)>)
+ (<AND <EQUAL? .RARG ,M-ENTER>
+ <NOT ,TIME-STOPPED>>
+ <SETG DO-J T>
+ <QUEUE I-JESTER 3>)
+ (<AND <EQUAL? .RARG ,M-END>
+ <IN? ,JESTER ,HERE>>
+ <SETUP-ORPHAN "answer">)>>
+
+<OBJECT TRIPLET
+ (LOC GLOBAL-OBJECTS)
+ (DESC "triplet")
+ (SYNONYM TRIPLET TRIPLETS QUADRUPLET QUINTUPLET)>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT SEAMANS-CAP
+ (LOC OUBLIETTE)
+ (DESC "seaman's cap")
+ (FDESC
+"The last prisoner in the oubliette must have been a sailor; an old seaman's
+cap lies discarded in the corner.")
+ (SYNONYM CAP HAT)
+ (ADJECTIVE OLD SEAMAN\'S SEAMAN)
+ (FLAGS TAKEBIT WEARBIT MAGICBIT)
+ (GENERIC G-HAT-F)
+ (VALUE 12)>
+
+<ROUTINE G-HAT-F (TBL LEN)
+ <COND (<INTBL? ,DOORBELL <REST-TO-SLOT .TBL FIND-RES-OBJ1>
+ <FIND-RES-COUNT .TBL>>
+ ;"confusion was between door bell and bell on jester's hat"
+ ,DOORBELL)
+ (<VERB? TAKE-OFF REMOVE>
+ <COND (<AND <FSET? ,HARDHAT ,WORNBIT>
+ <FSET? ,SEAMANS-CAP ,WORNBIT>>
+ <RFALSE>)
+ (<FSET? ,HARDHAT ,WORNBIT>
+ ,HARDHAT)
+ (<FSET? ,SEAMANS-CAP ,WORNBIT>
+ ,SEAMANS-CAP)
+ (T
+ <RFALSE>)>)
+ (<AND <INTBL? ,J-HAT <REST-TO-SLOT .TBL FIND-RES-OBJ1>
+ <FIND-RES-COUNT .TBL>>
+ <EQUAL? ,HERE ,GAMING-ROOM>>
+ ,J-HAT)
+ (T
+ <RFALSE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT SECRET>
+
+<ROOM CELL
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Cell")
+ (NW TO DUNGEON)
+ (OUT TO DUNGEON)
+ (FLAGS RLANDBIT)
+ (SYNONYM CELL)
+ (ICON CELL-ICON)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-10>)
+ (ACTION CELL-F)>
+
+<ROUTINE CELL-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"This cell is the height of luxury for this dungeon -- the floor isn't
+covered with spikes, and there are actually a few corners which aren't
+dominated by giant spiders.">
+ <COND (<IN? ,COBWEBS ,HERE>
+ <TELL " " ,CELL-WALL-DESC>)>
+ <TELL " The only exit is northwest.">)>>
+
+<OBJECT GIANT-SPIDERS
+ (LOC CELL)
+ (DESC "giant spider")
+ (SYNONYM SPIDER SPIDERS)
+ (ADJECTIVE LARGE)
+ (FLAGS NDESCBIT)
+ (ACTION GIANT-SPIDERS-F)>
+
+<ROUTINE GIANT-SPIDERS-F ()
+ <COND (<TOUCHING? ,GIANT-SPIDERS>
+ <TELL
+"There's only one thing you need to remember in connection with giant spiders:
+You leave them alone, they'll leave you alone." CR>)>>
+
+<OBJECT COBWEBS
+ (LOC CELL)
+ (DESC "cobwebs")
+ (SYNONYM COBWEBS WEB COBWEB WEBS)
+ (ADJECTIVE THICK)
+ (FLAGS NDESCBIT NARTICLEBIT PLURALBIT)
+ (ACTION COBWEBS-F)>
+
+<ROUTINE COBWEBS-F ()
+ <COND (<VERB? ENTER>
+ <TELL
+"Walk face first into a thick wall of yukko cobwebs? Mucho disgusto! Maybe if
+you cleared them away, first..." CR>)
+ (<VERB? REMOVE TAKE-WITH CLEAN MOVE>
+ <COND (<AND <NOT ,PRSI>
+ <ULTIMATELY-IN? ,BROOM>>
+ <SETG PRSI ,BROOM>)>
+ <COND (<NOT ,PRSI>
+ <TELL "Yuk! Bleh! Ukky-poo! T">
+ <COND (<NOT <FSET? ,GLOVE ,WORNBIT>>
+ <TELL
+"hese cobwebs are way too gross to touch with your
+bare hands. Furthermore, t">)>
+ <TELL
+"here are way too many to clean away without some
+kind of cleaning accessory." CR>)
+ (<NOT <PRSI? ,BROOM>>
+ <TELL
+"Don't bother to apply for any jobs as a maid." CR>)
+ (T
+ <REMOVE ,COBWEBS>
+ <THIS-IS-IT ,FLASK>
+ <MOVE ,FLASK ,HERE>
+ <TELL
+"It's a dirty job, but someone's gotta do it. You clear away most
+of the cobwebs, revealing a blank wall. Sitting at the base of the
+wall is a " 'FLASK "!" CR>
+ <INC-SCORE 12>)>)>>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT FLASK
+ (DESC "stoppered glass flask filled with liquid")
+ (LDESC
+"A stoppered glass flask with a skull-and-crossbones marking is here.
+The flask is filled with some clear liquid.")
+ (SYNONYM FLASK)
+ (ADJECTIVE GLASS)
+ (FLAGS TAKEBIT TRANSBIT READBIT MAGICBIT SEARCHBIT)
+ (CAPACITY 5)
+ (SIZE 5)
+ (VALUE 0) ;"12 points given elsewhere"
+ (TEXT "There is a skull-and-crossbones engraved on the glass.")
+ (ACTION FLASK-F)>
+
+<ROUTINE FLASK-F ()
+ <COND (<VERB? LOOK-INSIDE>
+ <TELL
+"You notice that objects behind the flask appear to be magnified." CR>)
+ (<AND <VERB? EXAMINE>
+ <EQUAL? ,PRSI ,FLASK>>
+ <TELL
+"The flask distorts and magnifies the " D ,PRSO ", showing details
+not noticed earlier." CR " ">
+ <RFALSE>)
+ (<VERB? DRINK-FROM>
+ <DO-FIRST "open" ,FLASK>)
+ (<VERB? OPEN MUNG THROW>
+ <COND (<NOT <VERB? OPEN>>
+ <TELL "The flask breaks into pieces. ">)
+ (T
+ <TELL "You remove the stopper. ">)>
+ <TELL
+"As you pass out, you realize that the vapors from the
+flask's contents are ">
+ <COND (<FSET? ,CLOWN-NOSE ,WORNBIT>
+ <TELL
+"potent enough to get past your clown nose, and are also quite ">)>
+ <JIGS-UP "fatal.">)>>
+
+<OBJECT LIQUID
+ (LOC FLASK)
+ (DESC "clear liquid")
+ (SYNONYM LIQUID)
+ (ADJECTIVE CLEAR)
+ (FLAGS NDESCBIT)
+ (ACTION LIQUID-F)>
+
+<ROUTINE LIQUID-F ()
+ <COND (<VERB? DRINK>
+ <DO-FIRST "open" ,FLASK>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT SECRET>
+
+<ROOM TORTURE-CHAMBER
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Torture Chamber")
+ (LDESC
+"This room contains all your standard torture devices: an iron maiden,
+a water chamber, a snake pit, a comfy chair, and so forth. The only
+obvious exit is northeast.")
+ (NE TO DUNGEON)
+ (OUT TO DUNGEON)
+ (FLAGS RLANDBIT)
+ (SYNONYM CHAMBER)
+ (ADJECTIVE TORTURE)
+ (MAP-LOC <PTABLE SECRET-WING-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-8>)
+ (ACTION TORTURE-CHAMBER-F)>
+
+<ROUTINE TORTURE-CHAMBER-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-ENTER>
+ <COND (<NOT ,METRONOME-LOC>
+ <SETG METRONOME-LOC <COND (<PROB 33> ,IRON-MAIDEN)
+ (<PROB 50> ,SNAKE-PIT)
+ (T ,WATER-CHAMBER)>>)>
+ <SETG METRONOME-COUNTER 0>)
+ (<AND <EQUAL? .RARG ,M-END>
+ <FSET? ,METRONOME ,TRYTAKEBIT>>
+ <METRONOME-TORTURE T>)>>
+
+<ROUTINE METRONOME-TORTURE ("OPTIONAL" (INDENT <>))
+ <SETG METRONOME-COUNTER <+ ,METRONOME-COUNTER 1>>
+ <COND (<EQUAL? ,METRONOME-COUNTER 1>
+ <RFALSE>)>
+ <RETURN-FROM-MAP>
+ <COND (.INDENT
+ <TELL " ">)>
+ <COND (<EQUAL? ,METRONOME-COUNTER 2>
+ <TELL "You hear a ticking sound." CR>)
+ (<EQUAL? ,METRONOME-COUNTER 3>
+ <TELL "The ticking grows louder." CR>)
+ (<EQUAL? ,METRONOME-COUNTER 4>
+ <TELL
+"The ticking is really getting to you. It seems to be
+controlling your heartbeat!" CR>)
+ (T
+ <TELL
+"The ticking is unbearably deafening! You run screaming from
+the Torture Chamber!" CR CR>
+ <GOTO ,DUNGEON>)>>
+
+<BEGIN-SEGMENT 0>
+
+<GLOBAL METRONOME-LOC <>>
+
+<GLOBAL METRONOME-COUNTER 0>
+
+<GLOBAL METRONOME-ON <>>
+
+<OBJECT METRONOME
+ (DESC "metronome")
+ (SYNONYM METRONOME)
+ (FLAGS TAKEBIT TRYTAKEBIT MAGICBIT)
+ (VALUE 0) ;"12 points given elsewhere"
+ (ACTION METRONOME-F)>
+
+<ROUTINE METRONOME-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL "The metronome is">
+ <COND (,METRONOME-ON
+ <TELL " ticking insistently." CR>)
+ (T
+ <TELL "n't on." CR>)>)
+ (<VERB? ON>
+ <COND (,METRONOME-ON
+ <TELL "It is!" CR>)
+ (T
+ <SETG METRONOME-ON T>
+ <QUEUE I-METRONOME -1>
+ <TELL "The metronome begins to tick." CR>)>)
+ (<VERB? OFF>
+ <COND (,METRONOME-ON
+ <SETG METRONOME-ON <>>
+ <DEQUEUE I-METRONOME>
+ <TELL "The metronome stops ticking." CR>)
+ (T
+ <TELL "It is!" CR>)>)>>
+
+<ROUTINE I-METRONOME ("OPTIONAL" (CALLED-BY-LISTEN <>) "AUX" CNT)
+ <COND (<EQUAL? <LOC ,METRONOME> <>>
+ <DEQUEUE I-METRONOME>)>
+ <COND (<AND <VISIBLE? ,METRONOME>
+ <NOT <EQUAL? ,CURRENT-SPLIT ,MAP-TOP-LEFT-LOC>>>
+ <SET CNT <+ 3 <RANDOM 30>>>
+ <COND (<NOT .CALLED-BY-LISTEN>
+ <TELL " ">)>
+ <TELL "The metronome insistently declares, \"Tick">
+ <REPEAT ()
+ <TELL ", tick">
+ <SET CNT <- .CNT 1>>
+ <COND (<EQUAL? .CNT 0>
+ <RETURN>)>>
+ <TELL ".\"" CR>)
+ (T
+ <RFALSE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT SECRET>
+
+<OBJECT COMFY-CHAIR
+ (LOC TORTURE-CHAMBER)
+ (DESC "comfy chair")
+ (SYNONYM CHAIR)
+ (ADJECTIVE COMFY)
+ (FLAGS NDESCBIT CONTBIT INBIT SEARCHBIT VEHBIT SURFACEBIT OPENBIT)
+ (ACTION TORTURE-DEVICE-F)>
+
+<OBJECT IRON-MAIDEN
+ (LOC TORTURE-CHAMBER)
+ (DESC "iron maiden")
+ (SYNONYM MAIDEN)
+ (ADJECTIVE IRON)
+ (FLAGS NDESCBIT VOWELBIT INBIT CONTBIT SEARCHBIT VEHBIT)
+ (ACTION TORTURE-DEVICE-F)>
+
+<OBJECT WATER-CHAMBER
+ (LOC TORTURE-CHAMBER)
+ (DESC "water chamber")
+ (SYNONYM CHAMBER)
+ (ADJECTIVE WATER)
+ (FLAGS NDESCBIT CONTBIT INBIT SEARCHBIT VEHBIT)
+ (ACTION TORTURE-DEVICE-F)>
+
+<OBJECT SNAKE-PIT
+ (LOC TORTURE-CHAMBER)
+ (DESC "snake pit")
+ (SYNONYM PIT LID)
+ (ADJECTIVE SNAKE)
+ (FLAGS NDESCBIT CONTBIT INBIT SEARCHBIT VEHBIT)
+ (ACTION TORTURE-DEVICE-F)>
+
+<OBJECT THOUSANDS-OF-SNAKES
+ (LOC SNAKE-PIT)
+ (DESC "writhing mass of snakes")
+ (SYNONYM SNAKE MASS)
+ (ADJECTIVE WRITHING)>
+
+<ROUTINE TORTURE-DEVICE-F ()
+ <COND (<VERB? ENTER>
+ <COND (<AND <NOT <PRSO? ,COMFY-CHAIR>>
+ <NOT <FSET? ,PRSO ,OPENBIT>>>
+ <DO-FIRST "open" ,PRSO>
+ <RTRUE>)>
+ <TELL "You climb into the " 'PRSO ". ">
+ <COND (<PRSO? ,COMFY-CHAIR>
+ <JIGS-UP
+"It's so, so comfy that you can't get up, and you sit there comfortably
+until you starve to death.">)
+ (<PRSO? ,IRON-MAIDEN>
+ <JIGS-UP
+"It shuts around you, piercing you with its sharp spikes.">)
+ (<PRSO? ,WATER-CHAMBER>
+ <JIGS-UP
+"Immediately, the chamber locks behind you, and water begins
+rhythmically dripping onto your head. Sometime later you go mad,
+and rip yourself into small pieces.">)
+ (T
+ <JIGS-UP
+"A thousand snakes converge on you. In their overeagerness to dine,
+they skip right over the part where they kill you, and instead get
+right to the part where they eat you.">)>)
+ (<VERB? EXAMINE>
+ <COND (<PRSO? ,COMFY-CHAIR>
+ <TELL "It sure looks comfortable!" CR>
+ <RTRUE>)
+ (<PRSO? ,WATER-CHAMBER>
+ <TELL
+"It's a small chamber where water is slowly dripped onto the victim's head
+until he or she goes mad.">)
+ (<PRSO? ,IRON-MAIDEN>
+ <TELL
+"It's similar to a suit of armor, except that the inside is
+lined with sharp spikes.">)
+ (T
+ <COND (<NOT <FSET? ,SNAKE-PIT ,OPENBIT>>
+ <TELL "Beneath the lid of the snake pit y">)
+ (T
+ <TELL "Y">)>
+ <TELL
+"ou hear the hissing of a thousand hungry snakes.">)>
+ <TELL " The " 'PRSO " is ">
+ <OPEN-CLOSED ,PRSO>
+ <TELL ,PERIOD-CR>)
+ (<AND <VERB? LOOK-INSIDE>
+ <FSET? ,METRONOME ,TRYTAKEBIT>>
+ <COND (<PRSO? ,METRONOME-LOC>
+ <PERFORM ,V?OPEN ,PRSO>
+ <RTRUE>)
+ (<PRSO? ,COMFY-CHAIR>
+ <TELL "There's no one in the chair." CR>)
+ (T
+ <FSET ,PRSO ,OPENBIT>
+ <TELL
+"You open" T ,PRSO ", and find no one within." CR>)>)
+ (<AND <VERB? OPEN>
+ <PRSO? ,METRONOME-LOC>
+ <FSET? ,METRONOME ,TRYTAKEBIT>>
+ <FCLEAR ,METRONOME ,TRYTAKEBIT>
+ <MOVE ,METRONOME ,HERE>
+ <FSET ,PRSO ,OPENBIT>
+ <TELL
+"As you open the " 'PRSO ", a metronome falls from the shadowy recesses
+of the ceiling and lands with a muffled thud in the center of the room.">
+ <COND (<G? ,METRONOME-COUNTER 1>
+ <TELL
+" Thankfully, the fall seems to have shut it off.">)>
+ <CRLF>
+ <INC-SCORE 12>)
+ (<AND <VERB? OPEN>
+ ,TIME-STOPPED>
+ <TELL ,WONT-BUDGE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT CASTLE>
+
+;"west wing"
+
+<ROOM WEST-HALL
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "West Hall")
+ (WEST TO WEST-WING IF WEST-DOOR IS OPEN)
+ (NE TO FORMAL-GARDEN)
+ (FLAGS RLANDBIT ONBIT)
+ (GLOBAL WEST-DOOR LOCK-OBJECT)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-3>)
+ (ACTION WEST-HALL-F)>
+
+<ROUTINE WEST-HALL-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"The castle's newest wing can be found beyond the huge oak door which lies ">
+ <OPEN-CLOSED ,WEST-DOOR>
+ <TELL " to the west. The only other exit is northeast.">)>>
+
+<OBJECT WEST-DOOR
+ (LOC LOCAL-GLOBALS)
+ (DESC "door")
+ (SYNONYM DOOR)
+ (ADJECTIVE LARGE OAK)
+ (FLAGS DOORBIT LOCKEDBIT)
+ (ACTION WEST-DOOR-F)>
+
+<ROUTINE WEST-DOOR-F ()
+ <COND (<AND <VERB? UNLOCK>
+ <FSET? ,WEST-DOOR ,LOCKEDBIT>
+ <PRSI? ,WEST-KEY>>
+ <FCLEAR ,WEST-DOOR ,LOCKEDBIT>
+ <LOCKED-UNLOCKED ,WEST-DOOR T>)
+ (<AND <VERB? LOCK>
+ <NOT <FSET? ,WEST-DOOR ,LOCKEDBIT>>
+ <PRSI? ,WEST-KEY>>
+ <FSET ,WEST-DOOR ,LOCKEDBIT>
+ <LOCKED-UNLOCKED ,WEST-DOOR>)>>
+
+<ROOM WEST-WING
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "West Wing")
+ (EAST TO WEST-HALL IF WEST-DOOR IS OPEN)
+ (WEST PER DIRIGIBLE-HANGAR-ENTER-F)
+ (NORTH TO PEG-ROOM)
+ (SOUTH TO GYM)
+ (FLAGS RLANDBIT ONBIT)
+ (GLOBAL WEST-DOOR LOCK-OBJECT)
+ (VALUE 8)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-2>)
+ (ICON WEST-WING-ICON)
+ (ACTION WEST-WING-F)>
+
+<ROUTINE WEST-WING-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"This wing exhibits more recent styling: smoothly dressed stone inlaid with
+marble patterns. Through the ">
+ <OPEN-CLOSED ,WEST-DOOR>
+ <TELL
+" oak door to the east lie the primary halls of the castle. Other exits lead
+north, west, and south. " ,FUDGE>)>>
+
+<GLOBAL NUT-OPENED <>>
+
+<GLOBAL NUT-SHOWN <>>
+
+<GLOBAL NUT-EATEN <>>
+
+<GLOBAL J-DISPOSED 0>
+
+<ROUTINE DIRIGIBLE-HANGAR-ENTER-F ("OPT" (RARG <>)) ;"called by NEXT-ROOM?"
+ <COND (,NUT-EATEN
+ ,DIRIGIBLE-HANGAR)
+ (.RARG
+ <RFALSE>)
+ (<NOT <IN? ,JESTER ,HERE>>
+ <RETURN-FROM-MAP>
+ <TELL "An invisible hand seems to stop you">
+ <COND (<L? <- ,MOVES ,J-DISPOSED> 4>
+ <TELL
+", and a familiar voice says, \"Surely you didn't think you'd
+be rid of me so easily!\"" CR>)
+ (T
+ <TELL ,PERIOD-CR>)>
+ <SETG DO-J T>
+ <I-JESTER>
+ <RFALSE>)
+ (T
+ <RETURN-FROM-MAP>
+ <TELL ,ERE-YOU-PASS>
+ <RFALSE>)>>
+\
+;"peggleboz"
+
+<ROOM PEG-ROOM
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Peg Room")
+ (OUT TO WEST-WING)
+ (SOUTH TO WEST-WING)
+ (NORTH TO GAMING-ROOM IF PEG-PASSAGE-OPENED)
+ (FLAGS RLANDBIT ONBIT)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-2>)
+ (ICON PEG-ROOM-ICON)
+ (ACTION PEG-ROOM-F)>
+
+<ROUTINE PEG-ROOM-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"You're in a nondescript room with an exit to the south. ">
+ <COND (,PEG-PASSAGE-OPENED
+ <TELL "A previously hidden passage leads north. ">)>
+ <TELL
+"In the center of the room is a pegboard. Hanging on the wall are a set of
+instructions.">)>>
+
+<OBJECT PBOZ-OBJECT
+ (LOC GLOBAL-OBJECTS)
+ (DESC "Peggleboz")
+ (SYNONYM PEGGLEBOZ)
+ (ADJECTIVE GUSTAV)
+ (RESEARCH
+"\"Peggleboz, a popular game of jumping pegs, is named after its creator,
+Gustav Peggleboz (399 - 456 GUE).\"")
+ (ACTION PBOZ-OBJECT-F)>
+
+<ROUTINE PBOZ-OBJECT-F ()
+ <COND (<VERB? PLAY>
+ <COND (<EQUAL? ,HERE ,PEG-ROOM>
+ <PEG-GAME>
+ <RTRUE>)
+ (T
+ <TELL
+,YOU-CANT "play Peggleboz without a pegboard!" CR>)>)>>
+
+<OBJECT PEGBOARD
+ (LOC PEG-ROOM)
+ (DESC "pegboard")
+ (SYNONYM BOARD PEGBOARD)
+ (ADJECTIVE PEG)
+ (FLAGS NDESCBIT TRYTAKEBIT)
+ (ACTION PEGBOARD-F)>
+
+<ROUTINE PEGBOARD-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"The board has 21 holes, 20 of them filled with pegs. The holes are
+arranged in a roughly triangular shape." CR>)
+ (<VERB? TAKE>
+ <TELL
+"The pegboard is an unmovable feature of the room." CR>)>>
+
+<OBJECT PEGBOARD-PEGS
+ (LOC PEG-ROOM)
+ (DESC "peg")
+ (SYNONYM PEG)
+ (FLAGS NDESCBIT TRYTAKEBIT)
+ (ACTION PEGBOARD-PEGS-F)>
+
+<ROUTINE PEGBOARD-PEGS-F ()
+ <COND (<VERB? MOVE TAKE>
+ <TELL
+"It would behoove you to read the instructions that are posted on the wall
+here." CR>)>>
+
+<OBJECT SET-OF-INSTRUCTIONS
+ (LOC PEG-ROOM)
+ (OWNER SET-OF-INSTRUCTIONS)
+ (DESC "set of instructions")
+ (SYNONYM SET INSTRUCTIONS RULES)
+ (FLAGS NDESCBIT READBIT)
+ (TEXT
+"\"Rules for PEGGLEBOZ:|
+1. Pegs can only move by jumping another peg.|
+2. Pegs can only jump one peg per move.|
+3. Pegs jumped are removed.|
+4. Your goal is to end up with one peg in the starting hole.|
+5. To begin, simply type PLAY PEGGLEBOZ!\"")>
+
+<CONSTANT PBOZ-PICSET-TBL
+ <TABLE UNHL-PEG
+ HL-PEG
+ BG-A
+ BG-B
+ BG-C
+ BG-D
+ BG-E
+ BG-F
+ BG-G
+ BG-H
+ BG-I
+ BG-J
+ BG-K
+ BG-L
+ BG-M
+ BG-N
+ BG-O
+ BG-P
+ BG-Q
+ BG-R
+ BG-S
+ BG-T
+ BG-U
+ RESTART-BOX
+ EXIT-BOX
+ SHOW-MOVES-BOX
+ DIM-RESTART-BOX
+ DIM-SHOW-MOVES-BOX
+ 0>>
+
+<ROUTINE PEG-GAME ("AUX" (FIRST-MOVE T) (PEG-SELECTED <>) CHAR JUMPED-PEG
+ (DONT-CLEAR <>) (WON <>) CNT)
+ <CLEAR ,S-FULL>
+ <SPLIT-BY-PICTURE ,PBOZ-SPLIT T>
+ <ADJUST-TEXT-WINDOW ,PBOZ-BOTTOM>
+ <SETUP-PBOZ>
+ <REPEAT ()
+ <COND (.WON T)
+ (.PEG-SELECTED
+ <COND (<NOT .DONT-CLEAR>
+ <CLEAR ,S-TEXT>)
+ (T
+ <SET DONT-CLEAR <>>)>
+ <TELL "You are moving the peg at letter ">
+ <HLIGHT ,H-BOLD>
+ <TELL C <+ ,LETTER-OFFSET .PEG-SELECTED>>
+ <HLIGHT ,H-NORMAL>
+ <TELL
+". Select the letter for the destination point of that peg, or hit ">
+ <HLIGHT ,H-BOLD>
+ <TELL C <+ ,LETTER-OFFSET .PEG-SELECTED>>
+ <HLIGHT ,H-NORMAL>
+ <TELL " again to \"unselect\" that peg.">)
+ (T
+ <COND (<AND <NOT .FIRST-MOVE>
+ <NOT .DONT-CLEAR>>
+ <CLEAR ,S-TEXT>)>
+ <COND (<NOT .DONT-CLEAR>
+ <COND (<EQUAL? <PEG-COUNT> 1>
+ <TELL
+"Type X to exit, Y to display your moves, and Z to start again">
+ <COND (,ACTIVE-MOUSE
+ <TELL
+" (or simply click on the appropriate spot with your mouse)">)>
+ <TELL ".">)
+ (T
+ <TELL
+"Type the letter corresponding to the peg you'd like to move">
+ <COND (,ACTIVE-MOUSE
+ <TELL
+", or use your mouse to click on it">)>
+ <TELL ".">
+ <COND (.FIRST-MOVE
+ <SET FIRST-MOVE <>>
+ <TELL
+" Type X to exit Peggleboz, Y to display your moves so far, Z to reset the
+board">
+ <COND (,ACTIVE-MOUSE
+ <TELL
+" (or you can use your mouse to click on the appropriate spot)">)>
+ <TELL ".">)>)>)>)>
+ <SET DONT-CLEAR <>>
+ <SET CHAR
+ <COND (.PEG-SELECTED
+ <BLINK ,UNHL-PEG ,HL-PEG
+ <GET ,BOARD-TABLE <* .PEG-SELECTED 2>>
+ <GET ,BOARD-TABLE <+ <* .PEG-SELECTED 2> 1>>
+ ,S-WINDOW>)
+ (T
+ <COND (,DEMO-VERSION?
+ <INPUT-DEMO 1>)
+ (T
+ <INPUT 1>)>)>>
+ <MOUSE-INPUT?>
+ <COND (<EQUAL? .CHAR ,CLICK1 ,CLICK2>
+ <SET CHAR <PBOZ-CLICK>>)>
+ <COND (<AND <G? .CHAR 96>
+ <L? .CHAR 123>> ;"convert lower to upper case"
+ <SET CHAR <- .CHAR 32>>)>
+ <COND (<EQUAL? .CHAR !\X>
+ <RESET-PEGBOARD>
+ <INIT-SL-WITH-SPLIT ,TEXT-WINDOW-PIC-LOC>
+ <CLEAR ,S-TEXT>
+ <RETURN>)
+ (<EQUAL? .CHAR !\Y>
+ <SET DONT-CLEAR T>
+ <DISPLAY-MOVES>)
+ (<EQUAL? .CHAR !\Z>
+ <RESET-PEGBOARD>
+ <SET WON <>>
+ <SET CNT 4>
+ <SCREEN ,S-WINDOW>
+ <DRAW-PEGS>
+ <SCREEN ,S-TEXT>
+ <CLEAR ,S-TEXT>
+ <SET PEG-SELECTED <>>)
+ (<NOT .PEG-SELECTED>
+ <SET PEG-SELECTED <- .CHAR 64>>
+ <COND (<OR <G? .PEG-SELECTED 21>
+ <L? .PEG-SELECTED 1>>
+ <CLEAR ,S-TEXT>
+ <SOUND 1>
+ <SET PEG-SELECTED <>>
+ <SET DONT-CLEAR T>
+ <TELL
+"Illegal choice. Type a letter from A thru U to select a peg. Or, type X
+to exit, Y to display your moves, or Z to reset the board.">)
+ (<EQUAL? <GET ,PEG-TABLE .PEG-SELECTED> 0>
+ <CLEAR ,S-TEXT>
+ <SOUND 1>
+ <SET DONT-CLEAR T>
+ <TELL
+"There's no peg at point " C <+ ,LETTER-OFFSET .PEG-SELECTED> ".">
+ <SET PEG-SELECTED <>>)>)
+ (<EQUAL? .PEG-SELECTED <- .CHAR 64>>
+ <SET DONT-CLEAR T>
+ <SET PEG-SELECTED <>>
+ <CLEAR ,S-TEXT>
+ <TELL "Unselected.">)
+ (<SET JUMPED-PEG <LEGAL-MOVE .PEG-SELECTED .CHAR>>
+ ;"record move for later display"
+ <PUT ,PEG-MOVE-TABLE ,PEG-MOVE-NUMBER .PEG-SELECTED>
+ <PUT ,PEG-MOVE-TABLE <+ ,PEG-MOVE-NUMBER 1>
+ <- .CHAR 64>>
+ <SETG PEG-MOVE-NUMBER <+ ,PEG-MOVE-NUMBER 2>>
+ ;"record move in storage tables"
+ <PUT ,PEG-TABLE .JUMPED-PEG 0>
+ <PUT ,PEG-TABLE .PEG-SELECTED 0>
+ <PUT ,PEG-TABLE <- .CHAR 64> 1>
+ <SCREEN ,S-WINDOW>
+ <DISPLAY <GET ,PEG-BG-PIC-TBL .PEG-SELECTED>
+ <GET ,BOARD-TABLE <* .PEG-SELECTED 2>>
+ <GET ,BOARD-TABLE <+ <* .PEG-SELECTED 2> 1>>>
+ <DISPLAY <GET ,PEG-BG-PIC-TBL .JUMPED-PEG>
+ <GET ,BOARD-TABLE <* .JUMPED-PEG 2>>
+ <GET ,BOARD-TABLE <+ <* .JUMPED-PEG 2> 1>>>
+ <DISPLAY ,UNHL-PEG
+ <GET ,BOARD-TABLE <* <- .CHAR 64> 2>>
+ <GET ,BOARD-TABLE <+ <* <- .CHAR 64> 2> 1>>>
+ <COND (<AND <EQUAL? ,PEG-MOVE-NUMBER 2>
+ ,ACTIVE-MOUSE>
+ <PICINF-PLUS-ONE ,PBOZ-RESTART-BOX-LOC>
+ <DISPLAY ,RESTART-BOX
+ <GET ,PICINF-TBL 0> <GET ,PICINF-TBL 1>>
+ <PICINF-PLUS-ONE ,PBOZ-SHOW-MOVES-BOX-LOC>
+ <DISPLAY ,SHOW-MOVES-BOX
+ <GET ,PICINF-TBL 0> <GET ,PICINF-TBL 1>>)>
+ <SET PEG-SELECTED <>>
+ <SCREEN ,S-TEXT>
+ <CLEAR ,S-TEXT>
+ <COND (<PBOZ-WIN-CHECK>
+ <SET WON T>
+ <SETG PEG-PASSAGE-OPENED T>
+ <SOUND 1> <SOUND 1> <SOUND 1>
+ <TELL
+"A secret doorway to the north slides open. (Hit X to exit)." CR>
+ <INC-SCORE 16>)>)
+ (T ;"LEGAL-MOVE printed and RFALSEd"
+ <SET DONT-CLEAR T>)>>>
+
+<ROUTINE PBOZ-CLICK
+ ("AUX" TL-X TL-Y BR-X BR-Y (CNT 2) PEG-WIDTH PEG-HEIGHT EXPAND-X EXPAND-Y)
+ <PICINF-PLUS-ONE ,PBOZ-RESTART-BOX-LOC>
+ <SET TL-X <GET ,PICINF-TBL 1>>
+ <SET TL-Y <GET ,PICINF-TBL 0>>
+ <PICINF ,RESTART-BOX ,PICINF-TBL>
+ <SET BR-X <+ .TL-X <GET ,PICINF-TBL 1>>>
+ <SET BR-Y <+ .TL-Y <GET ,PICINF-TBL 0>>>
+ <COND (<WITHIN? .TL-X .TL-Y .BR-X .BR-Y>
+ <RETURN !\Z>)>
+ <PICINF-PLUS-ONE ,PBOZ-SHOW-MOVES-BOX-LOC>
+ <SET TL-X <GET ,PICINF-TBL 1>>
+ <SET TL-Y <GET ,PICINF-TBL 0>>
+ <PICINF ,SHOW-MOVES-BOX ,PICINF-TBL>
+ <SET BR-X <+ .TL-X <GET ,PICINF-TBL 1>>>
+ <SET BR-Y <+ .TL-Y <GET ,PICINF-TBL 0>>>
+ <COND (<WITHIN? .TL-X .TL-Y .BR-X .BR-Y>
+ <RETURN !\Y>)>
+ <PICINF-PLUS-ONE ,PBOZ-EXIT-BOX-LOC>
+ <SET TL-X <GET ,PICINF-TBL 1>>
+ <SET TL-Y <GET ,PICINF-TBL 0>>
+ <PICINF ,EXIT-BOX ,PICINF-TBL>
+ <SET BR-X <+ .TL-X <GET ,PICINF-TBL 1>>>
+ <SET BR-Y <+ .TL-Y <GET ,PICINF-TBL 0>>>
+ <COND (<WITHIN? .TL-X .TL-Y .BR-X .BR-Y>
+ <RETURN !\X>)>
+ <PICINF ,EXPAND-HOT-SPOT ,PICINF-TBL>
+ <SET EXPAND-Y <GET ,PICINF-TBL 0>>
+ <SET EXPAND-X <GET ,PICINF-TBL 1>>
+ <PICINF ,UNHL-PEG ,PICINF-TBL>
+ <SET PEG-HEIGHT <GET ,PICINF-TBL 0>>
+ <SET PEG-WIDTH <GET ,PICINF-TBL 1>>
+ <REPEAT ()
+ <SET TL-Y <GET ,BOARD-TABLE .CNT>>
+ <SET TL-X <GET ,BOARD-TABLE <+ .CNT 1>>>
+ <SET BR-Y <+ .TL-Y .PEG-HEIGHT>>
+ <SET BR-X <+ .TL-X .PEG-WIDTH>>
+ ;"expand the hot spot"
+ <SET TL-X <- .TL-X .EXPAND-X>>
+ <SET BR-X <+ .BR-X .EXPAND-X>>
+ <SET BR-Y <+ .BR-Y .EXPAND-Y>>
+ <COND (<WITHIN? .TL-X .TL-Y .BR-X .BR-Y>
+ <RETURN>)>
+ <SET CNT <+ .CNT 2>>
+ <COND (<G? .CNT 43>
+ <SOUND 1>
+ <RETURN>)>>
+ <COND (<G? .CNT 43>
+ <RETURN ,CLICK1>)
+ (T ;"divide in half and convert to ASCII"
+ <RETURN <+ </ .CNT 2> 64>>)>>
+
+<ROUTINE SETUP-PBOZ ("AUX" (I 2))
+ <FSET ,PBOZ-OBJECT ,TOUCHBIT>
+ <REPEAT ((TT ,PBOZ-PIC-TABLE))
+ <PICINF-PLUS-ONE <ZGET .TT 0>>
+ <ZPUT ,BOARD-TABLE .I <ZGET ,PICINF-TBL 0>>
+ <ZPUT ,BOARD-TABLE <+ .I 1> <ZGET ,PICINF-TBL 1>>
+ <SET I <+ .I 2>>
+ <COND (<G? .I 43>
+ <RETURN>)>
+ <SET TT <ZREST .TT 2>>>
+ <SCREEN ,S-FULL>
+ <DISPLAY ,PBOZ-BORDER 1 1>
+ <SCREEN ,S-WINDOW>
+ <PICSET ,PBOZ-PICSET-TBL>
+ <DRAW-PEGS>
+ <COND (,ACTIVE-MOUSE
+ <PICINF-PLUS-ONE ,PBOZ-RESTART-BOX-LOC>
+ <DISPLAY ,DIM-RESTART-BOX
+ <GET ,PICINF-TBL 0> <GET ,PICINF-TBL 1>>
+ <PICINF-PLUS-ONE ,PBOZ-SHOW-MOVES-BOX-LOC>
+ <DISPLAY ,DIM-SHOW-MOVES-BOX
+ <GET ,PICINF-TBL 0> <GET ,PICINF-TBL 1>>
+ <PICINF-PLUS-ONE ,PBOZ-EXIT-BOX-LOC>
+ <DISPLAY ,EXIT-BOX <GET ,PICINF-TBL 0> <GET ,PICINF-TBL 1>>)>
+ <SCREEN ,S-TEXT>>
+
+<CONSTANT PBOZ-PIC-TABLE
+ <PTABLE ,PBOZ-A-LOC
+ ,PBOZ-B-LOC
+ ,PBOZ-C-LOC
+ ,PBOZ-D-LOC
+ ,PBOZ-E-LOC
+ ,PBOZ-F-LOC
+ ,PBOZ-G-LOC
+ ,PBOZ-H-LOC
+ ,PBOZ-I-LOC
+ ,PBOZ-J-LOC
+ ,PBOZ-K-LOC
+ ,PBOZ-L-LOC
+ ,PBOZ-M-LOC
+ ,PBOZ-N-LOC
+ ,PBOZ-O-LOC
+ ,PBOZ-P-LOC
+ ,PBOZ-Q-LOC
+ ,PBOZ-R-LOC
+ ,PBOZ-S-LOC
+ ,PBOZ-T-LOC
+ ,PBOZ-U-LOC>>
+
+<CONSTANT BOARD-TABLE ;"Y and X locations of each peg spot"
+ <ITABLE 44 0>>
+
+<ROUTINE DRAW-PEGS ("AUX" (NUM 1))
+ <REPEAT ()
+ <COND (<EQUAL? <GET ,PEG-TABLE .NUM> 1>
+ <DISPLAY ,UNHL-PEG
+ <GET ,BOARD-TABLE <* .NUM 2>>
+ <GET ,BOARD-TABLE <+ <* .NUM 2> 1>>>)
+ (T
+ <DISPLAY <GET ,PEG-BG-PIC-TBL .NUM>
+ <GET ,BOARD-TABLE <* .NUM 2>>
+ <GET ,BOARD-TABLE <+ <* .NUM 2> 1>>>)>
+ <COND (<G? <SET NUM <+ .NUM 1>> 21>
+ <RETURN>)>>>
+
+<CONSTANT PEG-BG-PIC-TBL
+ <PLTABLE BG-A
+ BG-B
+ BG-C
+ BG-D
+ BG-E
+ BG-F
+ BG-G
+ BG-H
+ BG-I
+ BG-J
+ BG-K
+ BG-L
+ BG-M
+ BG-N
+ BG-O
+ BG-P
+ BG-Q
+ BG-R
+ BG-S
+ BG-T
+ BG-U>>
+
+<ROUTINE RESET-PEGBOARD ("AUX" CNT)
+ <COND (,ACTIVE-MOUSE
+ <SCREEN ,S-WINDOW>
+ <PICINF-PLUS-ONE ,PBOZ-RESTART-BOX-LOC>
+ <DISPLAY ,DIM-RESTART-BOX
+ <GET ,PICINF-TBL 0> <GET ,PICINF-TBL 1>>
+ <PICINF-PLUS-ONE ,PBOZ-SHOW-MOVES-BOX-LOC>
+ <DISPLAY ,DIM-SHOW-MOVES-BOX
+ <GET ,PICINF-TBL 0> <GET ,PICINF-TBL 1>>
+ <SCREEN ,S-TEXT>)>
+ <SETG PEG-MOVE-NUMBER 0>
+ <PUT ,PEG-TABLE 1 1>
+ <COPYT <REST ,PEG-TABLE 2> <REST ,PEG-TABLE 4> -40>
+ <PUT ,PEG-TABLE 7 0>
+ <COPYT ,PEG-MOVE-TABLE 0 80>>
+
+<CONSTANT PEG-TABLE
+ <TABLE 0 ;"zeroth element not used"
+ 1 1 1 1 1 1 0
+ 1 1 1 1 1 1 1
+ 1 1 1 1 1 1 1>>
+
+<ROUTINE LEGAL-MOVE (SELECTED-PEG CHAR "AUX" TBL TBL-SPOT JUMPED-PEG)
+ <SET CHAR <- .CHAR 64>>
+ <SET TBL <GET ,LEGAL-MOVE-TABLE .SELECTED-PEG>>
+ <COND (<EQUAL? <GET .TBL 0> .CHAR>
+ <SET TBL-SPOT 0>)
+ (<EQUAL? <GET .TBL 2> .CHAR>
+ <SET TBL-SPOT 2>)
+ (<EQUAL? <GET .TBL 4> .CHAR>
+ <SET TBL-SPOT 4>)
+ (<EQUAL? <GET .TBL 6> .CHAR>
+ <SET TBL-SPOT 6>)
+ (T
+ <CLEAR ,S-TEXT>
+ <SOUND 1>
+ <TELL
+"Illegal move. You can jump a peg only to a spot which is two spots away.">
+ <RFALSE>)>
+ <SET JUMPED-PEG <GET .TBL <+ .TBL-SPOT 1>>>
+ <COND (<EQUAL? <GET ,PEG-TABLE .CHAR> 1> ;"already peg in destination"
+ <CLEAR ,S-TEXT>
+ <SOUND 1>
+ <TELL
+"Illegal move. There's already a peg at spot " C <+ ,LETTER-OFFSET .CHAR> ".">
+ <RFALSE>)
+ (<EQUAL? <GET ,PEG-TABLE .JUMPED-PEG> 0>
+ <CLEAR ,S-TEXT>
+ <SOUND 1>
+ <TELL
+"Illegal move. There's no peg at spot "
+C <+ ,LETTER-OFFSET .JUMPED-PEG> " to jump.">
+ <RFALSE>)>
+ <RETURN .JUMPED-PEG>>
+
+<CONSTANT LEGAL-MOVE-TABLE
+ <PTABLE ;"0" <PTABLE 0 0> ;"not used"
+ ;"1 = A" <PTABLE 5 3 0 0 0 0 0 0>
+ ;"2 = B" <PTABLE 4 3 0 0 0 0 0 0>
+ ;"3 = C" <PTABLE 6 4 8 5 0 0 0 0>
+ ;"4 = D" <PTABLE 2 3 9 6 11 7 0 0>
+ ;"5 = E" <PTABLE 1 3 10 7 12 8 0 0>
+ ;"6 = F" <PTABLE 3 4 8 7 14 9 16 10>
+ ;"7 = G" <PTABLE 15 10 17 11 0 0 0 0>
+ ;"8 = H" <PTABLE 3 5 6 7 16 11 18 12>
+ ;"9 = I" <PTABLE 4 6 11 10 20 14 0 0>
+ ;"10 = J" <PTABLE 5 7 12 11 0 0 0 0>
+ ;"11 = K" <PTABLE 4 7 9 10 0 0 0 0>
+ ;"12 = L" <PTABLE 5 8 10 11 21 18 0 0>
+ ;"13 = M" <PTABLE 15 14 0 0 0 0 0 0>
+ ;"14 = N" <PTABLE 6 9 16 15 0 0 0 0>
+ ;"15 = O" <PTABLE 7 10 13 14 17 16 0 0>
+ ;"16 = P" <PTABLE 6 10 8 11 14 15 18 17>
+ ;"17 = Q" <PTABLE 7 11 15 16 19 18 0 0>
+ ;"18 = R" <PTABLE 8 12 16 17 0 0 0 0>
+ ;"19 = S" <PTABLE 17 18 0 0 0 0 0 0>
+ ;"20 = T" <PTABLE 9 14 0 0 0 0 0 0>
+ ;"21 = U" <PTABLE 12 18 0 0 0 0 0 0>>>
+
+<ROUTINE PBOZ-WIN-CHECK ("AUX" (CNT 1) (PEG-NUM 0))
+ <COND (,PEG-PASSAGE-OPENED ;"since you can play it even after winning"
+ <RFALSE>)>
+ <REPEAT ()
+ <COND (<EQUAL? .CNT 22>
+ <RETURN>)>
+ <COND (<EQUAL? <GET ,PEG-TABLE .CNT> 1>
+ <SET PEG-NUM <+ .PEG-NUM 1>>)>
+ <SET CNT <+ .CNT 1>>>
+ <COND (<AND <EQUAL? .PEG-NUM 1>
+ <EQUAL? <GET ,PEG-TABLE 7> 1>>
+ <RTRUE>)
+ (T
+ <RFALSE>)>>
+
+<ROUTINE PEG-COUNT ("AUX" (CNT 1) (PEG-NUM 0))
+ <REPEAT ()
+ <COND (<EQUAL? .CNT 22>
+ <RETURN>)>
+ <COND (<EQUAL? <GET ,PEG-TABLE .CNT> 1>
+ <SET PEG-NUM <+ .PEG-NUM 1>>)>
+ <SET CNT <+ .CNT 1>>>
+ <RETURN .PEG-NUM>>
+
+<CONSTANT PEG-MOVE-TABLE
+ <TABLE 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0>>
+
+<CONSTANT LETTER-OFFSET <- <ASCII !\A> 1>>
+
+<GLOBAL PEG-MOVE-NUMBER 0>
+
+<GLOBAL PEG-PASSAGE-OPENED <>>
+
+<ROUTINE DISPLAY-MOVES ("AUX" X Y (CNT 0))
+ <CLEAR ,S-TEXT>
+ <COND (<EQUAL? ,PEG-MOVE-NUMBER 0>
+ <TELL "You haven't moved yet!">
+ <RTRUE>)>
+ <FONT 4> ;"non-proportional spacing"
+ <REPEAT ()
+ <SET Y <+ </ <MOD .CNT 10> 2> 1>>
+ <SET X <+ <* </ .CNT 10> 12> 1>>
+ <CCURSET .Y .X>
+ <TELL
+N <+ </ .CNT 2> 1> ") " C <+ ,LETTER-OFFSET <GET ,PEG-MOVE-TABLE .CNT>> " -> "
+C <+ ,LETTER-OFFSET <GET ,PEG-MOVE-TABLE <+ .CNT 1>>>>
+ <COND (<EQUAL? .CNT <- ,PEG-MOVE-NUMBER 2>>
+ <RETURN>)
+ (T
+ <SET CNT <+ .CNT 2>>)>>
+ <FONT 1> ;"proportional spacing">
+
+<ROOM GAMING-ROOM
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Gaming Room")
+ (LDESC
+"This is a plushly carpeted room draped in deeply hued velvets and satins.
+The sole exit is south.")
+ (SOUTH TO PEG-ROOM)
+ (OUT TO WEST-WING)
+ (FLAGS ONBIT RLANDBIT)
+ (GLOBAL CARPET)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-2>)
+ (ACTION GAMING-ROOM-F)>
+
+<ROUTINE GAMING-ROOM-F ("OPT" (RARG <>))
+ <COND (<AND <EQUAL? .RARG ,M-ENTER>
+ <NOT <FSET? ,ZORKMID-BILL ,TOUCHBIT>>>
+ <SETG DO-J T>
+ <QUEUE I-JESTER 1>)>>
+
+<OBJECT CARPET
+ (LOC LOCAL-GLOBALS) ;"Audience Chamber and Gaming Room"
+ (DESC "carpet")
+ (SYNONYM CARPET CARPETING)
+ (ADJECTIVE PLUSH RED)
+ (ACTION CARPET-F)>
+
+<ROUTINE CARPET-F ()
+ <COND (<VERB? MOVE LOOK-UNDER RAISE ROLL>
+ <TELL
+"The carpet is quite well attached to the floor." CR>)>>
+
+<ROOM GYM
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Gym")
+ (LDESC
+"Dimwit despised all forms of exercise; this room must have been a later
+addition by one of his successors. Doorways lead north and southwest.")
+ (NORTH TO WEST-WING)
+ (SW TO STEAM-BATH)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM GYM)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-2>)
+ (ICON GYM-ICON)>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT DUMBBELL
+ (LOC GYM)
+ (DESC "dumbbell")
+ (LDESC
+"A 100-ugh dumbbell is sitting here, looking heavy.")
+ (SYNONYM DUMBBELL WEIGHTS SET)
+ (ADJECTIVE HEAVY 100-UGH)
+ (FLAGS ;PLURALBIT TAKEBIT MAGICBIT)
+ (SIZE 99)
+ (VALUE 12)
+ (ACTION DUMBELL-F)>
+
+<ROUTINE DUMBELL-F ()
+ <COND (<VERB? RAISE> ;"lift"
+ <TELL
+"You can barely get them off the ground, let alone press them." CR>)
+ (<VERB? PUSH-DIR>
+ <PERFORM ,V?ROLL-DIR ,PRSO ,PRSI>
+ <RTRUE>)
+ (<VERB? EXAMINE>
+ <TELL
+"It's a set of 100-ugh weights, small enough to hold in one hand (but
+unless you a pretty awesome athleter, not nearly light enough to hold
+in one hand)." CR>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT CASTLE>
+
+<ROOM STEAM-BATH
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Steam Bath")
+ (LDESC
+"For generations, the Kings of Quendor have come here to sweat off excess
+pounds (which, given their excessive infatuation with chocolate truffles,
+was plenty often). The only exit is northeast.")
+ (NE TO GYM)
+ (OUT TO GYM)
+ (FLAGS RLANDBIT ONBIT)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-1>)>
+
+;"east wing"
+
+<ROOM EAST-HALL
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "East Hall")
+ (EAST TO EAST-WING IF EAST-DOOR IS OPEN)
+ (NW TO COURTYARD)
+ (FLAGS RLANDBIT ONBIT)
+ (GLOBAL EAST-DOOR LOCK-OBJECT)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-7>)
+ (ACTION EAST-HALL-F)>
+
+<ROUTINE EAST-HALL-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"The castle's east wing lies through a massive door to the east, which is ">
+ <OPEN-CLOSED ,EAST-DOOR>
+ <TELL ". The only other exit from the hall is northwest.">)>>
+
+<OBJECT EAST-DOOR
+ (LOC LOCAL-GLOBALS)
+ (DESC "door")
+ (SYNONYM DOOR)
+ (ADJECTIVE LARGE HEAVY OAK OAKEN)
+ (FLAGS LOCKEDBIT DOORBIT)
+ (ACTION EAST-DOOR-F)>
+
+<ROUTINE EAST-DOOR-F ()
+ <COND (<AND <VERB? UNLOCK>
+ <FSET? ,EAST-DOOR ,LOCKEDBIT>
+ <PRSI? ,EAST-KEY>>
+ <FCLEAR ,EAST-DOOR ,LOCKEDBIT>
+ <LOCKED-UNLOCKED ,EAST-DOOR T>)
+ (<AND <VERB? LOCK>
+ <NOT <FSET? ,EAST-DOOR ,LOCKEDBIT>>
+ <PRSI? ,EAST-KEY>>
+ <FSET ,EAST-DOOR ,LOCKEDBIT>
+ <LOCKED-UNLOCKED ,EAST-DOOR>)>>
+
+<ROOM EAST-WING
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "East Wing")
+ (LDESC
+"This wide corridor runs the length of the east wing of the castle. The
+corridor ends at a large door to the west. There are openings to the north,
+south and east.")
+ (WEST TO EAST-HALL IF EAST-DOOR IS OPEN)
+ (SOUTH TO CHAPEL)
+ (NORTH TO LIBRARY)
+ (EAST TO GUEST-ROOMS)
+ (GLOBAL EAST-DOOR LOCK-OBJECT)
+ (FLAGS RLANDBIT ONBIT)
+ (VALUE 8)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-8>)
+ (ICON EAST-WING-ICON)>
+
+<ROOM GUEST-ROOMS
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Guest Rooms")
+ (LDESC
+"This is where visitors to the castle would stay. Many stayed for decades.
+Passages lead east and west.")
+ (EAST TO SERVANTS-QUARTERS)
+ (WEST TO EAST-WING)
+ (FLAGS RLANDBIT ONBIT)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-9>)>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT WAND
+ (LOC GUEST-ROOMS)
+ (DESC "wand")
+ (FDESC
+"It seems that a wizard must have been a recent guest at the castle, since
+a rather typical wizardly wand is lying here.")
+ (SYNONYM WAND WANDS)
+ (ADJECTIVE TYPICAL WIZARDLY INANIMATION MAGIC)
+ (FLAGS TAKEBIT READBIT)
+ (RESEARCH
+"\"Wands are among the most useful forms of magic; the wand is merely
+pointed at the object to be ensorcelled.\"")
+ (SIZE 3)
+ (ACTION WAND-F)>
+
+<GLOBAL WAND-LIFE 5>
+
+<ROUTINE WAND-F ()
+ <COND (<VERB? EXAMINE READ>
+ <TELL
+"The name \"Fisha\" is engraved on the wand in tiny script, followed
+by the phrase \"16 minute model.\"" CR>)
+ (<AND <VERB? POINT>
+ <PRSO? ,WAND>>
+ <MOVE ,WAND ,PROTAGONIST> ;"in case it's in a container"
+ <COND (<PRSI? ,WAND>
+ <TELL
+"Point the wand at itself!?! It isn't made of rubber!" CR>
+ <RTRUE>)
+ (,TIME-STOPPED
+ <TELL
+"The wand's magic seems as frozen as time itself." CR>
+ <RTRUE>)
+ (<EQUAL? ,WAND-LIFE 0>
+ <TELL "Nothing. The wand seems to be used up." CR>
+ <RTRUE>)>
+ <SETG WAND-LIFE <- ,WAND-LIFE 1>>
+ <COND (<AND <GETP ,PRSI ,P?INANIMATE-DESC>
+ <FSET? ,PRSI ,ANIMATEDBIT>>
+ <COND (<PRSI? ,FOX>
+ <FSET ,PRSI ,WEARBIT>)>
+ <QUEUE <GETP ,PRSI ,P?ANIMATE-ROUTINE> 17>
+ <FCLEAR ,PRSI ,ANIMATEDBIT>
+ <FCLEAR ,PRSI ,ACTORBIT>
+ <FSET ,PRSI ,TOUCHBIT>
+ <THIS-IS-IT ,PRSI>
+ <TELL <GETP ,PRSI ,P?WAND-TEXT> CR>)
+ (<OR <FSET? ,PRSI ,BLACKBIT>
+ <FSET? ,PRSI ,WHITEBIT>>
+ <TELL
+"The " D ,PRSO " seems to grow sluggish for a moment, but
+there is no other effect." CR>)
+ (<AND <VERB? POINT>
+ <PRSI? ,JESTER>>
+ <TELL
+"The jester's expression turns stony. In fact, the jester himself turns stony,
+as he becomes a statue! After a moment, hairline cracks begin forming across
+the statue. The cracks widen and multiply, and the entire statue collapses into
+a cloud of dust! You hear an echo of laughter as the dust disperses.">
+ <COND (<IN? ,SHELL-TABLE ,HERE>
+ <TELL
+" The table and shells disappear as well.">)>
+ <CRLF>
+ <REMOVE-J>
+ <SETG J-DISPOSED ,MOVES>
+ <RTRUE>)
+ (<PRSI? ,BEDBUG>
+ <REMOVE ,BEDBUG>
+ <TELL
+"The bedbug freezes, becoming a small armored tank. You are
+surrounded by raucous laughter from an invisible source, and
+the bedbug/tank disappears!" CR>)
+ (<PRSI? ,LARGE-FLY ,LARGER-FLY ,EVEN-LARGER-FLY
+ ,LARGEST-FLY>
+ <TELL
+"Zap! A bolt of magic just misses the fly. Oh, well. It seems that even
+though it's large for a fly, it's small for a magic wand target." CR>)
+ (<PRSI? ,OTTO>
+ <REMOVE ,OTTO>
+ <QUEUE I-STONE-TO-OTTO 17>
+ <TELL "Otto ">
+ <COND (<AND <FSET? ,SPYGLASS ,TRYTAKEBIT>
+ <NOT <IN? ,SPYGLASS ,OTTO>>>
+ <MOVE ,SPYGLASS ,OTTO>
+ <TELL "grabs the spyglass just before he ">)>
+ <TELL
+"transforms into a massive stone toad, just like the ones that flank the
+Flatheadia Courthouse. His weight is now too much for even the largest of
+lily pads to bear, and he sinks into the swamp with a sickening slurp." CR>)
+ (<PRSI? ,BROGMOID>
+ <TELL
+"A few of the brogmoid's cells may have frozen; if the wand were twenty
+bloits long, it might have a chance of affecting this enormous brogmoid." CR>)
+ (<PRSI? ,SICKLY-WITCH ,PRICKLY-WITCH>
+ <TELL
+"A magical shield springs up around the witch. \"Your weak powers are
+useless against us, simple adventurer!\" cackles the crone." CR>)
+ (<FSET? ,PRSI ,PLANTBIT>
+ <TELL
+"No effect;" T ,PRSI " wasn't all that animate to begin with." CR>)
+ (<PRSI? ,UNICORNS>
+ <JIGS-UP
+"One of the unicorns stiffens; its mate is understandably disturbed and, in an
+un-unicorn-like display of temper, impales you on the tip of a pointy horn.">)
+ (<PRSI? ,THOUSANDS-OF-SNAKES>
+ <TELL
+"One of the snakes stops moving, but is instantly swallowed up
+by the writhing mass." CR>)
+ (<PRSI? ,ME>
+ <JIGS-UP
+"You turn into a handsome statue of yourself. A pigeon swoops down, lands on
+your head, and gives a pigeony whistle which translates roughly to, \"Hey,
+guys, I've found a really great new statue for shitting on!\" Several thousand
+additional pigeons swoop down, and you're crushed to dust under the resultant
+tonnage of excrement.">)
+ (<PRSI? ,EXECUTIONER>
+ <JIGS-UP
+"The executioner solidifies into a stone statue of himself! After a pair
+of grunting guards finish dragging him away and a replacement executioner
+arrives, you are led into a back room, where people who deserve something
+even worse than hanging are taken.">)
+ (T
+ <TELL
+"You feel a crackle of magical energy, but there doesn't seem to be any
+effect on" TR ,PRSI>)>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT CASTLE>
+
+<ROOM SERVANTS-QUARTERS
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Servants' Quarters")
+ (LDESC
+"These are the spartan rooms where the servants lived (if you can actually call
+this \"living\"). A passage leads west and a narrow stair spirals upward.")
+ (WEST TO GUEST-ROOMS)
+ (UP TO JESTERS-QUARTERS)
+ (FLAGS RLANDBIT)
+ (SYNONYM QUARTERS)
+ (ADJECTIVE SERVANT\'S)
+ (GLOBAL STAIRS)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-10>)>
+
+<ROOM CHAPEL
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Chapel")
+ (LDESC
+"None of the Flatheads were particularly religious, but that didn't stop
+Dimwit from building the biggest chapel in all of Quendor. The exit is north,
+at the rear of the chapel. Just below the altar is a small trap door.")
+ (NORTH TO EAST-WING)
+ (DOWN TO CRYPT IF TRAP-DOOR IS OPEN)
+ (SYNONYM CHAPEL)
+ (GLOBAL TRAP-DOOR)
+ (FLAGS RLANDBIT ONBIT)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-8>)
+ (ICON CHAPEL-ICON)>
+
+<OBJECT CHAPEL-ALTAR
+ (LOC CHAPEL)
+ (DESC "altar")
+ (SYNONYM ALTAR)
+ (FLAGS NDESCBIT VOWELBIT SURFACEBIT SEARCHBIT CONTBIT OPENBIT)>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT LOWER>
+
+"lower level"
+
+<ROOM LOWER-HALL
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Lower Hall")
+ (LDESC
+"This large hall, barely illuminated by your light, has seen its better
+days; based on the dust and debris, the lower levels of the castle probably
+haven't been maintained since Dimwit's death. Stairs lead up and down; the
+latter stair looks particularly forbidding. Passages head off to the north,
+south, southeast, and southwest.")
+ (NORTH TO LABORATORY)
+ (SOUTH TO KENNELS)
+ (SW TO G-U-HIGHWAY)
+ (SE TO ROYAL-ZOO)
+ (DOWN TO LOWEST-HALL)
+ (UP TO GREAT-HALL)
+ (FLAGS RLANDBIT)
+ (GLOBAL STAIRS)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-6>)>
+
+<ROOM LABORATORY
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Laboratory")
+ (LDESC
+"You have entered the lab that was affectionately known as Froblo Park.
+The main exit is south, but there's a narrow doorway on the north wall.")
+ (SOUTH TO LOWER-HALL)
+ (NORTH TO TESTING-ROOM)
+ (FLAGS RLANDBIT)
+ (SYNONYM LABORATORY)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-6>)
+ (ICON LABORATORY-ICON)>
+
+<OBJECT SCREWDRIVER
+ (LOC LABORATORY)
+ (DESC "screwdriver")
+ (FDESC "Sitting on the lab bench is an old screwdriver.")
+ (SYNONYM SCREWDRIVER DRIVER)
+ (ADJECTIVE SCREW OLD)
+ (FLAGS TAKEBIT MAGICBIT)
+ (VALUE 12)>
+
+<ROOM TESTING-ROOM
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Testing Room")
+ (LDESC
+"This is where certain dangerous experiments would take place. There
+are two large booths, one on the left side of the room, the other on
+the right side. The only exit is south.")
+ (SOUTH TO LABORATORY)
+ (OUT TO LABORATORY)
+ (FLAGS RLANDBIT)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-6>)>
+
+<OBJECT LEFT-BOOTH
+ (LOC TESTING-ROOM)
+ (DESC "left booth")
+ (SYNONYM BOOTH)
+ (ADJECTIVE LEFT)
+ (FLAGS NDESCBIT VEHBIT INBIT DROPBIT CONTBIT OPENBIT SEARCHBIT)
+ (GENERIC G-BOOTH-F)
+ (CAPACITY 60)
+ (ACTION BOOTH-F)>
+
+<OBJECT RIGHT-BOOTH
+ (LOC TESTING-ROOM)
+ (DESC "right booth")
+ (SYNONYM BOOTH)
+ (ADJECTIVE RIGHT)
+ (FLAGS NDESCBIT VEHBIT INBIT DROPBIT CONTBIT OPENBIT SEARCHBIT)
+ (GENERIC G-BOOTH-F)
+ (CAPACITY 60)
+ (ACTION BOOTH-F)>
+
+<ROUTINE G-BOOTH-F (TBL LEN)
+ <COND (<IN? ,PROTAGONIST ,LEFT-BOOTH>
+ ,LEFT-BOOTH)
+ (<IN? ,PROTAGONIST ,RIGHT-BOOTH>
+ ,RIGHT-BOOTH)
+ (T
+ <RFALSE>)>>
+
+<ROUTINE BOOTH-F ("OPTIONAL" (VARG <>))
+ <COND (<AND .VARG
+ <NOT <EQUAL? .VARG ,M-ENTER>>>
+ <RFALSE>)
+ (.VARG
+ <COND (<FSET? ,PRSO ,TOUCHBIT>
+ <RFALSE>)
+ (T
+ <TELL " ">
+ <PERFORM ,V?EXAMINE ,PRSO>
+ <RTRUE>)>)
+ (<VERB? EXAMINE>
+ <TELL
+"The only feature of the booth is an ominous black button." CR>)>>
+
+<OBJECT LEFT-BOOTH-BUTTON
+ (LOC LEFT-BOOTH)
+ (DESC "ominous black button")
+ (SYNONYM BUTTON)
+ (ADJECTIVE OMINOUS BLACK)
+ (FLAGS NDESCBIT)
+ (GENERIC G-BUTTON-F)
+ (ACTION BOOTH-BUTTON-F)>
+
+<OBJECT RIGHT-BOOTH-BUTTON
+ (LOC RIGHT-BOOTH)
+ (DESC "ominous black button")
+ (SYNONYM BUTTON)
+ (ADJECTIVE OMINOUS BLACK)
+ (GENERIC G-BUTTON-F)
+ (FLAGS NDESCBIT)
+ (ACTION BOOTH-BUTTON-F)>
+
+<ROUTINE G-BUTTON-F (TBL LEN)
+ <COND (<IN? ,PROTAGONIST ,RIGHT-BOOTH>
+ ,RIGHT-BOOTH-BUTTON)
+ (<IN? ,PROTAGONIST ,LEFT-BOOTH>
+ ,LEFT-BOOTH-BUTTON)
+ (T
+ ;<TELL ,YOU-CANT-SEE-ANY "button here.]" CR>
+ ,NOT-HERE-OBJECT ;,ROOMS)>>
+
+<GLOBAL TURNED-INTO <>>
+
+<ROUTINE BOOTH-BUTTON-F ("AUX" OTHER-BOOTH THE-FLY)
+ <COND (<VERB? PUSH>
+ <COND (,ALLIGATOR
+ <TELL "Impossible, in your current state." CR>
+ <RTRUE>)>
+ <REMOVE ,LEFT-BOOTH-BUTTON>
+ <REMOVE ,RIGHT-BOOTH-BUTTON>
+ <SET OTHER-BOOTH <COND (<IN? ,PROTAGONIST ,RIGHT-BOOTH>
+ ,LEFT-BOOTH)
+ (T
+ ,RIGHT-BOOTH)>>
+ <SET THE-FLY <FIRST? .OTHER-BOOTH>>
+ <COND (<OR <NOT .THE-FLY> ;"other booth is empty"
+ <NEXT? .THE-FLY>> ;"two things in other booth"
+ <TELL ,NOTHING-HAPPENS>)
+ (T
+ <QUEUE I-UNTURN 5>
+ <SETG TURNED-INTO .THE-FLY>
+ <DEQUEUE I-UNALLIGATOR>
+ <TELL "You turn into" A .THE-FLY>
+ <COND (<AND <EQUAL? .THE-FLY ,WORM>
+ <VISIBLE? ,ROOSTER>
+ <FSET? ,ROOSTER ,ANIMATEDBIT>>
+ <JIGS-UP
+". The rooster happily nibbles you up for a snack.">)
+ (<AND <EQUAL? .THE-FLY ,ROOSTER>
+ <VISIBLE? ,FOX>
+ <FSET? ,FOX ,ANIMATEDBIT>>
+ <JIGS-UP
+". The fox is only too glad to make you its dinner.">)
+ (<FIRST? ,PROTAGONIST>
+ <TELL ", dropping your possessions.">
+ <ROB ,PROTAGONIST <LOC ,PROTAGONIST>>)
+ (T
+ <TELL ".">)>
+ <CRLF>)>
+ <MOVE ,LEFT-BOOTH-BUTTON ,LEFT-BOOTH>
+ <MOVE ,RIGHT-BOOTH-BUTTON ,RIGHT-BOOTH>)>>
+
+<ROUTINE I-UNTURN ()
+ <RETURN-FROM-MAP>
+ <TELL
+" Waves of relief. You're no longer" AR ,TURNED-INTO>
+ <SETG TURNED-INTO <>>
+ <RTRUE>>
+
+<ROUTINE TO-SPEAK-OF (STRING)
+ <TELL "Ummm..." A ,TURNED-INTO " has no " .STRING " to speak of." CR>>
+
+<ROUTINE GOOD-MEAL (OBJ)
+ <REMOVE .OBJ>
+ <TELL "Yum!">
+ <COND (<G? ,HUNGER-COUNT 0>
+ <TELL " Your hunger fades." CR>
+ <DEQUEUE I-HUNGER>
+ <SETG HUNGER-COUNT 0>
+ <INC-SCORE 20>)
+ (T
+ <CRLF>)>>
+
+<ROOM KENNELS
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Kennels")
+ (LDESC
+"This was once where the royal bloodhounds lived. Considering the size
+of the leash and collar fragments scattered around, the royal bloodhounds
+were BIG. Passages lead east and north.")
+ (NORTH TO LOWER-HALL)
+ (EAST TO ROYAL-ZOO)
+ (FLAGS RLANDBIT)
+ (SYNONYM KENNEL KENNELS)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-6>)
+ (ICON KENNELS-ICON)>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT TOBOGGAN
+ (LOC KENNELS)
+ (DESC "toboggan")
+ (SYNONYM TOBOGGAN SLED INSCRIPTION)
+ (FLAGS TAKEBIT READBIT VEHBIT CONTBIT OPENBIT SEARCHBIT SURFACEBIT)
+ (CAPACITY 30)
+ (SIZE 20)
+ (ACTION TOBOGGAN-F)
+ (TEXT
+"A large inscription says, \"Made by the Frobozz Magic Toboggan Company.\"
+Below that is a faded image of a blooming morgia plant, with the name
+\"Morgiabud.\" It's possible that this sled may have once belonged to
+publishing giant William Randolph Flathead (a.k.a. \"Citizen Flathead\").")>
+
+<ROUTINE TOBOGGAN-F ("OPTIONAL" VARG)
+ <COND (.VARG
+ <RFALSE>)
+ (<VERB? EXAMINE>
+ <COND (<NOUN-USED? ,TOBOGGAN ,W?INSCRIPTION>
+ <PERFORM ,V?READ ,TOBOGGAN>
+ <RTRUE>)
+ (T
+ <TELL
+"This one-person sled bears a small inscription. ">
+ <RFALSE> ;"there's no one on the toboggan, etc.")>)
+ (<AND <VERB? ENTER>
+ <EQUAL? ,HERE ,GLACIER>>
+ <MOVE ,TOBOGGAN ,MIRROR-LAKE>
+ <COND (<NOT ,ENCHANTED-ORB>
+ <SETG ENCHANTED-ORB <COND (<PROB 25> ,MILKY-ORB)
+ (<PROB 33> ,SMOKY-ORB)
+ (<PROB 50> ,FIERY-ORB)
+ (T ,GLITTERY-ORB)>>)>
+ <TELL
+"As you sit on the toboggan, it begins to slide down the mountain, gathering
+speed as it goes. The passing landscape begins to blur, and then even the blur
+is gone as the icy wind forces your eyes shut. Suddenly, with a jolt like a
+mighty hand grabbing you, you are still! You open your eyes" ,ELLIPSIS>
+ <GOTO ,TOBOGGAN>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT LOWER>
+
+<ROOM ROYAL-ZOO
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Royal Zoo")
+ (LDESC
+"Dimwit loved zoos, because he loved imprisonment of any kind -- if the
+dungeons were full of prisoners he could at least get some joy from
+throwing a couple of minxes behind bars. This zoo, with 69,105 cages,
+is easily the largest in Quendor. There are passages to the west and
+northwest, and a wide tunnel leads east.")
+ (NW TO LOWER-HALL)
+ (WEST TO KENNELS)
+ (EAST TO WEST-SHORE)
+ (FLAGS RLANDBIT)
+ (SYNONYM ZOO)
+ (ADJECTIVE ROYAL)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-7>)
+ (ICON ROYAL-ZOO-ICON)>
+
+<OBJECT CAGE
+ (LOC ROYAL-ZOO)
+ (DESC "cage")
+ (FDESC
+"The zoo has been extensively looted; only one of the many nearby cages
+still seems to be occupied.")
+ (SYNONYM CAGE)
+ (FLAGS CONTBIT SEARCHBIT TRANSBIT)
+ (ACTION CAGE-F)>
+
+<ROUTINE CAGE-F ()
+ <COND (<VERB? OPEN>
+ <COND (<AND <IN? ,SNAKE ,CAGE>
+ <FSET? ,SNAKE ,ANIMATEDBIT>>
+ <JIGS-UP
+"As you open the door, the snake, with blurring speed, strikes at your hand.
+Tendrils of poison reach through your veins and grab your heart...">)
+ (T
+ <FSET ,CAGE ,TOUCHBIT>
+ <RFALSE>)>)
+ (<VERB? COUNT>
+ <TELL "Thousands." CR>)
+ (<VERB? ENTER>
+ <TELL "The cage is too small for a human." CR>)>>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT SNAKE
+ (LOC CAGE)
+ (DESC "snake")
+ (SYNONYM SNAKE ROPE)
+ (FLAGS TAKEBIT ANIMATEDBIT)
+ (INANIMATE-DESC "rope")
+ (WAND-TEXT
+"The snake shivers and shimmers and is then still. Too still. You approach,
+tentatively at first, then with more conviction. The snake is gone, replaced
+by (or turned into!) a good, heavy rope.")
+ (ANIMATE-ROUTINE I-W-SNAKE)
+ (ACTION SNAKE-F)>
+
+<ROUTINE SNAKE-F ()
+ <COND (<AND <VERB? RESEARCH>
+ <NOUN-USED? ,SNAKE ,W?SNAKE>>
+ <TELL "\"A common animal, best kept caged.\"" CR>)
+ (<FSET? ,SNAKE ,ANIMATEDBIT>
+ <COND (<VERB? LET-OUT>
+ <PERFORM ,V?OPEN ,CAGE>
+ <RTRUE>)
+ (<VERB? EXAMINE MEASURE>
+ <TELL
+"The snake is thin and perhaps as much as twenty feet long." CR>)>)
+ ;"clause from here on down are for the rope"
+ (<AND <VERB? TIE>
+ <PRSO? ,SNAKE>>
+ <COND (<PRSI? ,SPIRE>
+ <SETG ROPE-PLACED T>
+ <MOVE ,SNAKE ,HERE>
+ <TELL
+"You tie the rope to the spire, dropping the other end down the cliff face.
+It reaches most of the way toward the lower ledge." CR>)
+ (<FSET? ,PRSI ,PLANTBIT> ;"trees"
+ <WASTES>)
+ (T
+ <TELL ,YOU-CANT "tie the rope to" TR ,PRSI>)>)
+ (<AND <VERB? UNTIE>
+ ,ROPE-PLACED>
+ <SETG ROPE-PLACED <>>
+ <TELL "You untie the rope from the spire." CR>)
+ (<AND <VERB? CLIMB-DOWN>
+ ,ROPE-PLACED>
+ <DO-WALK ,P?DOWN>)
+ (<VERB? EXAMINE MEASURE>
+ <TELL "The rope is about twenty feet long." CR>)>>
+
+<ROUTINE I-W-SNAKE ("AUX" (TOLD <>))
+ <FSET ,SNAKE ,ANIMATEDBIT>
+ <COND (<IN? ,SNAKE ,LAKE-BOTTOM>
+ <REMOVE ,SNAKE>)
+ (<VISIBLE? ,SNAKE>
+ <RETURN-FROM-MAP>
+ <SET TOLD T>
+ <TELL
+" The rope ripples with increasing force. It has returned to the form of
+a snake! The snake squirms with anger">
+ <COND (<AND <EQUAL? ,HERE ,UPPER-LEDGE>
+ ,ROPE-PLACED>
+ <TELL
+", uncurls from the spire, and drops out of sight!" CR>)
+ (<AND <IN? ,SNAKE ,CAGE>
+ <NOT <FSET? ,CAGE ,OPENBIT>>>
+ <TELL ,PERIOD-CR>)
+ (<AND <ULTIMATELY-IN? ,SNAKE>
+ <NOT <IN? ,SNAKE ,WALDO>>>
+ <JIGS-UP " and bites you viciously on the wrist.">)
+ (T
+ <COND (<FSET? <LOC ,SNAKE> ,ACTORBIT>
+ <TELL
+", nearly bites" T <LOC ,SNAKE> " on the wrist, drops to the ground,">)>
+ <TELL " and wriggles quickly out of sight." CR>)>)
+ (<AND <EQUAL? ,HERE ,LOWER-LEDGE>
+ ,ROPE-PLACED>
+ <RETURN-FROM-MAP>
+ <SET TOLD T>
+ <TELL
+" A writhing snake drops from above! It strikes out at you but, fortunately,
+misses. Hissing angrily, it disappears into a narrow crack." CR>)>
+ <SETG ROPE-PLACED <>>
+ <COND (<OR <NOT <IN? ,SNAKE ,CAGE>>
+ <FSET? ,CAGE ,OPENBIT>>
+ <REMOVE ,SNAKE>)>
+ <COND (.TOLD
+ <RTRUE>)
+ (T
+ <RFALSE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT LOWER>
+
+<ROOM LOWEST-HALL
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Lowest Hall")
+ (LDESC
+"You get the feeling that no ray of light has touched these walls in ages.
+Few have even ventured down here since the Curse was laid upon the castle
+those many years ago. A decrepit stair leads upward, and there's an opening
+to the north. The bottom of a steep, gravelly passage is visible to the
+east. To the south is the most massively reinforced door you've ever seen.
+A rickety ladder can take you down to even lower domains.")
+ (NORTH TO PASSAGE-STORAGE-ROOM)
+ (SOUTH TO VAULT IF VAULT-DOOR IS OPEN)
+ (EAST SORRY "You can't get a footing on the steep, gravelly passage.")
+ (UP TO LOWER-HALL)
+ (FLAGS RLANDBIT)
+ (DOWN TO PITS)
+ (GLOBAL VAULT VAULT-DOOR LOCK-OBJECT FIXED-LADDER STAIRS)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-4>)>
+
+<OBJECT VAULT-DOOR
+ (LOC LOCAL-GLOBALS)
+ (DESC "vault door")
+ (SYNONYM DOOR)
+ (ADJECTIVE VAULT)
+ (FLAGS DOORBIT LOCKEDBIT)
+ (ACTION VAULT-DOOR-F)>
+
+<ROUTINE VAULT-DOOR-F ()
+ <COND (<AND <VERB? EXAMINE>
+ <EQUAL? ,HERE ,LOWEST-HALL>>
+ <TELL "A large dial is set into the center of the door. ">
+ <RFALSE>)
+ (<AND <VERB? LOCK>
+ <PRSO? ,VAULT-DOOR>>
+ <COND (<FSET? ,VAULT-DOOR ,OPENBIT>
+ <DO-FIRST "close" ,VAULT-DOOR>)
+ (<FSET? ,VAULT-DOOR ,LOCKEDBIT>
+ <TELL "It is!" CR>)
+ (T
+ <SETG P-NUMBER <RANDOM 2570>>
+ <PERFORM ,V?SET ,DIAL ,INTNUM>
+ <RTRUE>)>)
+ (<AND <VERB? UNLOCK>
+ <FSET? ,PRSI ,KEYBIT>>
+ <TELL "This is a combination lock, not a key lock." CR>)>>
+
+<OBJECT DIAL
+ (LOC LOWEST-HALL)
+ (DESC "dial")
+ (SYNONYM DIAL)
+ (ADJECTIVE LARGE)
+ (FLAGS NDESCBIT)
+ (OWNER VAULT-DOOR)
+ (ACTION DIAL-F)>
+
+<GLOBAL DIAL-NUMBER 0>
+
+<ROUTINE DIAL-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"The dial is currently turned to " N ,DIAL-NUMBER ". It can be set to any
+number between 1 and 2570." CR>)
+ (<AND <VERB? SET-DIR>
+ <PRSI? ,LEFT-RIGHT>>
+ <PERFORM ,V?SET ,DIAL>
+ <RTRUE>)
+ (<VERB? SET>
+ <COND (<NOT ,PRSI>
+ <TELL
+"[You must say what number to turn the dial to, as in TURN DIAL TO 920.]" CR>)
+ (<NOT <PRSI? ,INTNUM>>
+ <IMPOSSIBLES>)
+ (<OR <G? ,P-NUMBER 2570>
+ <L? ,P-NUMBER 1>>
+ <TELL "That's not one of the numbers on the dial." CR>)
+ (<EQUAL? ,DIAL-NUMBER ,P-NUMBER>
+ <TELL
+"The dial is already set to " N ,P-NUMBER ,PERIOD-CR>)
+ (<AND <NOT <FSET? ,VAULT-DOOR ,OPENBIT>>
+ <NOT <FSET? ,VAULT-DOOR ,LOCKEDBIT>>>
+ <SETG DIAL-NUMBER ,P-NUMBER>
+ <FSET ,VAULT-DOOR ,LOCKEDBIT>
+ <TELL
+"The tumblers tumble as the vault door re-locks." CR>)
+ (<AND <FSET? ,GLOVE ,WORNBIT>
+ <FSET? ,VAULT-DOOR ,LOCKEDBIT>>
+ <SETG DIAL-NUMBER <RANDOM 2570>>
+ <FCLEAR ,VAULT-DOOR ,LOCKEDBIT>
+ <TELL
+"As you turn the dial with your gloved hand, you can almost feel the tumblers
+turning as though they were an extension of your own fingers! Fascinated, you
+keep spinning, and as you pass " N ,DIAL-NUMBER ", you feel a sense of tactile
+perfection, and stop. A faint click ripples up your arm." CR>)
+ (T
+ <SETG DIAL-NUMBER ,P-NUMBER>
+ <TELL
+"The dial is now set to " N ,DIAL-NUMBER ,PERIOD-CR>)>)>>
+
+<ROOM VAULT
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Vault")
+ (LDESC
+"This was just the vault where Dimwit stored his trifles; his valuables
+were stored in a hidden vault buried seven miles under the Flathead
+Mountains, accessible only by a chain of sixty-three secret teleportation
+spells. The only exit is north.")
+ (NORTH TO LOWEST-HALL IF VAULT-DOOR IS OPEN)
+ (OUT TO LOWEST-HALL IF VAULT-DOOR IS OPEN)
+ (FLAGS RLANDBIT)
+ (GLOBAL VAULT-DOOR)
+ (SYNONYM VAULT)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-6 MAP-GEN-X-4>)
+ (ICON VAULT-ICON)
+ (ACTION VAULT-F)>
+
+<ROUTINE VAULT-F ("OPT" (RARG <>))
+ <COND (.RARG
+ <RFALSE>)
+ (<AND <VERB? OPEN CLOSE LOCK UNLOCK>
+ <PRSO? ,VAULT ,GLOBAL-HERE>>
+ <PERFORM-PRSA ,VAULT-DOOR ,PRSI>)>>
+
+<OBJECT STOCK-CERTIFICATE
+ (LOC VAULT)
+ (DESC "stock certificate")
+ (SYNONYM CERTIFICATE STOCK)
+ (ADJECTIVE STOCK RARE)
+ (FLAGS TAKEBIT BURNBIT READBIT MAGICBIT)
+ (VALUE 12)
+ (SIZE 2)
+ (TEXT
+"The certificate reads \"FrobozzCo International -- 923,130,877 shares.\"")>
+
+<ROOM PASSAGE-STORAGE-ROOM
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Passage Storage Room")
+ (LDESC
+"This is a tremendous warehouse where passageways and tunnels would be stored
+before being installed as part of the Great Underground Empire. The only exit
+is south.")
+ (SOUTH TO LOWEST-HALL)
+ (OUT TO LOWEST-HALL)
+ (FLAGS RLANDBIT)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-4>)
+ (ICON PASSAGE-STORAGE-ICON)>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT NW-SE-PASSAGE
+ (LOC PASSAGE-STORAGE-ROOM)
+ (DESC "northwest-southeast passage")
+ (SYNONYM PASSAGE PASSAGEWAY)
+ (ADJECTIVE MAGIC NW ;NORTHWEST NW-SE SLIGHTLY IRREGULAR)
+ (FLAGS TAKEBIT TRYTAKEBIT)
+ (DESCFCN NW-SE-PASSAGE-F)
+ (OWNER <>)
+ (SIZE 25)
+ (ACTION PASSAGE-F)>
+
+<ROUTINE NW-SE-PASSAGE-F (OARG)
+ <COND (<EQUAL? .OARG ,M-OBJDESC?>
+ <RTRUE>)>
+ <TELL " ">
+ <D-PASSAGE ,NW-SE-PASSAGE>>
+
+<OBJECT N-S-PASSAGE
+ (LOC PASSAGE-STORAGE-ROOM)
+ (DESC "north-south passage")
+ (SYNONYM PASSAGE PASSAGEWAY)
+ (ADJECTIVE MAGIC NORTH-SOUTH N-S SLIGHTLY DAMAGED)
+ (FLAGS TAKEBIT TRYTAKEBIT)
+ (DESCFCN N-S-PASSAGE-F)
+ (OWNER <>)
+ (SIZE 25)
+ (ACTION PASSAGE-F)>
+
+<ROUTINE N-S-PASSAGE-F (OARG)
+ <COND (<EQUAL? .OARG ,M-OBJDESC?>
+ <RTRUE>)>
+ <TELL " ">
+ <D-PASSAGE ,N-S-PASSAGE>>
+
+<ROUTINE PASSAGE-F ()
+ <COND (<AND <VERB? TAKE>
+ <FSET? ,PRSO ,TRYTAKEBIT>>
+ <MOVE ,PRSO ,PROTAGONIST>
+ <MOVE ,NOTICE ,HERE>
+ <FCLEAR ,N-S-PASSAGE ,TRYTAKEBIT>
+ <FCLEAR ,NW-SE-PASSAGE ,TRYTAKEBIT>
+ <FSET ,PRSO ,TOUCHBIT>
+ <TELL
+"As you take" T ,PRSO ", a notice flutters to the ground." CR>)
+ (<VERB? EXAMINE>
+ <COND (<FSET? ,PRSO ,TAKEBIT>
+ <TELL
+"The passage is made out of the same material as donut holes.
+Once installed, it should be wide enough to walk through, and
+it's probably about a hundredth of a bloit long." CR>)
+ (T
+ <D-PASSAGE ,PRSO>
+ <CRLF>)>)
+ (<VERB? ENTER>
+ <COND (<FSET? ,PRSO ,TAKEBIT>
+ <TELL "The passage hasn't been installed yet!" CR>)
+ (<PRSO? ,N-S-PASSAGE>
+ <DO-WALK ,N-S-PASSAGE-DIR>)
+ (T
+ <DO-WALK ,NW-SE-PASSAGE-DIR>)>)>>
+
+<ROUTINE D-PASSAGE (PASSAGE)
+ <COND (<NOT <FSET? .PASSAGE ,TOUCHBIT>>
+ <COND (<EQUAL? .PASSAGE ,N-S-PASSAGE>
+ <TELL
+"Discarded in the corner is a north-south passage, slightly
+damaged but perfectly usable.">)
+ (T
+ <TELL
+"A northwest-southeast passage is lying here. It is marked as being
+slightly irregular, but nobody other than one of the bureaucratic
+Passage Inspectors would ever notice.">)>)
+ (<FSET? .PASSAGE ,TAKEBIT>
+ <TELL
+"A magic " D .PASSAGE " is just lying around in the middle
+of the room, uninstalled.">)
+ (T
+ <TELL "A magic " D .PASSAGE " has been installed in the ">
+ <COND (<EQUAL? .PASSAGE ,N-S-PASSAGE>
+ <COND (<EQUAL? ,HERE ,CONSTRUCTION>
+ <COND (<EQUAL? <GET ,NORTH-EXITS 0>
+ <+ ,CONSTRUCTION-LOC 100>>
+ <TELL "north">)
+ (T
+ <TELL "south">)>)
+ (<EQUAL? ,N-S-PASSAGE-DIR ,P?NORTH>
+ <TELL "north">)
+ (T
+ <TELL "south">)>)
+ (T
+ <COND (<EQUAL? ,HERE ,CONSTRUCTION>
+ <COND (<EQUAL? <GET ,SE-EXITS 0>
+ <+ ,CONSTRUCTION-LOC 100>>
+ <TELL "southeast">)
+ (T
+ <TELL "northwest">)>)
+ (<EQUAL? ,NW-SE-PASSAGE-DIR ,P?NW>
+ <TELL "northwest">)
+ (T
+ <TELL "southeast">)>)>
+ <TELL " wall.">)>>
+
+<GLOBAL N-S-PASSAGE-DIR <>>
+
+<GLOBAL NW-SE-PASSAGE-DIR <>>
+
+<GLOBAL N-S-PASSAGE-LOC <>>
+
+<GLOBAL NW-SE-PASSAGE-LOC <>>
+
+<OBJECT NOTICE
+ (DESC "notice")
+ (SYNONYM NOTICE)
+ (FLAGS TAKEBIT BURNBIT READBIT)
+ (SIZE 2)
+ (TEXT
+"\"Hello, Builder!|
+ Your Magic Passage should last you for many useful years. To install,
+simply INSTALL THE PASSAGE IN THE _____ WALL. Remember, your Magic Passage,
+once installed, is not removable! Please contact your dealer with any
+questions or problems!|
+ Another fine product of the Frobozz Magic Passage Company.\"")>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT LOWER>
+
+<ROOM PITS
+ (LOC ROOMS)
+ (DESC "Pits")
+ (REGION "Flatheadia")
+ (UP TO LOWEST-HALL)
+ (DOWN PER PIT-ENTER-F)
+ (FLAGS RLANDBIT UNDERGROUNDBIT)
+ (GLOBAL FIXED-LADDER PITS-OBJECT)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-3>)
+ (THINGS <> SHADOW PHIL-SHADOW-PS)
+ (ACTION PITS-F)>
+
+<ROUTINE PITS-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"This cavern, deep in the bowels of the Great Underground Empire, ">
+ <D-PITS-FLOOR>
+ <TELL ". A rickety ladder leads upward.">)>>
+
+<ROUTINE D-PITS-FLOOR ()
+ <COND (<FSET? ,LANTERN ,TRYTAKEBIT>
+ <TELL
+"is spotted with an incredible quantity of pits. Judging from the closest of
+them, the pits are bottomless">)
+ (T
+ <TELL
+"has a large number of bottomless pits, all of which have been filled in">
+ <COND (<FSET? ,HERE ,TOUCHBIT>
+ <TELL ", except one.">)
+ (T
+ <TELL
+" -- no, wait! It seems that one pit did not become filled in!">)>
+ <TELL
+" The open pit seems to have handholds leading downward">)>>
+
+<ROUTINE PIT-ENTER-F ("OPTIONAL" (RARG <>)) ;"called by NEXT-ROOM?"
+ <COND (<FSET? ,LANTERN ,TRYTAKEBIT>
+ <COND (<NOT .RARG>
+ <RETURN-FROM-MAP>
+ <TELL
+"Entering a bottomless pit means certain death!" CR>)>
+ <RFALSE>)
+ (T
+ ,LEDGE-IN-PIT)>>
+
+<OBJECT PITS-OBJECT
+ (LOC LOCAL-GLOBALS)
+ (DESC "bottomless pit")
+ (SYNONYM PIT PITS)
+ (ADJECTIVE BOTTOMLESS)
+ (ACTION PITS-OBJECT-F)>
+
+<ROUTINE PITS-OBJECT-F ()
+ <COND (<AND <VERB? EXAMINE>
+ <EQUAL? ,HERE ,PITS>>
+ <TELL "The floor ">
+ <D-PITS-FLOOR>
+ <TELL ,PERIOD-CR>)
+ (<VERB? EXAMINE LOOK-INSIDE>
+ <TELL "The pit looks bottomless." CR>)
+ (<AND <VERB? THROW PUT>
+ <EQUAL? ,P-PRSA-WORD ,W?THROW ,W?HURL ,W?TOSS ,W?CAST>
+ <PRSO? ,PIT-BOMB>>
+ <PERFORM ,V?THROW ,PIT-BOMB <>>
+ <RTRUE>)
+ (<AND <VERB? THROW PUT>
+ <PRSI? ,PITS-OBJECT>>
+ <REMOVE ,PRSO>
+ <COND (<OR <PRSO? ,PERCH>
+ <ULTIMATELY-IN? ,PERCH ,PRSO>>
+ <SETG REMOVED-PERCH-LOC ,BROGMOID>)>
+ <TELL
+"Bottomless or not, the pit swallows" T ,PRSO " forever." CR>)
+ (<OR <VERB? LEAP>
+ <AND <VERB? ENTER>
+ <EQUAL? ,P-PRSA-WORD ,W?JUMP ,W?LEAP>>>
+ <JIGS-UP
+"As you plunge down the bottomless pit, you smash against the irregular walls.
+The result isn't...shall we say...pretty.">)
+ (<VERB? ENTER>
+ <DO-WALK ,P?DOWN>)>>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT LANTERN
+ (LOC PITS)
+ (DESC "brass lantern")
+ (FDESC
+"At the far end of the cavern sits an ancient battery-powered brass
+lantern.")
+ (SYNONYM LAMP LANTERN LIGHT MONOGRAM)
+ (ADJECTIVE ANCIENT BRASS BATTERY-POWERED)
+ (FLAGS TRYTAKEBIT TAKEBIT LIGHTBIT MAGICBIT READBIT)
+ (SIZE 15)
+ (VALUE 0) ;"12 points given elsewhere"
+ (TEXT "You can barely read the worn letters: \"T. A. F.\"")
+ (ACTION LANTERN-F)>
+
+<ROUTINE LANTERN-F ()
+ <COND (<VERB? EXAMINE>
+ <COND (<FSET? ,LANTERN ,TRYTAKEBIT>
+ <TELL "You can't see much from this distance." CR>)
+ (<NOUN-USED? ,LANTERN ,W?MONOGRAM>
+ <PERFORM ,V?READ ,LANTERN>
+ <RTRUE>)
+ (<NOT <FSET? ,LANTERN ,LIGHTBIT>>
+ <TELL "The lamp is either broken or burned out." CR>)
+ (T
+ <TELL
+"There seems to be a faint monogram engraved on it. ">
+ <RFALSE>)>)
+ (<AND <VERB? READ>
+ <FSET? ,LANTERN ,TRYTAKEBIT>>
+ <PERFORM ,V?EXAMINE ,LANTERN>
+ <RTRUE>)
+ (<AND <VERB? TAKE WALK-TO>
+ <FSET? ,LANTERN ,TRYTAKEBIT>>
+ <TELL
+"The pits make the cavern uncrossable; ergo, you can't reach the lantern." CR>)
+ (<AND <VERB? THROW THROW-TO>
+ <PRSI? ,LANTERN>
+ <FSET? ,LANTERN ,TRYTAKEBIT>>
+ <REMOVE ,PRSO>
+ <COND (<OR <PRSO? ,PERCH>
+ <ULTIMATELY-IN? ,PERCH ,PRSO>>
+ <SETG REMOVED-PERCH-LOC ,BROGMOID>)>
+ <TELL
+"Sigh. Your throw is just short of the lamp, and" T ,PRSO " disappears into
+one of the pits." CR>)
+ (<AND <VERB? THROW>
+ <PRSO? ,LANTERN>>
+ <DEQUEUE I-LANTERN>
+ <FCLEAR ,LANTERN ,ONBIT>
+ <FCLEAR ,LANTERN ,LIGHTBIT>
+ <TELL "The lamp smashes into the floor, breaking it." CR>
+ <NOW-DARK?>)
+ (<VERB? ON>
+ <COND (<FSET? ,LANTERN ,LIGHTBIT>
+ <QUEUE I-LANTERN -1>
+ <RFALSE>)
+ (T
+ <TELL "The lamp refuses to light." CR>)>)>>
+
+<GLOBAL LANTERN-COUNTER 500>
+
+<ROUTINE I-LANTERN ()
+ <COND (<NOT <FSET? ,LANTERN ,ONBIT>>
+ <DEQUEUE I-LANTERN>
+ <RFALSE>)>
+ <SETG LANTERN-COUNTER <- ,LANTERN-COUNTER 1>>
+ <COND (<EQUAL? ,LANTERN-COUNTER 0>
+ <FCLEAR ,LANTERN ,ONBIT>
+ <FCLEAR ,LANTERN ,LIGHTBIT>)>
+ <COND (<AND <EQUAL? ,LANTERN-COUNTER 200 100 50 25 0>
+ <VISIBLE? ,LANTERN>>
+ <RETURN-FROM-MAP>
+ <TELL " ">
+ <COND (<EQUAL? ,LANTERN-COUNTER 200>
+ <TELL "The lamp appears a bit dimmer." CR>)
+ (<EQUAL? ,LANTERN-COUNTER 100>
+ <TELL "The lamp is definitely dimmer now." CR>)
+ (<EQUAL? ,LANTERN-COUNTER 50>
+ <TELL "The lamp is nearly out." CR>)
+ (<EQUAL? ,LANTERN-COUNTER 25>
+ <TELL
+"You'd better have more light than from the " D ,LANTERN ,PERIOD-CR>)
+ (T
+ <TELL "The lantern flickers and dies." CR>
+ <NOW-DARK?>)>)
+ (T
+ <RFALSE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT LOWER>
+
+<ROOM LEDGE-IN-PIT
+ (LOC ROOMS)
+ (DESC "Ledge in Bottomless Pit")
+ (REGION "Region: Unknown")
+ (LDESC
+"This is a wide, irregular ledge, far below the lip of the pit. The ledge
+is strewn with the bones of creatures (including a few luckless humans)
+who fell into the pit and landed here, to be devoured by grues. Rough
+handholds, possibly natural, lead upward and downward.")
+ (UP TO PITS)
+ (DOWN TO MOUTH-OF-CAVE)
+ (FLAGS RLANDBIT UNDERGROUNDBIT)
+ (GLOBAL BONES PITS-OBJECT)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-2>)
+ (ICON LEDGE-IN-PIT-ICON)
+ (THINGS WIDE LEDGE LEDGE-IN-PIT-PS)>
+
+<ROUTINE LEDGE-IN-PIT-PS ()
+ <COND (<VERB? EXIT>
+ <V-WALK-AROUND>)>>
+
+<ROOM MOUTH-OF-CAVE
+ (LOC ROOMS)
+ (DESC "Mouth of Cave")
+ (REGION "Region: Unknown")
+ (LDESC
+"A narrow, slimy cave connects here with the bottomless pit, leading
+roughly northeast. The handholds in the rock walls of the pit, which have
+been fairly dependable down to here, seem to peter out just below you.")
+ (UP TO LEDGE-IN-PIT)
+ (DOWN SORRY "There are no more handholds!")
+ (NE TO SLOPING-CAVE)
+ (FLAGS RLANDBIT UNDERGROUNDBIT)
+ (GLOBAL PITS-OBJECT)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-1>)
+ (ICON MOUTH-OF-CAVE-ICON)>
+
+<ROOM SLOPING-CAVE
+ (LOC ROOMS)
+ (DESC "Sloping Cave")
+ (REGION "Region: Unknown")
+ (LDESC
+"You are in a cramped cave with disgustingly sticky walls which press
+in against you. The cave drops sharply to the northeast, and rises
+sharply to the southwest.")
+ (NE TO TOP-OF-WELL)
+ (DOWN TO TOP-OF-WELL)
+ (SW TO MOUTH-OF-CAVE)
+ (UP TO MOUTH-OF-CAVE)
+ (FLAGS RLANDBIT UNDERGROUNDBIT)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-2>)>
+
+<ROOM TOP-OF-WELL
+ (LOC ROOMS)
+ (DESC "Top of Well")
+ (REGION "Region: Unknown")
+ (LDESC
+"The cave ends here at the opening of a natural well. The walls of the
+well look irregular enough to climb down. The sensation of being deep
+within the bowels of the earth is overpowering here; you feel as though
+you are farther down than anyone has ever been before.")
+ (SW TO SLOPING-CAVE)
+ (UP TO SLOPING-CAVE)
+ (DOWN TO UNDER-THE-WORLD)
+ (FLAGS RLANDBIT UNDERGROUNDBIT)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-3>)>
+
+<ROOM UNDER-THE-WORLD
+ (LOC ROOMS)
+ (DESC "Under the World")
+ (REGION "Region: Unknown")
+ (LDESC
+"This is surely the most incredible sight that any pair of eyes has ever
+gazed upon: You have reached the underside of the world, which hangs above
+you, an enormous slab of dirt and rock which stretches as far as you can see
+in all directions! A glowing white haze stretches below you.|
+ To the west, you can see the head and shoulders of a muscular brogmoid;
+the rest of his body seems to be lost in the haze. As your mind adjusts to the
+scale of this place, you realize that the brogmoid is tremendous beyond
+description, and that he is holding the world upon his shoulder and upper
+back.|
+ Thanks to some hardy roots which hang below the world, it looks like you
+could swing over to the shoulder of the brogmoid. Above you, a hole leads
+up into the world.")
+ (UP TO TOP-OF-WELL)
+ (DOWN SORRY "There's nothing there -- literally.")
+ (WEST TO HANGING-FROM-ROOTS)
+ (FLAGS RLANDBIT ONBIT OUTSIDEBIT)
+ (GLOBAL BROGMOID ROOTS)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-2 MAP-GEN-X-3>)
+ (ACTION UNDER-THE-WORLD-F)>
+
+<ROUTINE UNDER-THE-WORLD-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-ENTER>
+ <COND (,ALLIGATOR
+ <RETURN-FROM-MAP>
+ <JIGS-UP
+"The well opens into a vast nothingness. You grab at a few protruding
+roots, but being currently equipped with paws instead of hands, you
+fail. You plunge into an abyss.">)
+ (<NOT <FSET? ,UNDER-THE-WORLD ,TOUCHBIT>>
+ <RETURN-FROM-MAP>
+ <TELL
+"The well suddenly opens onto a vast abyss! You grab onto a few protruding
+roots, preventing a terrible fall..." CR CR>)>)>>
+
+<ROOM HANGING-FROM-ROOTS
+ (LOC ROOMS)
+ (DESC "Hanging From Roots")
+ (REGION "Region: Unknown")
+ (LDESC
+"You are clutching some hardy tree roots, between a seemingly infinite plane
+of earth above you, and a seemingly infinite haze below. To the east, a tiny
+black spot indicates the opening of a well leading upward. To the west, part
+of the shoulder, neck, and ear of an incredibly gigantic brogmoid fills your
+view.")
+ (UP SORRY "The world is in the way.")
+ (DOWN SORRY "There's nothing there -- literally.")
+ (WEST TO SHOULDER)
+ (EAST TO UNDER-THE-WORLD)
+ (FLAGS RLANDBIT ONBIT OUTSIDEBIT)
+ (GLOBAL BROGMOID ROOTS)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-2 MAP-GEN-X-2>)
+ (ICON ROOTS-ICON)>
+
+<OBJECT ROOTS
+ (LOC LOCAL-GLOBALS)
+ (DESC "root")
+ (SYNONYM ROOTS ROOT)
+ (ADJECTIVE HARDY TREE)
+ (ACTION ROOTS-F)>
+
+<ROUTINE ROOTS-F ()
+ <COND (<EQUAL? ,HERE ,OUTER-BAILEY>
+ <PERFORM-PRSA ,TREE-STUMP>)
+ (<AND <VERB? LISTEN TELL>
+ ,PLANT-TALKER>
+ <TELL
+"It is as unlikely for these roots to speak as it is for your toes
+to begin conversing with each other." CR>)>>
+
+<ROOM SHOULDER
+ (LOC ROOMS)
+ (DESC "Shoulder")
+ (REGION "Region: Unknown")
+ (LDESC
+"You have landed on a shoulder of mind-numbing dimension. The hairs of the
+shoulder are like mighty trees, the pores like deep craters. Thanks to the
+thickness of the hair/trees, you could probably climb up the neck to the
+ear which looms above you. A series of underhanging roots make it possible
+to swing off to the east.")
+ (EAST TO HANGING-FROM-ROOTS)
+ (UP TO EAR)
+ (FLAGS RLANDBIT ONBIT OUTSIDEBIT)
+ (GLOBAL BROGMOID ROOTS)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-2 MAP-GEN-X-1>)>
+
+<ROOM EAR
+ (LOC ROOMS)
+ (DESC "Ear")
+ (REGION "Region: Unknown")
+ (IN TO INNER-EAR IF EAR-PASSAGE-OPEN ELSE
+ "The mound of ear fungus blocks entry into the ear.")
+ (DOWN TO SHOULDER)
+ (FLAGS RLANDBIT ONBIT OUTSIDEBIT)
+ (GLOBAL BROGMOID)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-1 MAP-GEN-X-1>)
+ (ICON EAR-ICON)
+ (ACTION EAR-F)>
+
+<ROUTINE EAR-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"You are sitting in one of the folds of a giant ear belonging to the giant
+brogmoid who is holding up the world. A wide channel leading deeper into the
+ear is blocked by a virtual forest of ear fungus">
+ <COND (,EAR-PASSAGE-OPEN
+ <TELL
+", except for a small tunnel through the fungus which leads farther in">)>
+ <TELL ". The only exit is down.">)>>
+
+<GLOBAL EAR-PASSAGE-OPEN <>>
+
+<OBJECT EAR-FUNGUS
+ (LOC EAR)
+ (DESC "ear fungus")
+ (SYNONYM FUNGUS FUNGI)
+ (ADJECTIVE EAR)
+ (FLAGS VOWELBIT NDESCBIT PLANTBIT)
+ (GENERIC G-FUNGUS-F)
+ (RESEARCH
+"\"A class of saprophytic parasitical plants which lack chlorophyll and are
+frequently found in the less hygienic cavities of brogmoids.\"")
+ (ACTION EAR-FUNGUS-F)>
+
+<ROUTINE EAR-FUNGUS-F ("OPTIONAL" (ARG <>))
+ <COND (<EQUAL? .ARG ,M-WINNER>
+ <PLANT-STUNNED>)
+ (<VERB? MOVE CLEAN PUSH KICK MUNG>
+ <TELL "The fungi wall doesn't budge." CR>)
+ (<AND <VERB? LISTEN>
+ ,PLANT-TALKER>
+ <COND (<EQUAL? ,FUNGUS-NUMBER 12>
+ <SETG FUNGUS-NUMBER <- <RANDOM 12> 1>>)>
+ <TELL
+"You hear a vast murmur of fungi, discussing such topics as the woeful lack
+of moisture within this ear">
+ <COND (<NOT ,EAR-PASSAGE-OPEN>
+ <TELL
+". One conversation catches your attention: a family of fungi bewailing their
+long lost cousin, " <GET ,FUNGUS-TABLE ,FUNGUS-NUMBER>>)>
+ <TELL ,PERIOD-CR>)>>
+
+<ROUTINE G-FUNGUS-F (STR LEN)
+ <COND (<VERB? RESEARCH>
+ ,EAR-FUNGUS)>>
+
+<GLOBAL FUNGUS-NUMBER 12>
+
+<CONSTANT FUNGUS-TABLE
+ <PTABLE "Seymour"
+ "Sherman"
+ "Irving"
+ "Sammy"
+ "Myron"
+ "Boris"
+ "Melvin"
+ "Lester"
+ "Julius"
+ "Ricardo"
+ "Omar"
+ "Barnaby">>
+
+<CONSTANT FUNGUS-WORDS
+ <PTABLE <VOC "SEYMOUR" <>>
+ <VOC "SHERMAN" <>>
+ <VOC "IRVING" <>>
+ <VOC "SAMMY" <>>
+ <VOC "MYRON" <>>
+ <VOC "BORIS" <>>
+ <VOC "MELVIN" <>>
+ <VOC "LESTER" <>>
+ <VOC "JULIUS" <>>
+ <VOC "RICARDO" <>>
+ <VOC "OMAR" <>>
+ <VOC "BARNABY" <>>>>
+
+<OBJECT BROGMOID
+ (LOC LOCAL-GLOBALS)
+ (DESC "giant brogmoid")
+ (SYNONYM BROGMOID BROGMOIDS SHOULDER EAR TOE)
+ (ADJECTIVE LARGE)
+ (ACTION BROGMOID-F)>
+
+<ROUTINE BROGMOID-F ()
+ <COND (<VERB? ENTER WALK-TO>
+ <COND (<EQUAL? ,HERE ,UNDER-THE-WORLD ,HANGING-FROM-ROOTS>
+ <DO-WALK ,P?EAST>)
+ (<EQUAL? ,HERE ,SHOULDER>
+ <DO-WALK ,P?UP>)
+ (T
+ <DO-WALK ,P?IN>)>)
+ (<AND <TOUCHING? ,BROGMOID>
+ <EQUAL? ,HERE ,UNDER-THE-WORLD ,HANGING-FROM-ROOTS>>
+ <CANT-REACH ,BROGMOID>)
+ (<VERB? EXAMINE>
+ <COND (<EQUAL? ,HERE ,ON-TOP-OF-THE-WORLD>
+ <TELL
+"Most of the brogmoid is lost in the mists which stretch above the world." CR>)
+ (T
+ <TELL
+"The brogmoid is fairly ordinary, other than the fact that it's about
+a zillion times as large as any brogmoid you've ever seen before." CR>)>)
+ (<AND <VERB? CLEAN>
+ <NOUN-USED? ,BROGMOID ,W?EAR>>
+ <PERFORM ,V?CLEAN ,EAR-FUNGUS>
+ <RTRUE>)
+ (<AND <VERB? RESEARCH>
+ <NOUN-USED? ,BROGMOID ,W?BROGMOID ,W?BROGMOIDS>>
+ <TELL
+"\"In rare cases, these squat creatures can achieve the intelligence levels of
+a three-year-old human. Domesticated brogmoids are tame and can even be taught
+to perform simple tasks. In the wild, they can be seen in huge packs sorting
+through rock piles for edible rocks. (See also BROGMOIDISM.)\"" CR>)>>
+
+<ROOM INNER-EAR
+ (LOC ROOMS)
+ (DESC "Inner Ear")
+ (REGION "Region: Unknown")
+ (LDESC
+"You have reached the brogmoid's eardrum, which prevents any farther travel
+inward. A passage through a forest of fungus leads back out.")
+ (IN SORRY "The membrane of the eardrum is tougher than most walls.")
+ (OUT TO EAR)
+ (FLAGS RLANDBIT OUTSIDEBIT)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-1 EAR-ICON-LOC>)>
+
+<OBJECT EARWAX
+ (LOC INNER-EAR)
+ (OWNER EARWAX)
+ (DESC "hunk of brogmoid ear wax")
+ (SYNONYM HUNK WAX EARWAX)
+ (ADJECTIVE BROGMOID EAR)
+ (FLAGS TAKEBIT)>
+
+<END-SEGMENT> \ No newline at end of file
diff --git a/chess.zabstr b/chess.zabstr
new file mode 100644
index 0000000..e590f76
--- /dev/null
+++ b/chess.zabstr
@@ -0,0 +1,144 @@
+
+<BEGIN-SEGMENT FENSHIRE>
+<GLOBAL RANK 2>
+<GLOBAL FILE 5>
+<GLOBAL PLAIN-LOC 12>
+<ROOM PLAIN (LOC ROOMS) (REGION "Region: Unknown") (DESC "Plain") (NORTH PER
+PLAIN-MOVEMENT-F) (NE PER PLAIN-MOVEMENT-F) (EAST PER PLAIN-MOVEMENT-F) (SE PER
+PLAIN-MOVEMENT-F) (SOUTH PER PLAIN-MOVEMENT-F) (SW PER PLAIN-MOVEMENT-F) (WEST
+PER PLAIN-MOVEMENT-F) (NW PER PLAIN-MOVEMENT-F) (FLAGS RLANDBIT OUTSIDEBIT
+ONBIT) (VALUE 16) (ACTION PLAIN-F)>
+<DEFINE-ROUTINE PLAIN-F>
+<DEFINE-ROUTINE PLAIN-MOVEMENT-F>
+<OBJECT BLACK-KNIGHT (DESC "mounted soldier") (LDESC
+"There is a soldier on horseback here. His armor is made of the dullest
+metals, and his steed is darker than the night.") (SYNONYM SOLDIER KNIGHT HORSE
+MAN) (ADJECTIVE MOUNTED BLACK) (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT
+BLACKBIT) (ACTION PIECE-F)>
+<OBJECT WHITE-KNIGHT (DESC "mounted soldier") (LDESC
+"There is a soldier on horseback here. His armor is made of the shiniest
+metals, and his steed is lighter than drifted snow.") (SYNONYM SOLDIER KNIGHT
+HORSE MAN) (ADJECTIVE MOUNTED WHITE) (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT
+WHITEBIT) (ACTION PIECE-F)>
+<OBJECT BLACK-PAWN (DESC "foot soldier") (LDESC
+"You spot a solitary, bored-looking foot soldier. His face is smudged with
+coal dust, his uniform is sewn from deeply dyed wool, and the handle of his
+sword is solid obsidian.") (SYNONYM SOLDIER PAWN MAN) (ADJECTIVE FOOT BLACK) (
+FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT BLACKBIT) (ACTION PIECE-F)>
+<OBJECT BLACK-QUEEN (DESC "queen") (LDESC
+"A regal woman proudly surveys the landscape in all directions. Her skin
+is dark; her royal garments even darker.") (SYNONYM QUEEN WOMAN) (ADJECTIVE
+REGAL PROUD DARK BLACK) (FLAGS ACTORBIT FEMALEBIT CONTBIT OPENBIT SEARCHBIT
+BLACKBIT) (ACTION PIECE-F)>
+<OBJECT WHITE-CASTLE (DESC "man atop a castle tower") (LDESC
+"Nearby rises a small tower keep, made of creamy marble. Between the
+crenellations of the parapet you spot a man, dressed in an ivory chain
+mail and carrying a crossbow made of birch.") (SYNONYM MAN TOWER CASTLE ROOK) (
+ADJECTIVE CASTLE WHITE) (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT WHITEBIT) (
+ACTION PIECE-F)>
+<OBJECT BLACK-BISHOP (DESC "high priest") (LDESC
+"You hear a sing-song prayer chant and turn to see a high priest of some sort.
+His tall, ebony headpiece bears a religious cipher, and his vestments seem to
+soak up all light.") (SYNONYM PRIEST BISHOP MAN) (ADJECTIVE HIGH BLACK) (FLAGS
+ACTORBIT CONTBIT OPENBIT SEARCHBIT BLACKBIT) (ACTION PIECE-F)>
+<OBJECT WHITE-PAWN (DESC "foot soldier") (LDESC
+"You spot a solitary, bored-looking foot soldier. His face is smudged with
+flour, his uniform is sewn from pure undyed cotton, and the handle of his
+sword is solid quartz.") (SYNONYM SOLDIER PAWN MAN) (ADJECTIVE WHITE FOOT) (
+FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT WHITEBIT) (ACTION PIECE-F)>
+<OBJECT WHITE-QUEEN (DESC "queen") (LDESC
+"A regal woman proudly surveys the landscape in all directions. Her royal
+garments are as white as her pale complexion.") (SYNONYM QUEEN WOMAN) (
+ADJECTIVE REGAL PROUD WHITE) (FLAGS ACTORBIT FEMALEBIT CONTBIT OPENBIT
+SEARCHBIT WHITEBIT) (ACTION PIECE-F)>
+<OBJECT WHITE-KING (DESC "royal leader") (LDESC
+"A tall man wearing princely robes stands nearby. His bearing indicates that
+this is a man accustomed to command. His linen robes are trimmed with ermine,
+and his crown is studded with diamonds and opals.") (SYNONYM LEADER KING MAN) (
+ADJECTIVE ROYAL WHITE TALL) (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT WHITEBIT)
+(ACTION PIECE-F)>
+<OBJECT WHITE-KING-CROWN (LOC WHITE-KING) (DESC "crown") (SYNONYM CROWN) (FLAGS
+NDESCBIT)>
+<OBJECT WHITE-KING-ROBE (LOC WHITE-KING) (DESC "robe") (SYNONYM ROBE) (FLAGS
+NDESCBIT)>
+<OBJECT BLACK-KING (DESC "royal leader") (LDESC
+"A tall man wearing princely robes stands nearby. His bearing indicates that
+this is a man accustomed to command. His velvet robes are trimmed with mink,
+and his crown is studded with polished onyx.") (SYNONYM LEADER KING MAN) (
+ADJECTIVE ROYAL BLACK TALL) (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT BLACKBIT)
+(ACTION PIECE-F)>
+<OBJECT BLACK-KING-ROBE (LOC BLACK-KING) (DESC "robe") (SYNONYM ROBE) (FLAGS
+NDESCBIT)>
+<OBJECT BLACK-KING-CROWN (LOC BLACK-KING) (DESC "crown") (SYNONYM CROWN) (FLAGS
+NDESCBIT)>
+<BEGIN-SEGMENT 0>
+<GLOBAL DIR-CNT 0>
+<DEFINE-ROUTINE PIECE-F>
+<DEFINE-ROUTINE PIECE-TAKES-PIGEON>
+<CONSTANT PIECE-MOVE-TABLE <TABLE 0 0 0 0 0 0 0 0>>
+<DEFINE-ROUTINE MOVE-PIECE>
+<DEFINE-ROUTINE DIR-TO-STRING>
+<DEFINE-ROUTINE PIECE-SNARF>
+<DEFINE-ROUTINE TAKE-PIECE?>
+<DEFINE-ROUTINE ILLEGAL-MOVE?>
+<DEFINE-ROUTINE PIECE-AT-NEW-LOC?>
+<DEFINE-ROUTINE OBSTRUCTION>
+<END-SEGMENT>
+<BEGIN-SEGMENT LOWER>
+<ROOM FIELD-OFFICE (LOC ROOMS) (DESC "Field Office") (REGION "Flatheadia") (
+LDESC "This is a temporary headquarters for a construction site to the west.
+Another exit leads east.") (EAST TO EXIT) (WEST PER CONSTRUCTION-ENTER-F) (
+FLAGS RLANDBIT UNDERGROUNDBIT) (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-7
+MAP-GEN-X-4>)>
+<DEFINE-ROUTINE CONSTRUCTION-ENTER-F>
+<OBJECT BLUEPRINT (LOC FIELD-OFFICE) (DESC "blueprint") (SYNONYM BLUEPRINT) (
+FLAGS TAKEBIT BURNBIT READBIT) (SIZE 2) (TEXT
+"[This is the blueprint from your ZORK ZERO package.]")>
+<BEGIN-SEGMENT 0>
+<OBJECT HAMMER (DESC "hammer") (SYNONYM HAMMER) (FLAGS TAKEBIT) (SIZE 16) (
+ACTION HAMMER-F)>
+<DEFINE-ROUTINE HAMMER-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT LOWER>
+<ROOM CONSTRUCTION (LOC ROOMS) (DESC "Construction") (REGION "Flatheadia") (
+NORTH PER CONSTRUCTION-MOVEMENT-F) (NE PER CONSTRUCTION-MOVEMENT-F) (EAST PER
+CONSTRUCTION-MOVEMENT-F) (SE PER CONSTRUCTION-MOVEMENT-F) (SOUTH PER
+CONSTRUCTION-MOVEMENT-F) (SW PER CONSTRUCTION-MOVEMENT-F) (WEST PER
+CONSTRUCTION-MOVEMENT-F) (NW PER CONSTRUCTION-MOVEMENT-F) (FLAGS RLANDBIT
+UNDERGROUNDBIT) (ACTION CONSTRUCTION-F)>
+<DEFINE-ROUTINE CONSTRUCTION-F>
+<DEFINE-ROUTINE AND-OR-COMMA>
+<DEFINE-ROUTINE CONSTRUCTION-MOVEMENT-F>
+<GLOBAL CONSTRUCTION-LOC 47>
+<CONSTANT NORTH-EXITS <TABLE 99 20 33 37 40 46 48 50 55 59 61>>
+<CONSTANT NE-EXITS <TABLE 12 13 14 20 22 27 28 29 33 36 41 43 46 49 50 53 54>>
+<CONSTANT EAST-EXITS <TABLE 5 6 12 22 26 30 34 38 42 44 51 56 57 61 62>>
+<CONSTANT SE-EXITS <TABLE 99 17 40 43 48 51 54>>
+<OBJECT HARDHAT (DESC "hardhat") (SYNONYM HARDHAT HAT) (ADJECTIVE HARD) (FLAGS
+TAKEBIT WEARBIT) (GENERIC G-HAT-F) (VALUE 25)>
+<BEGIN-SEGMENT 0>
+<DEFINE-ROUTINE REMOVE-ANY-PIECE>
+<CONSTANT STORAGE-TABLE <TABLE 301 BLACK-KNIGHT 314 BLACK-PAWN 315 WHITE-KNIGHT
+328 BLACK-BISHOP 337 BLACK-KING 349 WHITE-PAWN 357 WHITE-KING 363 WHITE-CASTLE
+400 HARDHAT 461 HAMMER 1004 MEMO 3019 T-SQUARE 4193 INSTRUCTION-BOOKLET 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0>>
+<CONSTANT PLAIN-OFFSET 300>
+<CONSTANT CONSTRUCTION-OFFSET 400>
+<CONSTANT OFFICES-OFFSET 1000>
+<CONSTANT OFFICES-N-OFFSET 2000>
+<CONSTANT OFFICES-S-OFFSET 3000>
+<CONSTANT OFFICES-E-OFFSET 4000>
+<CONSTANT OFFICES-W-OFFSET 5000>
+<CONSTANT STORAGE-TABLE-LENGTH 200>
+<DEFINE-ROUTINE PUT-IN-STORAGE>
+<END-SEGMENT>
+<BEGIN-SEGMENT LOWER>
+<BEGIN-SEGMENT FENSHIRE>
+<BEGIN-SEGMENT VILLAGE>
+<DEFINE-ROUTINE STORE>
+<DEFINE-ROUTINE UNSTORE>
+<END-SEGMENT> \ No newline at end of file
diff --git a/chess.zap b/chess.zap
new file mode 100644
index 0000000..a6e5c87
--- /dev/null
+++ b/chess.zap
@@ -0,0 +1,753 @@
+
+ .SEGMENT "FENSHIRE"
+
+
+ .FUNCT PLAIN-F,RARG,PIECE
+ EQUAL? RARG,M-LOOK \?CCL3
+ PRINTI "You are on an amazingly flat plain of "
+ ADD RANK,FILE
+ MOD STACK,2
+ ZERO? STACK \?CCL6
+ PRINTI "sun-bleached sand"
+ JUMP ?CND4
+?CCL6: PRINTI "deep, rich loam"
+?CND4: PRINTI ". The plain seems to stretch endlessly in all directions"
+ EQUAL? RANK,1,8 /?CCL8
+ EQUAL? FILE,1,8 \?CND7
+?CCL8: PRINTI ", except to the "
+ EQUAL? RANK,1 \?CCL13
+ PRINTI "north"
+ EQUAL? FILE,1 \?CCL16
+ PRINTI " and west"
+ JUMP ?CND11
+?CCL16: EQUAL? FILE,8 \?CND11
+ PRINTI " and east"
+ JUMP ?CND11
+?CCL13: EQUAL? RANK,8 \?CCL19
+ PRINTI "south"
+ EQUAL? FILE,1 \?CCL22
+ PRINTI " and west"
+ JUMP ?CND11
+?CCL22: EQUAL? FILE,8 \?CND11
+ PRINTI " and east"
+ JUMP ?CND11
+?CCL19: EQUAL? FILE,1 \?CCL25
+ PRINTI "west"
+ JUMP ?CND11
+?CCL25: PRINTI "east"
+?CND11: PRINTI ", where the world seems to end in a gray void"
+?CND7: PRINTC 46
+ RTRUE
+?CCL3: EQUAL? RARG,M-END \FALSE
+ CALL FIND-IN,HERE,BLACKBIT >PIECE
+ ZERO? PIECE \?PEN31
+ CALL FIND-IN,HERE,WHITEBIT >PIECE
+?PEN31: ZERO? PIECE /FALSE
+ FSET? PIECE,TOUCHBIT /FALSE
+ FSET PIECE,TOUCHBIT
+ RANDOM 100
+ LESS? 30,STACK /FALSE
+ PRINTI " The "
+ ICALL2 DPRINT,PIECE
+ PRINTR " notices your cloak and bows gracefully. ""Greetings, Lordship. It's been a long time between moves -- I'll bet you've got a great one planned!"""
+
+
+ .FUNCT PLAIN-MOVEMENT-F,RARG
+ ZERO? RARG \FALSE
+ EQUAL? RANK,1 \?PRD6
+ EQUAL? PRSO,P?NW,P?NE,P?NORTH /?CCL4
+?PRD6: EQUAL? RANK,8 \?PRD9
+ EQUAL? PRSO,P?SW,P?SE,P?SOUTH /?CCL4
+?PRD9: EQUAL? FILE,8 \?PRD12
+ EQUAL? PRSO,P?SE,P?NE,P?EAST /?CCL4
+?PRD12: EQUAL? FILE,1 \?CND1
+ EQUAL? PRSO,P?SW,P?NW,P?WEST \?CND1
+?CCL4: PRINTI "The world ends at a gray void in that direction."
+ CRLF
+ RFALSE
+?CND1: EQUAL? PRSO,P?NW,P?NE,P?NORTH \?CND17
+ DEC 'RANK
+?CND17: EQUAL? PRSO,P?SW,P?SE,P?SOUTH \?CND19
+ INC 'RANK
+?CND19: EQUAL? PRSO,P?NE,P?SE,P?EAST \?CND21
+ INC 'FILE
+?CND21: EQUAL? PRSO,P?NW,P?SW,P?WEST \?CND23
+ DEC 'FILE
+?CND23: ICALL STORE,PLAIN-OFFSET,PLAIN-LOC
+ SUB RANK,1
+ MUL STACK,8
+ ADD STACK,FILE
+ SUB STACK,1 >PLAIN-LOC
+ ICALL UNSTORE,PLAIN-OFFSET,PLAIN-LOC
+ RETURN PLAIN
+
+ .SEGMENT "0"
+
+
+ .FUNCT PIECE-F,ARG,CNT
+ FSET? WINNER,BLACKBIT /?CTR2
+ FSET? WINNER,WHITEBIT \?CCL3
+?CTR2: ZERO? TIME-STOPPED /?CCL8
+ SET 'P-CONT,-1
+ PRINTI "Seemingly frozen,"
+ ICALL2 TPRINT,WINNER
+ PRINTR " is unresponsive."
+?CCL8: EQUAL? PRSA,V?WALK \?CCL10
+ EQUAL? PRSO,P?UP,P?OUT,P?IN /?CTR9
+ EQUAL? PRSO,P?DOWN \?CCL10
+?CTR9: SET 'DIR-CNT,0
+ PRINT CANNOT-TRAVEL
+ ICALL1 STOP
+ RTRUE
+?CCL10: EQUAL? PRSA,V?WALK \?PRD18
+ ZERO? P-WALK-DIR \?CCL16
+?PRD18: EQUAL? PRSA,V?MOVE \?CTR15
+ EQUAL? PRSO,INTDIR /?CCL16
+?CTR15: SET 'DIR-CNT,0
+ EQUAL? PRSA,V?WALK \?CCL25
+ CALL NOUN-USED?,PRSO,W?ONE
+ ZERO? STACK /?CCL25
+ PRINTI "[The proper way to ask"
+ ICALL2 TPRINT,WINNER
+ PRINTR " to move is simply to tell the direction(s), as in >CHARACTER, NW.NW]"
+?CCL25: SET 'P-CONT,-1
+ PRINTR """You can tell me directions. That's it."""
+?CCL16: EQUAL? HERE,PLAIN,CONSTRUCTION /?CCL29
+ SET 'P-CONT,-1
+ PRINTR """The terrain is strange and unfamiliar; I am too terrified to move!"""
+?CCL29: EQUAL? DIR-CNT,7 \?CCL31
+ SET 'DIR-CNT,0
+ SET 'P-CONT,-1
+ PRINTR """Too many directions!"""
+?CCL31: EQUAL? PRSA,V?MOVE \?CND32
+ CALL1 DIRECTION-CONVERSION >PRSO
+?CND32: PUT PIECE-MOVE-TABLE,DIR-CNT,PRSO
+ IGRTR? 'DIR-CNT,1 \?CCL36
+ EQUAL? WINNER,WHITE-KNIGHT,BLACK-KNIGHT /?CCL36
+ SUB DIR-CNT,2
+ GET PIECE-MOVE-TABLE,STACK
+ EQUAL? PRSO,STACK /?CCL36
+ SET 'DIR-CNT,0
+ COPYT PIECE-MOVE-TABLE,0,16
+ PRINT CANNOT-TRAVEL
+ ICALL1 STOP
+ RTRUE
+?CCL36: ZERO? P-CONT \?CTR40
+ ZERO? M-PTR /?CCL41
+?CTR40: SET 'CLOCK-WAIT,TRUE-VALUE
+ RTRUE
+?CCL41: SET 'DIR-CNT,0
+ ICALL1 MOVE-PIECE
+ RTRUE
+?CCL3: EQUAL? PRSA,V?ENTER \?CCL45
+ EQUAL? PRSO,WHITE-CASTLE \?CCL45
+ CALL NOUN-USED?,WHITE-CASTLE,W?MAN
+ ZERO? STACK \?CCL45
+ PRINTR "Oddly, there doesn't seem to be any entrance."
+?CCL45: EQUAL? PRSA,V?ENTER \?CCL50
+ EQUAL? PRSO,BLACK-KNIGHT,WHITE-KNIGHT \?CCL50
+ CALL NOUN-USED?,PRSO,W?HORSE
+ ZERO? STACK /?CCL50
+ PRINTR "The horse isn't large enough for two riders."
+?CCL50: EQUAL? PRSA,V?MOVE \?CCL55
+ PRINTI "Perhaps you should tell"
+ ICALL1 TPRINT-PRSO
+ PRINTR " the direction(s)."
+?CCL55: EQUAL? PRSA,V?GIVE \?CCL57
+ FSET? PRSO,TRYTAKEBIT /?CCL57
+ CALL FIND-IN,PRSO,TRYTAKEBIT
+ ZERO? STACK \?CCL57
+ FSET? PRSI,WHITEBIT /?CTR56
+ FSET? PRSI,BLACKBIT \?CCL57
+?CTR56: ZERO? TIME-STOPPED /?CND64
+ ICALL PERFORM,V?TELL,PRSI
+ RTRUE
+?CND64: MOVE PRSO,PRSI
+ PRINTI "The "
+ ICALL2 DPRINT,PRSI
+ PRINTI " takes"
+ ICALL1 TPRINT-PRSO
+ PRINTC 46
+ EQUAL? PRSO,PIGEON \?CCL68
+ CALL2 META-LOC,PERCH
+ EQUAL? HERE,STACK /?CCL68
+ EQUAL? HERE,OUBLIETTE \?CTR67
+ EQUAL? REMOVED-PERCH-LOC,OUBLIETTE /?CCL68
+?CTR67: CALL2 PIECE-TAKES-PIGEON,PRSI
+ RSTACK
+?CCL68: PRINTR " ""Your graciousness is not unappreciated, your Lordship."""
+?CCL57: EQUAL? PRSA,V?ASK-FOR \FALSE
+ LOC PRSI
+ FSET? STACK,WHITEBIT /?CCL75
+ LOC PRSI
+ FSET? STACK,BLACKBIT \FALSE
+?CCL75: ICALL PERFORM,V?TAKE,PRSI
+ RTRUE
+
+
+ .FUNCT PIECE-TAKES-PIGEON,PIECE,DO-CR
+ ASSIGNED? 'DO-CR /?CND1
+ SET 'DO-CR,TRUE-VALUE
+?CND1: ICALL2 MOVE-TO-PERCH,PIECE
+ PRINTI " Instantly,"
+ EQUAL? PIECE,WHITE-CASTLE \?CCL5
+ PRINTI " the tower"
+ JUMP ?CND3
+?CCL5: ICALL2 TPRINT,PIECE
+?CND3: PRINTI " seems to grow more distant without moving. Within seconds,"
+ EQUAL? PIECE,WHITE-CASTLE \?CCL8
+ PRINTI " the tower"
+ JUMP ?CND6
+?CCL8: ICALL2 TPRINT,PIECE
+?CND6: PRINTI " is gone."
+ ZERO? DO-CR /TRUE
+ CRLF
+ RTRUE
+
+
+ .FUNCT MOVE-PIECE,CNT,DIR,NEW-RANK,NEW-FILE,NEW-LOC,X,OFFSET,BLOCK,?TMP1
+ SET 'NEW-RANK,RANK
+ SET 'NEW-FILE,FILE
+ SUB NEW-RANK,1
+ MUL STACK,8 >?TMP1
+ SUB NEW-FILE,1
+ ADD ?TMP1,STACK >NEW-LOC
+ SET 'CNT,0
+?PRG1: GET PIECE-MOVE-TABLE,CNT >DIR
+ EQUAL? DIR,FALSE-VALUE /?REP2
+ EQUAL? DIR,P?NORTH,P?NE,P?NW \?CND5
+ DEC 'NEW-RANK
+?CND5: EQUAL? DIR,P?EAST,P?NE,P?SE \?CND7
+ INC 'NEW-FILE
+?CND7: EQUAL? DIR,P?SOUTH,P?SE,P?SW \?CND9
+ INC 'NEW-RANK
+?CND9: EQUAL? DIR,P?WEST,P?SW,P?NW \?CND11
+ DEC 'NEW-FILE
+?CND11: INC 'CNT
+ EQUAL? HERE,CONSTRUCTION \?CND13
+ EQUAL? WINNER,BLACK-KNIGHT,WHITE-KNIGHT /?CND13
+ CALL OBSTRUCTION,NEW-LOC,DIR
+ ZERO? STACK /?CND13
+ SET 'BLOCK,TRUE-VALUE
+ EQUAL? DIR,P?EAST \?CCL20
+ EQUAL? NEW-LOC,47 \?CCL20
+ PRINTI """Appearances deceive you -- such a move would send me off the edge of the world!"""
+ CRLF
+ JUMP ?REP2
+?CCL20: PRINTI """My word! There appears to be a wall in the way!"""
+ CRLF
+ JUMP ?REP2
+?CND13: SUB NEW-RANK,1
+ MUL STACK,8 >?TMP1
+ SUB NEW-FILE,1
+ ADD ?TMP1,STACK >NEW-LOC
+ GET PIECE-MOVE-TABLE,CNT
+ ZERO? STACK /?PRG1
+ EQUAL? WINNER,BLACK-KNIGHT,WHITE-KNIGHT /?PRG1
+ CALL2 PIECE-AT-NEW-LOC?,NEW-LOC
+ ZERO? STACK /?PRG1
+ SET 'BLOCK,TRUE-VALUE
+ PRINTI """Alas, the path between here and there is not unobstructed."""
+ CRLF
+?REP2: GET PIECE-MOVE-TABLE,0
+ CALL2 DIR-TO-STRING,STACK >DIR
+ COPYT PIECE-MOVE-TABLE,0,16
+ ZERO? BLOCK \TRUE
+ CALL ILLEGAL-MOVE?,NEW-LOC,NEW-RANK,NEW-FILE >X
+ EQUAL? X,M-FATAL \?CCL32
+ PRINTR """That land is occupied!"""
+?CCL32: ZERO? X /?CCL34
+ PRINT CANNOT-TRAVEL
+ CALL1 STOP
+ RSTACK
+?CCL34: GRTR? NEW-RANK,8 /?CTR35
+ GRTR? NEW-FILE,8 /?CTR35
+ LESS? NEW-RANK,1 /?CTR35
+ LESS? NEW-FILE,1 \?CCL36
+?CTR35: PRINTI """You would have me plunge off the end of the world"
+ EQUAL? HERE,CONSTRUCTION \?CND41
+ PRINTI " -- or whatever passes for the end of the world in this forsaken badland"
+?CND41: PRINTR "!"""
+?CCL36: CALL2 TAKE-PIECE?,NEW-LOC
+ ZERO? STACK \FALSE
+ REMOVE WINNER
+ PRINTI """I'm off!"" The "
+ PRINTD WINNER
+ EQUAL? WINNER,WHITE-KNIGHT,BLACK-KNIGHT \?CCL47
+ PRINTI " and his steed jump high into the air and vanish! A moment later, you hear a proud whinny in the distance."
+ JUMP ?CND45
+?CCL47: PRINTI " moves out of sight to the "
+ PRINT DIR
+ PRINTC 46
+?CND45: CRLF
+ EQUAL? WINNER,WHITE-PAWN \?CCL50
+ EQUAL? HERE,PLAIN \?CCL50
+ LESS? NEW-LOC,8 \?CCL50
+ ICALL ROB,WHITE-PAWN,WHITE-QUEEN
+ SET 'WINNER,WHITE-QUEEN
+ JUMP ?CND48
+?CCL50: EQUAL? WINNER,BLACK-PAWN \?CND48
+ EQUAL? HERE,PLAIN \?CND48
+ GRTR? NEW-LOC,55 \?CND48
+ ICALL ROB,BLACK-PAWN,BLACK-QUEEN
+ SET 'WINNER,BLACK-QUEEN
+?CND48: EQUAL? HERE,PLAIN \?CCL60
+ SET 'OFFSET,PLAIN-OFFSET
+ JUMP ?CND58
+?CCL60: SET 'OFFSET,CONSTRUCTION-OFFSET
+?CND58: ADD NEW-LOC,OFFSET
+ ICALL PIECE-SNARF,STACK,WINNER
+ CALL PUT-IN-STORAGE,OFFSET,WINNER,NEW-LOC
+ RSTACK
+
+
+ .FUNCT DIR-TO-STRING,DIR
+ EQUAL? DIR,P?UP \?CCL3
+ RETURN STR?912
+?CCL3: EQUAL? DIR,P?DOWN \?CCL5
+ RETURN STR?913
+?CCL5: EQUAL? DIR,P?NORTH \?CCL7
+ RETURN STR?198
+?CCL7: EQUAL? DIR,P?NE \?CCL9
+ RETURN STR?828
+?CCL9: EQUAL? DIR,P?EAST \?CCL11
+ RETURN STR?827
+?CCL11: EQUAL? DIR,P?SE \?CCL13
+ RETURN STR?263
+?CCL13: EQUAL? DIR,P?SOUTH \?CCL15
+ RETURN STR?199
+?CCL15: EQUAL? DIR,P?SW \?CCL17
+ RETURN STR?826
+?CCL17: EQUAL? DIR,P?WEST \?CCL19
+ RETURN STR?824
+?CCL19: EQUAL? DIR,P?NW \FALSE
+ RETURN STR?825
+
+
+ .FUNCT PIECE-SNARF,NEW-LOC,SNARFER,OBJ,CNT,TOOK-PIGEON
+?PRG1: LESS? CNT,STORAGE-TABLE-LENGTH \?REP2
+ GET STORAGE-TABLE,CNT
+ EQUAL? STACK,NEW-LOC \?CND3
+ ADD CNT,1
+ GET STORAGE-TABLE,STACK >OBJ
+ FSET? OBJ,TAKEBIT \?CND3
+ FSET? OBJ,TRYTAKEBIT /?CND3
+ CALL FIND-IN,OBJ,TRYTAKEBIT
+ ZERO? STACK \?CND3
+ EQUAL? OBJ,PIGEON \?CND12
+ SET 'TOOK-PIGEON,TRUE-VALUE
+?CND12: MOVE OBJ,SNARFER
+ PUT STORAGE-TABLE,CNT,0
+ ADD CNT,1
+ PUT STORAGE-TABLE,STACK,0
+?CND3: ADD CNT,2 >CNT
+ JUMP ?PRG1
+?REP2: ZERO? TOOK-PIGEON /FALSE
+ CALL2 MOVE-TO-PERCH,SNARFER
+ RSTACK
+
+
+ .FUNCT TAKE-PIECE?,NEW-LOC,TAKEE,VAL
+ CALL2 PIECE-AT-NEW-LOC?,NEW-LOC >TAKEE
+ ZERO? TAKEE \?CCL3
+ RETURN VAL
+?CCL3: FSET? TAKEE,WHITEBIT \?PRD7
+ FSET? WINNER,WHITEBIT /?CTR4
+?PRD7: FSET? TAKEE,BLACKBIT \?CCL5
+ FSET? WINNER,BLACKBIT \?CCL5
+?CTR4: PRINTI """I cannot attack one of my own side!"""
+ CRLF
+ SET 'VAL,TRUE-VALUE
+ RETURN VAL
+?CCL5: ICALL PIECE-AT-NEW-LOC?,NEW-LOC,TRUE-VALUE
+ RETURN VAL
+
+
+ .FUNCT ILLEGAL-MOVE?,NEW-LOC,NEW-RANK,NEW-FILE,TAKEE,OLD-LOC
+ EQUAL? HERE,PLAIN \?CCL3
+ SET 'OLD-LOC,PLAIN-LOC
+ JUMP ?CND1
+?CCL3: SET 'OLD-LOC,CONSTRUCTION-LOC
+?CND1: EQUAL? WINNER,WHITE-KNIGHT,BLACK-KNIGHT \?CCL6
+ SUB OLD-LOC,NEW-LOC
+ EQUAL? STACK,6,10,15 /FALSE
+ SUB OLD-LOC,NEW-LOC
+ EQUAL? STACK,17,-6,-10 /FALSE
+ SUB OLD-LOC,NEW-LOC
+ EQUAL? STACK,-15,-17 /FALSE
+ RTRUE
+?CCL6: EQUAL? WINNER,WHITE-KING,BLACK-KING \?CCL14
+ SUB OLD-LOC,NEW-LOC
+ EQUAL? STACK,1,7,8 /FALSE
+ SUB OLD-LOC,NEW-LOC
+ EQUAL? STACK,9,-1,-7 /FALSE
+ SUB OLD-LOC,NEW-LOC
+ EQUAL? STACK,-8,-9 /FALSE
+ RTRUE
+?CCL14: EQUAL? WINNER,BLACK-BISHOP \?CCL22
+ GRTR? OLD-LOC,NEW-LOC \?CCL25
+ SUB OLD-LOC,NEW-LOC
+ MOD STACK,7
+ ZERO? STACK /FALSE
+ SUB OLD-LOC,NEW-LOC
+ MOD STACK,9
+ ZERO? STACK /FALSE
+ RTRUE
+?CCL25: SUB NEW-LOC,OLD-LOC
+ MOD STACK,7
+ ZERO? STACK /FALSE
+ SUB NEW-LOC,OLD-LOC
+ MOD STACK,9
+ ZERO? STACK /FALSE
+ RTRUE
+?CCL22: EQUAL? WINNER,WHITE-CASTLE \?CCL37
+ EQUAL? RANK,NEW-RANK /FALSE
+ EQUAL? FILE,NEW-FILE /FALSE
+ RTRUE
+?CCL37: EQUAL? WINNER,WHITE-QUEEN,BLACK-QUEEN \?CCL44
+ EQUAL? RANK,NEW-RANK /FALSE
+ EQUAL? FILE,NEW-FILE /FALSE
+ GRTR? NEW-LOC,OLD-LOC \?CCL51
+ SUB NEW-LOC,OLD-LOC
+ MOD STACK,7
+ ZERO? STACK /FALSE
+ SUB NEW-LOC,OLD-LOC
+ MOD STACK,9
+ ZERO? STACK /FALSE
+?CCL51: GRTR? OLD-LOC,NEW-LOC \TRUE
+ SUB OLD-LOC,NEW-LOC
+ MOD STACK,7
+ ZERO? STACK /FALSE
+ SUB OLD-LOC,NEW-LOC
+ MOD STACK,9
+ ZERO? STACK /FALSE
+ RTRUE
+?CCL44: EQUAL? WINNER,BLACK-PAWN \?CCL63
+ CALL2 PIECE-AT-NEW-LOC?,NEW-LOC >TAKEE
+ EQUAL? OLD-LOC,14 \?CCL66
+ EQUAL? NEW-LOC,30 \?CCL66
+ ZERO? TAKEE /FALSE
+ RETURN 2
+?CCL66: SUB NEW-LOC,OLD-LOC
+ EQUAL? STACK,7,9 \?CCL75
+ ZERO? TAKEE \FALSE
+ RTRUE
+?CCL75: SUB NEW-LOC,OLD-LOC
+ EQUAL? STACK,8 \TRUE
+ ZERO? TAKEE /FALSE
+ RETURN 2
+?CCL63: EQUAL? WINNER,WHITE-PAWN \?CCL87
+ CALL2 PIECE-AT-NEW-LOC?,NEW-LOC >TAKEE
+ EQUAL? OLD-LOC,49 \?CCL90
+ EQUAL? NEW-LOC,33 \?CCL90
+ ZERO? TAKEE /FALSE
+ RETURN 2
+?CCL90: SUB OLD-LOC,NEW-LOC
+ EQUAL? STACK,7,9 \?CCL99
+ ZERO? TAKEE \FALSE
+ RTRUE
+?CCL99: SUB OLD-LOC,NEW-LOC
+ EQUAL? STACK,8 \TRUE
+ ZERO? TAKEE /FALSE
+ RETURN 2
+?CCL87: PRINTR "Bug7"
+
+
+ .FUNCT PIECE-AT-NEW-LOC?,NEW-LOC,TAKE-PIECE,CNT,TAKEE
+ EQUAL? HERE,CONSTRUCTION \?CCL3
+ PUSH CONSTRUCTION-OFFSET
+ JUMP ?CND1
+?CCL3: PUSH PLAIN-OFFSET
+?CND1: ADD NEW-LOC,STACK >NEW-LOC
+?PRG4: GET STORAGE-TABLE,CNT
+ EQUAL? NEW-LOC,STACK \?CND6
+ ADD CNT,1
+ GET STORAGE-TABLE,STACK >TAKEE
+ FSET? TAKEE,WHITEBIT /?CCL9
+ FSET? TAKEE,BLACKBIT \?CND6
+?CCL9: ZERO? TAKE-PIECE /?REP5
+ ICALL ROB,TAKEE,WINNER
+ PUT STORAGE-TABLE,CNT,0
+ JUMP ?REP5
+?CND6: ADD CNT,2 >CNT
+ LESS? CNT,STORAGE-TABLE-LENGTH /?PRG4
+?REP5: ZERO? TAKEE /FALSE
+ FSET? TAKEE,WHITEBIT /?CTR19
+ FSET? TAKEE,BLACKBIT \FALSE
+?CTR19: RETURN TAKEE
+
+
+ .FUNCT OBSTRUCTION,L,DIR,CALLED-BY-EXIT-F,CHANGE
+ EQUAL? DIR,P?NORTH \?CCL3
+ INTBL? L,NORTH-EXITS,11 /?CTR2
+ ADD L,100
+ INTBL? STACK,NORTH-EXITS,11 \?CCL3
+?CTR2: SET 'CHANGE,-8
+ JUMP ?CND1
+?CCL3: EQUAL? DIR,P?NE \?CCL9
+ INTBL? L,NE-EXITS,17 \?CCL9
+ SET 'CHANGE,-7
+ JUMP ?CND1
+?CCL9: EQUAL? DIR,P?EAST \?CCL13
+ EQUAL? L,47 \?CCL16
+ ZERO? CALLED-BY-EXIT-F /?CCL16
+ SET 'CHANGE,100
+ JUMP ?CND1
+?CCL16: INTBL? L,EAST-EXITS,15 \?CND1
+ SET 'CHANGE,1
+ JUMP ?CND1
+?CCL13: EQUAL? DIR,P?SE \?CCL21
+ INTBL? L,SE-EXITS,7 /?CTR20
+ ADD L,100
+ INTBL? STACK,SE-EXITS,7 \?CCL21
+?CTR20: SET 'CHANGE,9
+ JUMP ?CND1
+?CCL21: EQUAL? DIR,P?SOUTH \?CCL27
+ ADD L,8
+ INTBL? STACK,NORTH-EXITS,11 /?CTR26
+ ADD L,108
+ INTBL? STACK,NORTH-EXITS,11 \?CCL27
+?CTR26: SET 'CHANGE,8
+ JUMP ?CND1
+?CCL27: EQUAL? DIR,P?SW \?CCL33
+ ADD L,7
+ INTBL? STACK,NE-EXITS,17 \?CCL33
+ SET 'CHANGE,7
+ JUMP ?CND1
+?CCL33: EQUAL? DIR,P?WEST \?CCL37
+ SUB L,1
+ INTBL? STACK,EAST-EXITS,15 \?CCL37
+ SET 'CHANGE,-1
+ JUMP ?CND1
+?CCL37: EQUAL? DIR,P?NW \?CND1
+ SUB L,9
+ INTBL? STACK,SE-EXITS,7 /?CCL40
+ ADD L,91
+ INTBL? STACK,SE-EXITS,7 \?CND1
+?CCL40: SET 'CHANGE,-9
+?CND1: ZERO? CALLED-BY-EXIT-F /?CCL47
+ RETURN CHANGE
+?CCL47: ZERO? CHANGE /TRUE
+ RFALSE
+
+ .ENDSEG
+
+ .SEGMENT "LOWER"
+
+
+ .FUNCT CONSTRUCTION-ENTER-F,RARG
+ ZERO? RARG \FALSE
+ SET 'CONSTRUCTION-LOC,47
+ RETURN CONSTRUCTION
+
+ .SEGMENT "0"
+
+
+ .FUNCT HAMMER-F
+ EQUAL? PRSA,V?KILL \?CCL3
+ EQUAL? PRSI,HAMMER \?CCL3
+ ICALL PERFORM,V?MUNG,PRSO,HAMMER
+ RTRUE
+?CCL3: EQUAL? PRSA,V?MUNG \FALSE
+ EQUAL? PRSI,HAMMER \FALSE
+ FSET? PRSO,ANIMATEDBIT \FALSE
+ PRINTI "Fortunately,"
+ ICALL1 TPRINT-PRSO
+ PRINTR " evades your blow."
+
+ .ENDSEG
+
+ .SEGMENT "LOWER"
+
+
+ .FUNCT CONSTRUCTION-F,RARG,CNT
+ EQUAL? RARG,M-LOOK \?CCL3
+ INTBL? CONSTRUCTION-LOC,NORTH-EXITS,11 \?CND4
+ INC 'CNT
+?CND4: INTBL? CONSTRUCTION-LOC,NE-EXITS,17 \?CND6
+ INC 'CNT
+?CND6: INTBL? CONSTRUCTION-LOC,EAST-EXITS,15 \?CND8
+ INC 'CNT
+?CND8: INTBL? CONSTRUCTION-LOC,SE-EXITS,7 \?CND10
+ INC 'CNT
+?CND10: ADD CONSTRUCTION-LOC,8
+ INTBL? STACK,NORTH-EXITS,11 \?CND12
+ INC 'CNT
+?CND12: ADD CONSTRUCTION-LOC,7
+ INTBL? STACK,NE-EXITS,17 \?CND14
+ INC 'CNT
+?CND14: SUB CONSTRUCTION-LOC,1
+ INTBL? STACK,EAST-EXITS,15 \?CND16
+ INC 'CNT
+?CND16: SUB CONSTRUCTION-LOC,9
+ INTBL? STACK,SE-EXITS,7 \?CND18
+ INC 'CNT
+?CND18: PRINTI "You are in an abandoned underground construction site, roughly octagonal in shape. "
+ GRTR? CNT,0 \?CND20
+ PRINTI "There "
+ EQUAL? CNT,1 \?CCL24
+ PRINTI "is an exit"
+ JUMP ?CND22
+?CCL24: PRINTI "are exits"
+?CND22: PRINTI " to the "
+ INTBL? CONSTRUCTION-LOC,NORTH-EXITS,11 \?CND25
+ PRINTI "north"
+ DEC 'CNT
+ ICALL2 AND-OR-COMMA,CNT
+?CND25: INTBL? CONSTRUCTION-LOC,NE-EXITS,17 \?CND27
+ PRINTI "northeast"
+ DEC 'CNT
+ ICALL2 AND-OR-COMMA,CNT
+?CND27: INTBL? CONSTRUCTION-LOC,EAST-EXITS,15 \?CND29
+ PRINTI "east"
+ DEC 'CNT
+ ICALL2 AND-OR-COMMA,CNT
+?CND29: INTBL? CONSTRUCTION-LOC,SE-EXITS,7 \?CND31
+ PRINTI "southeast"
+ DEC 'CNT
+ ICALL2 AND-OR-COMMA,CNT
+?CND31: ADD CONSTRUCTION-LOC,8
+ INTBL? STACK,NORTH-EXITS,11 \?CND33
+ PRINTI "south"
+ DEC 'CNT
+ ICALL2 AND-OR-COMMA,CNT
+?CND33: ADD CONSTRUCTION-LOC,7
+ INTBL? STACK,NE-EXITS,17 \?CND35
+ PRINTI "southwest"
+ DEC 'CNT
+ ICALL2 AND-OR-COMMA,CNT
+?CND35: SUB CONSTRUCTION-LOC,1
+ INTBL? STACK,EAST-EXITS,15 \?CND37
+ PRINTI "west"
+ DEC 'CNT
+ ICALL2 AND-OR-COMMA,CNT
+?CND37: SUB CONSTRUCTION-LOC,9
+ INTBL? STACK,SE-EXITS,7 \?CND39
+ PRINTI "northwest"
+ DEC 'CNT
+ ICALL2 AND-OR-COMMA,CNT
+?CND39: PRINTI ". "
+?CND20: EQUAL? CONSTRUCTION-LOC,47 \?CND41
+ PRINTI "Also, a heavily used passage leads east. "
+?CND41: PRINTI "Engraved on the wall is the number "
+ PRINTN CONSTRUCTION-LOC
+ PRINTC 46
+ RTRUE
+?CCL3: EQUAL? RARG,M-ENTER \FALSE
+ DIV CONSTRUCTION-LOC,8
+ ADD STACK,1 >RANK
+ MOD CONSTRUCTION-LOC,8
+ ADD STACK,1 >FILE
+ CALL UNSTORE,CONSTRUCTION-OFFSET,CONSTRUCTION-LOC
+ RSTACK
+
+
+ .FUNCT AND-OR-COMMA,CNT
+ EQUAL? CNT,1 \?CCL3
+ PRINTI " and "
+ RTRUE
+?CCL3: GRTR? CNT,1 \FALSE
+ PRINTI ", "
+ RTRUE
+
+
+ .FUNCT CONSTRUCTION-MOVEMENT-F,RARG,CHANGE
+ ZERO? RARG \FALSE
+ ICALL STORE,CONSTRUCTION-OFFSET,CONSTRUCTION-LOC
+ CALL OBSTRUCTION,CONSTRUCTION-LOC,PRSO,TRUE-VALUE >CHANGE
+ EQUAL? CHANGE,100 \?CND3
+ RETURN FIELD-OFFICE
+?CND3: DIV CONSTRUCTION-LOC,8
+ ADD STACK,1 >RANK
+ MOD CONSTRUCTION-LOC,8
+ ADD STACK,1 >FILE
+ ZERO? CHANGE \?CCL7
+ ICALL UNSTORE,CONSTRUCTION-OFFSET,CONSTRUCTION-LOC
+ ICALL1 CANT-GO
+ RFALSE
+?CCL7: ADD CONSTRUCTION-LOC,CHANGE >CONSTRUCTION-LOC
+ ICALL UNSTORE,CONSTRUCTION-OFFSET,CONSTRUCTION-LOC
+ RETURN CONSTRUCTION
+
+ .SEGMENT "0"
+
+
+ .FUNCT REMOVE-ANY-PIECE,L,TAKER,TAKEE,CNT
+?PRG1: LESS? CNT,STORAGE-TABLE-LENGTH \TRUE
+ GET STORAGE-TABLE,CNT
+ EQUAL? STACK,L \?CND3
+ ADD CNT,1
+ GET STORAGE-TABLE,STACK >TAKEE
+ FSET? TAKEE,WHITEBIT /?CCL8
+ FSET? TAKEE,BLACKBIT \?CND3
+?CCL8: ICALL ROB,TAKEE,TAKER
+ PUT STORAGE-TABLE,CNT,0
+ ADD CNT,1
+ PUT STORAGE-TABLE,STACK,0
+?CND3: ADD CNT,2 >CNT
+ JUMP ?PRG1
+
+
+ .FUNCT PUT-IN-STORAGE,OFFSET,OBJ,L,CNT
+?PRG1: GET STORAGE-TABLE,CNT
+ ZERO? STACK \?CCL5
+ ADD L,OFFSET
+ PUT STORAGE-TABLE,CNT,STACK
+ ADD CNT,1
+ PUT STORAGE-TABLE,STACK,OBJ
+ RTRUE
+?CCL5: ADD CNT,2 >CNT
+ JUMP ?PRG1
+
+ .ENDSEG
+
+ .SEGMENT "VILLAGE"
+
+ .SEGMENT "FENSHIRE"
+
+ .SEGMENT "LOWER"
+
+
+ .FUNCT STORE,OFFSET,L,RM,CNT,F,N
+ ASSIGNED? 'RM /?CND1
+ SET 'RM,HERE
+?CND1: FIRST? RM >F /?PRG4
+?PRG4: ZERO? F /TRUE
+ NEXT? F >N /?CND6
+?CND6: EQUAL? F,PROTAGONIST /?CND10
+?PRG12: EQUAL? F,JESTER \?CCL16
+ ICALL1 REMOVE-J
+ JUMP ?CND10
+?CCL16: GET STORAGE-TABLE,CNT
+ ZERO? STACK \?CCL18
+ ADD L,OFFSET
+ PUT STORAGE-TABLE,CNT,STACK
+ ADD CNT,1
+ PUT STORAGE-TABLE,STACK,F
+ ADD CNT,2 >CNT
+ REMOVE F
+?CND10: SET 'F,N
+ JUMP ?PRG4
+?CCL18: ADD CNT,2 >CNT
+ JUMP ?PRG12
+
+
+ .FUNCT UNSTORE,OFFSET,L,RM,CNT,?TMP1
+ ASSIGNED? 'RM /?PRG3
+ SET 'RM,HERE
+?PRG3: LESS? CNT,STORAGE-TABLE-LENGTH \TRUE
+ GET STORAGE-TABLE,CNT >?TMP1
+ ADD L,OFFSET
+ EQUAL? ?TMP1,STACK \?CND5
+ ADD CNT,1
+ GET STORAGE-TABLE,STACK
+ MOVE STACK,RM
+ PUT STORAGE-TABLE,CNT,0
+ ADD CNT,1
+ PUT STORAGE-TABLE,STACK,0
+?CND5: ADD CNT,2 >CNT
+ JUMP ?PRG3
+
+ .ENDSEG
+
+ .ENDI
diff --git a/chess.zil b/chess.zil
new file mode 100644
index 0000000..309d52b
--- /dev/null
+++ b/chess.zil
@@ -0,0 +1,937 @@
+"CHESS for
+
+ ZORK ZERO
+ (c) Copyright 1988 Infocom, Inc. All Rights Reserved."
+
+<BEGIN-SEGMENT FENSHIRE>
+
+<GLOBAL RANK 2> ;"used for both Plain and Construction"
+
+<GLOBAL FILE 5> ;"used for both Plain and Construction"
+
+<GLOBAL PLAIN-LOC 12>
+
+<ROOM PLAIN
+ (LOC ROOMS)
+ (REGION "Region: Unknown")
+ (DESC "Plain")
+ (NORTH PER PLAIN-MOVEMENT-F)
+ (NE PER PLAIN-MOVEMENT-F)
+ (EAST PER PLAIN-MOVEMENT-F)
+ (SE PER PLAIN-MOVEMENT-F)
+ (SOUTH PER PLAIN-MOVEMENT-F)
+ (SW PER PLAIN-MOVEMENT-F)
+ (WEST PER PLAIN-MOVEMENT-F)
+ (NW PER PLAIN-MOVEMENT-F)
+ (FLAGS RLANDBIT OUTSIDEBIT ONBIT)
+ (VALUE 16)
+ (ACTION PLAIN-F)>
+
+;"if the sum of RANK and FILE is even, you're on a white square. If the sum
+is odd, you're on a black square."
+
+<ROUTINE PLAIN-F ("OPT" (RARG <>) "AUX" PIECE)
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL "You are on an amazingly flat plain of ">
+ <COND (<EQUAL? <MOD <+ ,RANK ,FILE> 2> 0>
+ <TELL "sun-bleached sand">)
+ (T
+ <TELL "deep, rich loam">)>
+ <TELL
+". The plain seems to stretch endlessly in all directions">
+ <COND (<OR <EQUAL? ,RANK 1 8>
+ <EQUAL? ,FILE 1 8>>
+ <TELL ", except to the ">
+ <COND (<EQUAL? ,RANK 1>
+ <TELL "north">
+ <COND (<EQUAL? ,FILE 1>
+ <TELL " and west">)
+ (<EQUAL? ,FILE 8>
+ <TELL " and east">)>)
+ (<EQUAL? ,RANK 8>
+ <TELL "south">
+ <COND (<EQUAL? ,FILE 1>
+ <TELL " and west">)
+ (<EQUAL? ,FILE 8>
+ <TELL " and east">)>)
+ (<EQUAL? ,FILE 1>
+ <TELL "west">)
+ (T
+ <TELL "east">)>
+ <TELL ", where the world seems to end in a gray void">)>
+ <TELL ".">)
+ (<AND <EQUAL? .RARG ,M-END>
+ <SET PIECE <OR <FIND-IN ,HERE ,BLACKBIT>
+ <FIND-IN ,HERE ,WHITEBIT>>>
+ <NOT <FSET? .PIECE ,TOUCHBIT>>>
+ <FSET .PIECE ,TOUCHBIT>
+ <COND (<PROB 30>
+ <TELL
+" The " D .PIECE " notices your cloak and bows gracefully. \"Greetings,
+Lordship. It's been a long time between moves -- I'll bet you've got a great
+one planned!\"" CR>)>)>>
+
+<ROUTINE PLAIN-MOVEMENT-F ("OPTIONAL" (RARG <>)) ;"called by NEXT-ROOM?"
+ <COND (.RARG
+ <RFALSE>)
+ (<OR <AND <EQUAL? ,RANK 1>
+ <PRSO? ,P?NORTH ,P?NE ,P?NW>>
+ <AND <EQUAL? ,RANK 8>
+ <PRSO? ,P?SOUTH ,P?SE ,P?SW>>
+ <AND <EQUAL? ,FILE 8>
+ <PRSO? ,P?EAST ,P?NE ,P?SE>>
+ <AND <EQUAL? ,FILE 1>
+ <PRSO? ,P?WEST ,P?NW ,P?SW>>>
+ <TELL "The world ends at a gray void in that direction." CR>
+ <RFALSE>)>
+ <COND (<PRSO? ,P?NORTH ,P?NE ,P?NW>
+ <SETG RANK <- ,RANK 1>>)>
+ <COND (<PRSO? ,P?SOUTH ,P?SE ,P?SW>
+ <SETG RANK <+ ,RANK 1>>)>
+ <COND (<PRSO? ,P?EAST ,P?SE ,P?NE>
+ <SETG FILE <+ ,FILE 1>>)>
+ <COND (<PRSO? ,P?WEST ,P?SW ,P?NW>
+ <SETG FILE <- ,FILE 1>>)>
+ <STORE ,PLAIN-OFFSET ,PLAIN-LOC>
+ <SETG PLAIN-LOC <- <+ <* <- ,RANK 1> 8> ,FILE> 1>>
+ <UNSTORE ,PLAIN-OFFSET ,PLAIN-LOC>
+ ,PLAIN>
+
+<OBJECT BLACK-KNIGHT
+ (DESC "mounted soldier")
+ (LDESC
+"There is a soldier on horseback here. His armor is made of the dullest
+metals, and his steed is darker than the night.")
+ (SYNONYM SOLDIER KNIGHT HORSE MAN)
+ (ADJECTIVE MOUNTED BLACK)
+ (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT BLACKBIT)
+ (ACTION PIECE-F)>
+
+<OBJECT WHITE-KNIGHT
+ (DESC "mounted soldier")
+ (LDESC
+"There is a soldier on horseback here. His armor is made of the shiniest
+metals, and his steed is lighter than drifted snow.")
+ (SYNONYM SOLDIER KNIGHT HORSE MAN)
+ (ADJECTIVE MOUNTED WHITE)
+ (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT WHITEBIT)
+ (ACTION PIECE-F)>
+
+<OBJECT BLACK-PAWN
+ (DESC "foot soldier")
+ (LDESC
+"You spot a solitary, bored-looking foot soldier. His face is smudged with
+coal dust, his uniform is sewn from deeply dyed wool, and the handle of his
+sword is solid obsidian.")
+ (SYNONYM SOLDIER PAWN MAN)
+ (ADJECTIVE FOOT BLACK)
+ (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT BLACKBIT)
+ (ACTION PIECE-F)>
+
+<OBJECT BLACK-QUEEN
+ (DESC "queen")
+ (LDESC
+"A regal woman proudly surveys the landscape in all directions. Her skin
+is dark; her royal garments even darker.")
+ (SYNONYM QUEEN WOMAN)
+ (ADJECTIVE REGAL PROUD DARK BLACK)
+ (FLAGS ACTORBIT FEMALEBIT CONTBIT OPENBIT SEARCHBIT BLACKBIT)
+ (ACTION PIECE-F)>
+
+<OBJECT WHITE-CASTLE
+ (DESC "man atop a castle tower")
+ (LDESC
+"Nearby rises a small tower keep, made of creamy marble. Between the
+crenellations of the parapet you spot a man, dressed in an ivory chain
+mail and carrying a crossbow made of birch.")
+ (SYNONYM MAN TOWER CASTLE ROOK)
+ (ADJECTIVE CASTLE WHITE)
+ (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT WHITEBIT)
+ (ACTION PIECE-F)>
+
+<OBJECT BLACK-BISHOP
+ (DESC "high priest")
+ (LDESC
+"You hear a sing-song prayer chant and turn to see a high priest of some sort.
+His tall, ebony headpiece bears a religious cipher, and his vestments seem to
+soak up all light.")
+ (SYNONYM PRIEST BISHOP MAN)
+ (ADJECTIVE HIGH BLACK)
+ (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT BLACKBIT)
+ (ACTION PIECE-F)>
+
+<OBJECT WHITE-PAWN
+ (DESC "foot soldier")
+ (LDESC
+"You spot a solitary, bored-looking foot soldier. His face is smudged with
+flour, his uniform is sewn from pure undyed cotton, and the handle of his
+sword is solid quartz.")
+ (SYNONYM SOLDIER PAWN MAN)
+ (ADJECTIVE WHITE FOOT)
+ (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT WHITEBIT)
+ (ACTION PIECE-F)>
+
+<OBJECT WHITE-QUEEN
+ (DESC "queen")
+ (LDESC
+"A regal woman proudly surveys the landscape in all directions. Her royal
+garments are as white as her pale complexion.")
+ (SYNONYM QUEEN WOMAN)
+ (ADJECTIVE REGAL PROUD WHITE)
+ (FLAGS ACTORBIT FEMALEBIT CONTBIT OPENBIT SEARCHBIT WHITEBIT)
+ (ACTION PIECE-F)>
+
+<OBJECT WHITE-KING
+ (DESC "royal leader")
+ (LDESC
+"A tall man wearing princely robes stands nearby. His bearing indicates that
+this is a man accustomed to command. His linen robes are trimmed with ermine,
+and his crown is studded with diamonds and opals.")
+ (SYNONYM LEADER KING MAN)
+ (ADJECTIVE ROYAL WHITE TALL)
+ (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT WHITEBIT)
+ (ACTION PIECE-F)>
+
+<OBJECT WHITE-KING-CROWN
+ (LOC WHITE-KING)
+ (DESC "crown")
+ (SYNONYM CROWN)
+ (FLAGS NDESCBIT)>
+
+<OBJECT WHITE-KING-ROBE
+ (LOC WHITE-KING)
+ (DESC "robe")
+ (SYNONYM ROBE)
+ (FLAGS NDESCBIT)>
+
+<OBJECT BLACK-KING
+ (DESC "royal leader")
+ (LDESC
+"A tall man wearing princely robes stands nearby. His bearing indicates that
+this is a man accustomed to command. His velvet robes are trimmed with mink,
+and his crown is studded with polished onyx.")
+ (SYNONYM LEADER KING MAN)
+ (ADJECTIVE ROYAL BLACK TALL)
+ (FLAGS ACTORBIT CONTBIT OPENBIT SEARCHBIT BLACKBIT)
+ (ACTION PIECE-F)>
+
+<OBJECT BLACK-KING-ROBE
+ (LOC BLACK-KING)
+ (DESC "robe")
+ (SYNONYM ROBE)
+ (FLAGS NDESCBIT)>
+
+<OBJECT BLACK-KING-CROWN
+ (LOC BLACK-KING)
+ (DESC "crown")
+ (SYNONYM CROWN)
+ (FLAGS NDESCBIT)>
+
+<BEGIN-SEGMENT 0>
+;<BEGIN-SEGMENT VILLAGE>
+;<BEGIN-SEGMENT LOWER>
+
+<GLOBAL DIR-CNT 0>
+
+<ROUTINE PIECE-F ("OPT" (ARG <>) "AUX" CNT)
+ <COND (<OR <FSET? ,WINNER ,BLACKBIT>
+ <FSET? ,WINNER ,WHITEBIT>>
+ <COND (,TIME-STOPPED
+ <SETG P-CONT -1>
+ <TELL
+"Seemingly frozen," T ,WINNER " is unresponsive." CR>)
+ (<AND <VERB? WALK>
+ <PRSO? ,P?IN ,P?OUT ,P?UP ,P?DOWN>>
+ <SETG DIR-CNT 0>
+ <TELL ,CANNOT-TRAVEL>
+ <STOP>)
+ (<AND <NOT <AND <VERB? WALK>
+ <T? ,P-WALK-DIR>>>
+ <NOT <AND <VERB? MOVE>
+ <PRSO? ,INTDIR>>>>
+ <SETG DIR-CNT 0>
+ <COND (<AND <VERB? WALK> ;"as in >ROOK, GO SOUTH ONE"
+ ;<PRSO? ,WALL>
+ <NOUN-USED? ,PRSO ,W?ONE>>
+ <TELL
+"[The proper way to ask" T ,WINNER " to move is simply to tell
+the direction(s), as in >CHARACTER, NW.NW]" CR>)
+ (T
+ <SETG P-CONT -1>
+ <TELL
+"\"You can tell me directions. That's it.\"" CR>)>)
+ (<NOT <EQUAL? ,HERE ,PLAIN ,CONSTRUCTION>>
+ <SETG P-CONT -1>
+ <TELL
+"\"The terrain is strange and unfamiliar; I am too terrified to move!\"" CR>)
+ (<EQUAL? ,DIR-CNT 7>
+ <SETG DIR-CNT 0>
+ <SETG P-CONT -1>
+ <TELL "\"Too many directions!\"" CR>)
+ (T
+ <COND (<VERB? MOVE>
+ <SETG PRSO <DIRECTION-CONVERSION>>)>
+ <PUT ,PIECE-MOVE-TABLE ,DIR-CNT ,PRSO>
+ <SETG DIR-CNT <+ ,DIR-CNT 1>>
+ <COND (<AND <G? ,DIR-CNT 1>
+ <NOT <EQUAL? ,WINNER
+ ,WHITE-KNIGHT
+ ,BLACK-KNIGHT>>
+ <NOT <EQUAL? ,PRSO
+ <GET ,PIECE-MOVE-TABLE
+ <- ,DIR-CNT 2>>>>>
+ ;"checks to make sure that all directions given
+ are the same, except in the case of knights"
+ <SETG DIR-CNT 0>
+ <COPYT ,PIECE-MOVE-TABLE 0 16>
+ <TELL ,CANNOT-TRAVEL>
+ <STOP>)
+ (<OR ,P-CONT ,M-PTR>
+ <SETG CLOCK-WAIT T>)
+ (T
+ <SETG DIR-CNT 0>
+ <MOVE-PIECE>)>)>
+ <RTRUE>)
+ (<AND <VERB? ENTER>
+ <PRSO? ,WHITE-CASTLE>
+ <NOT <NOUN-USED? ,WHITE-CASTLE ,W?MAN>>>
+ <TELL "Oddly, there doesn't seem to be any entrance." CR>)
+ (<AND <VERB? ENTER>
+ <PRSO? ,WHITE-KNIGHT ,BLACK-KNIGHT>
+ <NOUN-USED? ,PRSO ,W?HORSE>>
+ <TELL "The horse isn't large enough for two riders." CR>)
+ (<VERB? MOVE>
+ <TELL
+"Perhaps you should tell" T ,PRSO " the direction(s)." CR>)
+ (<AND <VERB? GIVE>
+ <NOT <FSET? ,PRSO ,TRYTAKEBIT>>
+ <NOT <FIND-IN ,PRSO ,TRYTAKEBIT>>
+ <OR <FSET? ,PRSI ,WHITEBIT>
+ <FSET? ,PRSI ,BLACKBIT>>>
+ <COND (,TIME-STOPPED
+ <PERFORM ,V?TELL ,PRSI>
+ <RTRUE>)>
+ <MOVE ,PRSO ,PRSI>
+ <TELL "The " D ,PRSI " takes" T ,PRSO ".">
+ <COND (<AND <PRSO? ,PIGEON>
+ <NOT <EQUAL? ,HERE <META-LOC ,PERCH>>>
+ <OR <NOT <EQUAL? ,HERE ,OUBLIETTE>>
+ <NOT <EQUAL? ,REMOVED-PERCH-LOC ,OUBLIETTE>>>>
+ <PIECE-TAKES-PIGEON ,PRSI>)
+ (T
+ <TELL
+" \"Your graciousness is not unappreciated, your Lordship.\"" CR>)>)
+ (<AND <VERB? ASK-FOR>
+ <OR <FSET? <LOC ,PRSI> ,WHITEBIT>
+ <FSET? <LOC ,PRSI> ,BLACKBIT>>>
+ <PERFORM ,V?TAKE ,PRSI>
+ <RTRUE>)>>
+
+<ROUTINE PIECE-TAKES-PIGEON (PIECE "OPTIONAL" (DO-CR T))
+ <MOVE-TO-PERCH .PIECE>
+ <TELL " Instantly,">
+ <COND (<EQUAL? .PIECE ,WHITE-CASTLE>
+ <TELL " the tower">)
+ (T
+ <TELL T .PIECE>)>
+ <TELL " seems to grow more distant without moving. Within seconds,">
+ <COND (<EQUAL? .PIECE ,WHITE-CASTLE>
+ <TELL " the tower">)
+ (T
+ <TELL T .PIECE>)>
+ <TELL " is gone.">
+ <COND (.DO-CR
+ <CRLF>)>
+ <RTRUE>>
+
+<CONSTANT PIECE-MOVE-TABLE
+ <TABLE 0 0 0 0 0 0 0 0>>
+
+<ROUTINE MOVE-PIECE
+ ("AUX" CNT DIR NEW-RANK NEW-FILE NEW-LOC X OFFSET BLOCK)
+ <SET NEW-RANK ,RANK>
+ <SET NEW-FILE ,FILE>
+ <SET NEW-LOC <+ <* <- .NEW-RANK 1> 8> <- .NEW-FILE 1>>>
+ <SET CNT 0>
+ <REPEAT ()
+ <SET DIR <GET ,PIECE-MOVE-TABLE .CNT>>
+ <COND (<EQUAL? .DIR <>>
+ <RETURN>)>
+ <COND (<EQUAL? .DIR ,P?NORTH ,P?NE ,P?NW>
+ <SET NEW-RANK <- .NEW-RANK 1>>)>
+ <COND (<EQUAL? .DIR ,P?EAST ,P?NE ,P?SE>
+ <SET NEW-FILE <+ .NEW-FILE 1>>)>
+ <COND (<EQUAL? .DIR ,P?SOUTH ,P?SE ,P?SW>
+ <SET NEW-RANK <+ .NEW-RANK 1>>)>
+ <COND (<EQUAL? .DIR ,P?WEST ,P?SW ,P?NW>
+ <SET NEW-FILE <- .NEW-FILE 1>>)>
+ <SET CNT <+ .CNT 1>>
+ <COND (<AND <EQUAL? ,HERE ,CONSTRUCTION>
+ <NOT <EQUAL? ,WINNER ,BLACK-KNIGHT ,WHITE-KNIGHT>>
+ <OBSTRUCTION .NEW-LOC .DIR>>
+ <SET BLOCK T>
+ <COND (<AND <EQUAL? .DIR ,P?EAST>
+ <EQUAL? .NEW-LOC 47>>
+ <TELL
+"\"Appearances deceive you -- such a move would send me
+off the edge of the world!\"" CR>)
+ (T
+ <TELL
+"\"My word! There appears to be a wall in the way!\"" CR>)>
+ <RETURN>)>
+ <SET NEW-LOC <+ <* <- .NEW-RANK 1> 8> <- .NEW-FILE 1>>>
+ <COND (<AND <GET ,PIECE-MOVE-TABLE .CNT>
+ <NOT <EQUAL? ,WINNER ,BLACK-KNIGHT ,WHITE-KNIGHT>>
+ <PIECE-AT-NEW-LOC? .NEW-LOC>>
+ <SET BLOCK T>
+ <TELL
+"\"Alas, the path between here and there is not unobstructed.\"" CR>
+ <RETURN>)>>
+ <SET DIR <DIR-TO-STRING <GET ,PIECE-MOVE-TABLE 0>>>
+ ;"for later use, after chess piece says 'I'm off!'"
+ <COPYT ,PIECE-MOVE-TABLE 0 16>
+ <COND (.BLOCK ;"obstructed path to new square"
+ <RTRUE>)>
+ <SET X <ILLEGAL-MOVE? .NEW-LOC .NEW-RANK .NEW-FILE>>
+ <COND (<EQUAL? .X ,M-FATAL> ;"pawn blocked by another piece"
+ <TELL "\"That land is occupied!\"" CR>
+ <RTRUE>)
+ (.X
+ <TELL ,CANNOT-TRAVEL>
+ <STOP>)
+ (<OR <G? .NEW-RANK 8>
+ <G? .NEW-FILE 8>
+ <L? .NEW-RANK 1>
+ <L? .NEW-FILE 1>>
+ <TELL
+"\"You would have me plunge off the end of the world">
+ <COND (<EQUAL? ,HERE ,CONSTRUCTION>
+ <TELL
+" -- or whatever passes for the end of the world in this forsaken badland">)>
+ <TELL "!\"" CR>)
+ (<NOT <TAKE-PIECE? .NEW-LOC>>
+ <REMOVE ,WINNER>
+ <TELL "\"I'm off!\" The " 'WINNER>
+ <COND (<EQUAL? ,WINNER ,WHITE-KNIGHT ,BLACK-KNIGHT>
+ <TELL
+" and his steed jump high into the air and vanish! A moment later, you hear
+a proud whinny in the distance.">)
+ (T
+ <TELL " moves out of sight to the " .DIR ".">)>
+ <CRLF>
+ <COND (<AND <EQUAL? ,WINNER ,WHITE-PAWN>
+ <EQUAL? ,HERE ,PLAIN>
+ <L? .NEW-LOC 8>> ;"promote pawn to queen"
+ <ROB ,WHITE-PAWN ,WHITE-QUEEN>
+ <SETG WINNER ,WHITE-QUEEN>)
+ (<AND <EQUAL? ,WINNER ,BLACK-PAWN>
+ <EQUAL? ,HERE ,PLAIN>
+ <G? .NEW-LOC 55>> ;"promote pawn to queen"
+ <ROB ,BLACK-PAWN ,BLACK-QUEEN>
+ <SETG WINNER ,BLACK-QUEEN>)>
+ <COND (<EQUAL? ,HERE ,PLAIN>
+ <SET OFFSET ,PLAIN-OFFSET>)
+ (T
+ <SET OFFSET ,CONSTRUCTION-OFFSET>)>
+ <PIECE-SNARF <+ .NEW-LOC .OFFSET> ,WINNER>
+ <PUT-IN-STORAGE .OFFSET ,WINNER .NEW-LOC>)>>
+
+<ROUTINE DIR-TO-STRING (DIR)
+ <COND (<EQUAL? .DIR ,P?UP>
+ <RETURN "up">)
+ (<EQUAL? .DIR ,P?DOWN>
+ <RETURN "down">)
+ (<EQUAL? .DIR ,P?NORTH>
+ <RETURN "north">)
+ (<EQUAL? .DIR ,P?NE>
+ <RETURN "northeast">)
+ (<EQUAL? .DIR ,P?EAST>
+ <RETURN "east">)
+ (<EQUAL? .DIR ,P?SE>
+ <RETURN "southeast">)
+ (<EQUAL? .DIR ,P?SOUTH>
+ <RETURN "south">)
+ (<EQUAL? .DIR ,P?SW>
+ <RETURN "southwest">)
+ (<EQUAL? .DIR ,P?WEST>
+ <RETURN "west">)
+ (<EQUAL? .DIR ,P?NW>
+ <RETURN "northwest">)>>
+
+<ROUTINE PIECE-SNARF (NEW-LOC SNARFER "AUX" OBJ (CNT 0) (TOOK-PIGEON <>))
+ <REPEAT ()
+ <COND (<NOT <L? .CNT ,STORAGE-TABLE-LENGTH>>
+ <RETURN>)
+ (<EQUAL? <GET ,STORAGE-TABLE .CNT> .NEW-LOC>
+ <SET OBJ <GET ,STORAGE-TABLE <+ .CNT 1>>>
+ <COND (<AND <FSET? .OBJ ,TAKEBIT>
+ <NOT <FSET? .OBJ ,TRYTAKEBIT>>
+ <NOT <FIND-IN .OBJ ,TRYTAKEBIT>>>
+ <COND (<EQUAL? .OBJ ,PIGEON>
+ <SET TOOK-PIGEON T>)>
+ <MOVE .OBJ .SNARFER>
+ <PUT ,STORAGE-TABLE .CNT 0>
+ <PUT ,STORAGE-TABLE <+ .CNT 1> 0>)>)>
+ <SET CNT <+ .CNT 2>>>
+ <COND (.TOOK-PIGEON
+ <MOVE-TO-PERCH .SNARFER>)>>
+
+<ROUTINE TAKE-PIECE? (NEW-LOC "AUX" (TAKEE <>) (VAL <>))
+ <SET TAKEE <PIECE-AT-NEW-LOC? .NEW-LOC>>
+ <COND (<NOT .TAKEE>
+ T)
+ (<OR <AND <FSET? .TAKEE ,WHITEBIT>
+ <FSET? ,WINNER ,WHITEBIT>>
+ <AND <FSET? .TAKEE ,BLACKBIT>
+ <FSET? ,WINNER ,BLACKBIT>>>
+ <TELL "\"I cannot attack one of my own side!\"" CR>
+ <SET VAL T>)
+ (T ;"take the TAKEE"
+ <PIECE-AT-NEW-LOC? .NEW-LOC T>)>
+ <RETURN .VAL> ;"this routine is called by a predicate">
+
+<ROUTINE ILLEGAL-MOVE? (NEW-LOC NEW-RANK NEW-FILE "AUX" (TAKEE <>) OLD-LOC)
+ <SET OLD-LOC <COND (<EQUAL? ,HERE ,PLAIN>
+ ,PLAIN-LOC)
+ (T
+ ,CONSTRUCTION-LOC)>>
+ <COND (<EQUAL? ,WINNER ,WHITE-KNIGHT ,BLACK-KNIGHT>
+ <COND (<EQUAL? <- .OLD-LOC .NEW-LOC>
+ 6 10 15 17 -6 -10 -15 -17>
+ <RFALSE>)
+ (T
+ <RTRUE>)>)
+ (<EQUAL? ,WINNER ,WHITE-KING ,BLACK-KING>
+ <COND (<EQUAL? <- .OLD-LOC .NEW-LOC>
+ 1 7 8 9 -1 -7 -8 -9>
+ <RFALSE>)
+ (T
+ <RTRUE>)>)
+ (<EQUAL? ,WINNER ,BLACK-BISHOP>
+ <COND (<G? .OLD-LOC .NEW-LOC>
+ <COND (<EQUAL? <MOD <- .OLD-LOC .NEW-LOC> 7> 0>
+ <RFALSE>)
+ (<EQUAL? <MOD <- .OLD-LOC .NEW-LOC> 9> 0>
+ <RFALSE>)
+ (T
+ <RTRUE>)>)
+ (T
+ <COND (<EQUAL? <MOD <- .NEW-LOC .OLD-LOC> 7> 0>
+ <RFALSE>)
+ (<EQUAL? <MOD <- .NEW-LOC .OLD-LOC> 9> 0>
+ <RFALSE>)
+ (T
+ <RTRUE>)>)>)
+ (<EQUAL? ,WINNER ,WHITE-CASTLE>
+ <COND (<AND <NOT <EQUAL? ,RANK .NEW-RANK>>
+ <NOT <EQUAL? ,FILE .NEW-FILE>>>
+ <RTRUE>)
+ (T
+ <RFALSE>)>)
+ (<EQUAL? ,WINNER ,WHITE-QUEEN ,BLACK-QUEEN>
+ <COND (<OR <EQUAL? ,RANK .NEW-RANK>
+ <EQUAL? ,FILE .NEW-FILE>>
+ <RFALSE>)
+ (<AND <G? .NEW-LOC .OLD-LOC>
+ <OR <EQUAL? <MOD <- .NEW-LOC .OLD-LOC> 7> 0>
+ <EQUAL? <MOD <- .NEW-LOC .OLD-LOC> 9> 0>>>
+ <RFALSE>)
+ (<AND <G? .OLD-LOC .NEW-LOC>
+ <OR <EQUAL? <MOD <- .OLD-LOC .NEW-LOC> 7> 0>
+ <EQUAL? <MOD <- .OLD-LOC .NEW-LOC> 9> 0>>>
+ <RFALSE>)
+ (T
+ <RTRUE>)>)
+ (<EQUAL? ,WINNER ,BLACK-PAWN>
+ <SET TAKEE <PIECE-AT-NEW-LOC? .NEW-LOC>>
+ <COND (<AND <EQUAL? .OLD-LOC 14>
+ <EQUAL? .NEW-LOC 30>>
+ ;"pawn can move two spaces on first move"
+ <COND (.TAKEE
+ <RFATAL>)
+ (T
+ <RFALSE>)>)
+ (<EQUAL? <- .NEW-LOC .OLD-LOC> 7 9>
+ <COND (<NOT .TAKEE>
+ <RTRUE>)
+ (T
+ <RFALSE>)>)
+ (<EQUAL? <- .NEW-LOC .OLD-LOC> 8>
+ <COND (.TAKEE
+ <RFATAL>)
+ (T
+ <RFALSE>)>)
+ (T
+ <RTRUE>)>)
+ (<EQUAL? ,WINNER ,WHITE-PAWN>
+ <SET TAKEE <PIECE-AT-NEW-LOC? .NEW-LOC>>
+ <COND (<AND <EQUAL? .OLD-LOC 49>
+ <EQUAL? .NEW-LOC 33>>
+ ;"pawn can move two spaces on first move"
+ <COND (.TAKEE
+ <RFATAL>)
+ (T
+ <RFALSE>)>)
+ (<EQUAL? <- .OLD-LOC .NEW-LOC> 7 9>
+ <COND (.TAKEE
+ <RFALSE>)
+ (T
+ <RTRUE>)>)
+ (<EQUAL? <- .OLD-LOC .NEW-LOC> 8>
+ <COND (.TAKEE
+ <RFATAL>)
+ (T
+ <RFALSE>)>)
+ (T
+ <RTRUE>)>)
+ (T
+ <TELL "Bug7" CR>)>>
+
+<ROUTINE PIECE-AT-NEW-LOC?
+ (NEW-LOC "OPTIONAL" (TAKE-PIECE <>) "AUX" (CNT 0) (TAKEE <>))
+ <SET NEW-LOC <+ .NEW-LOC <COND (<EQUAL? ,HERE ,CONSTRUCTION>
+ ,CONSTRUCTION-OFFSET)
+ (T
+ ,PLAIN-OFFSET)>>>
+ <REPEAT ()
+ <COND (<EQUAL? .NEW-LOC <GET ,STORAGE-TABLE .CNT>>
+ <SET TAKEE <GET ,STORAGE-TABLE <+ .CNT 1>>>
+ <COND (<OR <FSET? .TAKEE ,WHITEBIT>
+ <FSET? .TAKEE ,BLACKBIT>>
+ <COND (.TAKE-PIECE
+ <ROB .TAKEE ,WINNER>
+ <PUT ,STORAGE-TABLE .CNT 0>)>
+ <RETURN>)>)>
+ <SET CNT <+ .CNT 2>>
+ <COND (<NOT <L? .CNT ,STORAGE-TABLE-LENGTH>>
+ <RETURN>)>>
+ <COND (<NOT .TAKEE>
+ <RFALSE>)
+ (<OR <FSET? .TAKEE ,WHITEBIT>
+ <FSET? .TAKEE ,BLACKBIT>>
+ <RETURN .TAKEE>)
+ (T
+ <RFALSE>)>>
+
+<ROUTINE OBSTRUCTION (L DIR "OPT" (CALLED-BY-EXIT-F <>) "AUX" (CHANGE 0))
+ <COND (<AND <EQUAL? .DIR ,P?NORTH>
+ <OR <INTBL? .L ,NORTH-EXITS 11>
+ <INTBL? <+ .L 100> ,NORTH-EXITS 11>>>
+ <SET CHANGE -8>)
+ (<AND <EQUAL? .DIR ,P?NE>
+ <INTBL? .L ,NE-EXITS 17>>
+ <SET CHANGE -7>)
+ (<EQUAL? .DIR ,P?EAST>
+ <COND (<AND <EQUAL? .L 47>
+ .CALLED-BY-EXIT-F>
+ <SET CHANGE 100> ;"kludge")
+ (<INTBL? .L ,EAST-EXITS 15>
+ <SET CHANGE 1>)>)
+ (<AND <EQUAL? .DIR ,P?SE>
+ <OR <INTBL? .L ,SE-EXITS 7>
+ <INTBL? <+ .L 100> ,SE-EXITS 7>>>
+ <SET CHANGE 9>)
+ (<AND <EQUAL? .DIR ,P?SOUTH>
+ <OR <INTBL? <+ .L 8> ,NORTH-EXITS 11>
+ <INTBL? <+ .L 108> ,NORTH-EXITS 11>>>
+ <SET CHANGE 8>)
+ (<AND <EQUAL? .DIR ,P?SW>
+ <INTBL? <+ .L 7> ,NE-EXITS 17>>
+ <SET CHANGE 7>)
+ (<AND <EQUAL? .DIR ,P?WEST>
+ <INTBL? <- .L 1> ,EAST-EXITS 15>>
+ <SET CHANGE -1>)
+ (<AND <EQUAL? .DIR ,P?NW>
+ <OR <INTBL? <- .L 9> ,SE-EXITS 7>
+ <INTBL? <+ .L 91> ,SE-EXITS 7>>>
+ <SET CHANGE -9>)>
+ <COND (.CALLED-BY-EXIT-F
+ <RETURN .CHANGE>)
+ (<EQUAL? .CHANGE 0>
+ <RTRUE>)
+ (T
+ <RFALSE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT LOWER>
+
+<ROOM FIELD-OFFICE
+ (LOC ROOMS)
+ (DESC "Field Office")
+ (REGION "Flatheadia")
+ (LDESC
+"This is a temporary headquarters for a construction site to the west.
+Another exit leads east.")
+ (EAST TO EXIT)
+ (WEST PER CONSTRUCTION-ENTER-F)
+ (FLAGS RLANDBIT UNDERGROUNDBIT)
+ (MAP-LOC <PTABLE LOWER-LEVEL-MAP-NUM MAP-GEN-Y-7 MAP-GEN-X-4>)>
+
+<ROUTINE CONSTRUCTION-ENTER-F ("OPTIONAL" (RARG <>)) ;"called by NEXT-ROOM?"
+ <COND (.RARG
+ <RFALSE>)>
+ <SETG CONSTRUCTION-LOC 47>
+ ,CONSTRUCTION>
+
+<OBJECT BLUEPRINT
+ (LOC FIELD-OFFICE)
+ (DESC "blueprint")
+ (SYNONYM BLUEPRINT)
+ (FLAGS TAKEBIT BURNBIT READBIT)
+ (SIZE 2)
+ (TEXT "[This is the blueprint from your ZORK ZERO package.]")>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT HAMMER ;"in table, at Construction room #61"
+ (DESC "hammer")
+ (SYNONYM HAMMER)
+ (FLAGS TAKEBIT)
+ (SIZE 16)
+ (ACTION HAMMER-F)>
+
+<ROUTINE HAMMER-F ()
+ <COND (<AND <VERB? KILL>
+ <PRSI? ,HAMMER>> ;"hit object with hammer"
+ <PERFORM ,V?MUNG ,PRSO ,HAMMER>
+ <RTRUE>)
+ (<AND <VERB? MUNG>
+ <PRSI? ,HAMMER>
+ <FSET? ,PRSO ,ANIMATEDBIT>>
+ <TELL "Fortunately," T ,PRSO " evades your blow." CR>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT LOWER>
+
+<ROOM CONSTRUCTION
+ (LOC ROOMS)
+ (DESC "Construction")
+ (REGION "Flatheadia")
+ (NORTH PER CONSTRUCTION-MOVEMENT-F)
+ (NE PER CONSTRUCTION-MOVEMENT-F)
+ (EAST PER CONSTRUCTION-MOVEMENT-F)
+ (SE PER CONSTRUCTION-MOVEMENT-F)
+ (SOUTH PER CONSTRUCTION-MOVEMENT-F)
+ (SW PER CONSTRUCTION-MOVEMENT-F)
+ (WEST PER CONSTRUCTION-MOVEMENT-F)
+ (NW PER CONSTRUCTION-MOVEMENT-F)
+ (FLAGS RLANDBIT UNDERGROUNDBIT)
+ (ACTION CONSTRUCTION-F)>
+
+<ROUTINE CONSTRUCTION-F ("OPT" (RARG <>) "AUX" (CNT 0))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <COND (<INTBL? ,CONSTRUCTION-LOC ,NORTH-EXITS 11>
+ <SET CNT <+ .CNT 1>>)>
+ <COND (<INTBL? ,CONSTRUCTION-LOC ,NE-EXITS 17>
+ <SET CNT <+ .CNT 1>>)>
+ <COND (<INTBL? ,CONSTRUCTION-LOC ,EAST-EXITS 15>
+ <SET CNT <+ .CNT 1>>)>
+ <COND (<INTBL? ,CONSTRUCTION-LOC ,SE-EXITS 7>
+ <SET CNT <+ .CNT 1>>)>
+ <COND (<INTBL? <+ ,CONSTRUCTION-LOC 8> ,NORTH-EXITS 11>
+ <SET CNT <+ .CNT 1>>)>
+ <COND (<INTBL? <+ ,CONSTRUCTION-LOC 7> ,NE-EXITS 17>
+ <SET CNT <+ .CNT 1>>)>
+ <COND (<INTBL? <- ,CONSTRUCTION-LOC 1> ,EAST-EXITS 15>
+ <SET CNT <+ .CNT 1>>)>
+ <COND (<INTBL? <- ,CONSTRUCTION-LOC 9> ,SE-EXITS 7>
+ <SET CNT <+ .CNT 1>>)>
+ <TELL
+"You are in an abandoned underground construction site, roughly
+octagonal in shape. ">
+ <COND (<G? .CNT 0>
+ <TELL "There ">
+ <COND (<EQUAL? .CNT 1>
+ <TELL "is an exit">)
+ (T
+ <TELL "are exits">)>
+ <TELL " to the ">
+ <COND (<INTBL? ,CONSTRUCTION-LOC ,NORTH-EXITS 11>
+ <TELL "north">
+ <SET CNT <- .CNT 1>>
+ <AND-OR-COMMA .CNT>)>
+ <COND (<INTBL? ,CONSTRUCTION-LOC ,NE-EXITS 17>
+ <TELL "northeast">
+ <SET CNT <- .CNT 1>>
+ <AND-OR-COMMA .CNT>)>
+ <COND (<INTBL? ,CONSTRUCTION-LOC ,EAST-EXITS 15>
+ <TELL "east">
+ <SET CNT <- .CNT 1>>
+ <AND-OR-COMMA .CNT>)>
+ <COND (<INTBL? ,CONSTRUCTION-LOC ,SE-EXITS 7>
+ <TELL "southeast">
+ <SET CNT <- .CNT 1>>
+ <AND-OR-COMMA .CNT>)>
+ <COND (<INTBL? <+ ,CONSTRUCTION-LOC 8> ,NORTH-EXITS 11>
+ <TELL "south">
+ <SET CNT <- .CNT 1>>
+ <AND-OR-COMMA .CNT>)>
+ <COND (<INTBL? <+ ,CONSTRUCTION-LOC 7> ,NE-EXITS 17>
+ <TELL "southwest">
+ <SET CNT <- .CNT 1>>
+ <AND-OR-COMMA .CNT>)>
+ <COND (<INTBL? <- ,CONSTRUCTION-LOC 1> ,EAST-EXITS 15>
+ <TELL "west">
+ <SET CNT <- .CNT 1>>
+ <AND-OR-COMMA .CNT>)>
+ <COND (<INTBL? <- ,CONSTRUCTION-LOC 9> ,SE-EXITS 7>
+ <TELL "northwest">
+ <SET CNT <- .CNT 1>>
+ <AND-OR-COMMA .CNT>)>
+ <TELL ". ">)>
+ <COND (<EQUAL? ,CONSTRUCTION-LOC 47>
+ <TELL "Also, a heavily used passage leads east. ">)>
+ <TELL
+"Engraved on the wall is the number " N ,CONSTRUCTION-LOC ".">)
+ (<EQUAL? .RARG ,M-ENTER>
+ <SETG RANK <+ </ ,CONSTRUCTION-LOC 8> 1>>
+ <SETG FILE <+ <MOD ,CONSTRUCTION-LOC 8> 1>>
+ <UNSTORE ,CONSTRUCTION-OFFSET ,CONSTRUCTION-LOC>)>>
+
+<ROUTINE AND-OR-COMMA (CNT)
+ <COND (<EQUAL? .CNT 1>
+ <TELL " and ">)
+ (<G? .CNT 1>
+ <TELL ", ">)>>
+
+<ROUTINE CONSTRUCTION-MOVEMENT-F ("OPT" (RARG <>) "AUX" (CHANGE 0))
+ <COND (.RARG
+ <RFALSE>)>
+ <STORE ,CONSTRUCTION-OFFSET ,CONSTRUCTION-LOC>
+ <SET CHANGE <OBSTRUCTION ,CONSTRUCTION-LOC ,PRSO T>>
+ <COND (<EQUAL? .CHANGE 100>
+ <RETURN ,FIELD-OFFICE>)>
+ <SETG RANK <+ </ ,CONSTRUCTION-LOC 8> 1>>
+ <SETG FILE <+ <MOD ,CONSTRUCTION-LOC 8> 1>>
+ <COND (<EQUAL? .CHANGE 0>
+ <UNSTORE ,CONSTRUCTION-OFFSET ,CONSTRUCTION-LOC>
+ <CANT-GO>
+ <RFALSE>)
+ (T
+ <SETG CONSTRUCTION-LOC <+ ,CONSTRUCTION-LOC .CHANGE>>
+ <UNSTORE ,CONSTRUCTION-OFFSET ,CONSTRUCTION-LOC>
+ ,CONSTRUCTION)>>
+
+<GLOBAL CONSTRUCTION-LOC 47>
+
+<CONSTANT NORTH-EXITS ;"10 rooms plus placeholder for FM passage = 11 entries"
+ <TABLE 99 ;"placeholder" 20 33 37 40 46 48 50 55 59 61>>
+
+<CONSTANT NE-EXITS ;"17 rooms"
+ <TABLE 12 13 14 20 22 27 28 29 33 36 41 43 46 49 50 53 54>>
+
+<CONSTANT EAST-EXITS ;"15 rooms"
+ <TABLE 5 6 12 22 26 30 34 38 42 44 51 56 57 61 62>>
+
+<CONSTANT SE-EXITS ;"6 rooms plus one placeholder = 7 entries"
+ <TABLE 99 ;"placeholder" 17 40 43 48 51 54>>
+
+<OBJECT HARDHAT ;"in table, at Construction room #0"
+ (DESC "hardhat")
+ (SYNONYM HARDHAT HAT)
+ (ADJECTIVE HARD)
+ (FLAGS TAKEBIT WEARBIT)
+ (GENERIC G-HAT-F)
+ (VALUE 25)>
+
+<BEGIN-SEGMENT 0>
+
+<ROUTINE REMOVE-ANY-PIECE (L TAKER "AUX" TAKEE (CNT 0))
+ <REPEAT ()
+ <COND (<NOT <L? .CNT ,STORAGE-TABLE-LENGTH>>
+ <RETURN>)
+ (<EQUAL? <GET ,STORAGE-TABLE .CNT> .L>
+ <SET TAKEE <GET ,STORAGE-TABLE <+ .CNT 1>>>
+ <COND (<OR <FSET? .TAKEE ,WHITEBIT>
+ <FSET? .TAKEE ,BLACKBIT>>
+ <ROB .TAKEE .TAKER>
+ <PUT ,STORAGE-TABLE .CNT 0>
+ <PUT ,STORAGE-TABLE <+ .CNT 1> 0>)>)>
+ <SET CNT <+ .CNT 2>>>>
+
+;"codes for putting items in storage in fake rooms, shared by Plain,
+Construction, and all five FrobozzCo Building fake rooms"
+
+<CONSTANT STORAGE-TABLE
+ <TABLE 301 BLACK-KNIGHT
+ 314 BLACK-PAWN
+ 315 WHITE-KNIGHT
+ 328 BLACK-BISHOP
+ 337 BLACK-KING
+ 349 WHITE-PAWN
+ 357 WHITE-KING
+ 363 WHITE-CASTLE
+ 400 HARDHAT
+ 461 HAMMER
+ 1004 MEMO
+ 3019 T-SQUARE
+ 4193 INSTRUCTION-BOOKLET
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>>
+
+<CONSTANT PLAIN-OFFSET 300>
+<CONSTANT CONSTRUCTION-OFFSET 400>
+<CONSTANT OFFICES-OFFSET 1000>
+<CONSTANT OFFICES-N-OFFSET 2000>
+<CONSTANT OFFICES-S-OFFSET 3000>
+<CONSTANT OFFICES-E-OFFSET 4000>
+<CONSTANT OFFICES-W-OFFSET 5000>
+
+<CONSTANT STORAGE-TABLE-LENGTH 200>
+
+<ROUTINE PUT-IN-STORAGE (OFFSET OBJ L "AUX" (CNT 0))
+ <REPEAT ()
+ <COND (<EQUAL? <GET ,STORAGE-TABLE .CNT> 0>
+ <PUT ,STORAGE-TABLE .CNT <+ .L .OFFSET>>
+ <PUT ,STORAGE-TABLE <+ .CNT 1> .OBJ>
+ <RETURN>)
+ (T
+ <SET CNT <+ .CNT 2>>)>>>
+
+<END-SEGMENT>
+<BEGIN-SEGMENT LOWER>
+<BEGIN-SEGMENT FENSHIRE>
+<BEGIN-SEGMENT VILLAGE>
+
+<ROUTINE STORE (OFFSET L "OPT" (RM ,HERE) "AUX" (CNT 0) F N)
+ <SET F <FIRST? .RM>>
+ <REPEAT ()
+ <COND (.F
+ <SET N <NEXT? .F>>)
+ (T
+ <RETURN>)>
+ <COND (<NOT <EQUAL? .F ,PROTAGONIST>>
+ <REPEAT ()
+ <COND (<EQUAL? .F ,JESTER>
+ <REMOVE-J>
+ <RETURN>)
+ (<EQUAL? <GET ,STORAGE-TABLE .CNT> 0>
+ <PUT ,STORAGE-TABLE .CNT <+ .L .OFFSET>>
+ <PUT ,STORAGE-TABLE <+ .CNT 1> .F>
+ <SET CNT <+ .CNT 2>>
+ <REMOVE .F>
+ <RETURN>)
+ (T
+ <SET CNT <+ .CNT 2>>)>>)>
+ <SET F .N>>>
+
+<ROUTINE UNSTORE (OFFSET L "OPT" (RM ,HERE) "AUX" (CNT 0))
+ <REPEAT ()
+ <COND (<NOT <L? .CNT ,STORAGE-TABLE-LENGTH>>
+ <RETURN>)
+ (<EQUAL? <GET ,STORAGE-TABLE .CNT> <+ .L .OFFSET>>
+ <MOVE <GET ,STORAGE-TABLE <+ .CNT 1>> .RM>
+ <PUT ,STORAGE-TABLE .CNT 0>
+ <PUT ,STORAGE-TABLE <+ .CNT 1> 0>)>
+ <SET CNT <+ .CNT 2>>>>
+
+<END-SEGMENT> \ No newline at end of file
diff --git a/clues.zap b/clues.zap
new file mode 100644
index 0000000..5c3f00f
--- /dev/null
+++ b/clues.zap
@@ -0,0 +1,505 @@
+
+ .SEGMENT "HINTS"
+
+
+ .FUNCT DO-HINTS,Q,WIN,FCLR,WCLR,CHR,TMP,MAXC,?TMP1
+ HLIGHT H-NORMAL
+ CALL1 INIT-HINT-SCREEN >WIN
+ WINGET -3,WFSIZE
+ SHIFT STACK,-8 >Q
+ WINGET -3,WTOP
+ SUB STACK,1
+ DIV STACK,Q
+ ADD 1,STACK >TOP-HINT-LINE
+ WINGET -3,WHIGH
+ DIV STACK,Q
+ SUB STACK,1 >BOTTOM-HINT-NUM
+ WINGET -3,WFSIZE
+ BAND STACK,255 >Q
+ WINGET -3,WLEFT
+ SUB STACK,1
+ DIV STACK,Q
+ ADD 2,STACK >LEFT-HINT-COLUMN
+?PRG1: CLEAR S-TEXT
+ SCREEN WIN
+ WINGET WIN,WCOLOR >WCLR
+ GET 0,0
+ BTST STACK,1 \?CCL5
+ ICALL CCURSET,2,9
+ COLOR 1,-1
+ JUMP ?CND3
+?CCL5: COLOR 1,1
+?CND3: ICALL HINT-TITLE,INVISICLUES,WIN
+ SCREEN S-FULL
+ WINGET S-FULL,WCOLOR >FCLR
+ WINGET S-TEXT,WCOLOR
+ BAND STACK,255 >?TMP1
+ WINGET S-TEXT,WCOLOR
+ SHIFT STACK,-8
+ COLOR ?TMP1,STACK
+ DIROUT D-TABLE-ON,SLINE
+ DIROUT D-TABLE-OFF
+ SET 'GET-HINT-ROUTINE,H-CHAPT-NAME
+ GET HINTS,0
+ ICALL2 H-PUT-UP-FROBS,STACK
+ ICALL2 H-NEW-CURSOR,H-CHAPT-NUM
+ GET HINTS,0 >MAXC
+?PRG6: ZERO? DEMO-VERSION? /?CCL10
+ CALL2 INPUT-DEMO,1 >CHR
+ JUMP ?CND8
+?CCL10: INPUT 1 >CHR
+?CND8: EQUAL? CHR,CLICK1,CLICK2 \?CND11
+ CALL1 SELECT-HINT-BY-MOUSE >TMP
+ GRTR? TMP,0 /?CND11
+ EQUAL? TMP,-1 \?CCL17
+ SET 'CHR,78
+ JUMP ?CND11
+?CCL17: EQUAL? TMP,-2 \?CCL19
+ SET 'CHR,80
+ JUMP ?CND11
+?CCL19: EQUAL? TMP,-3 \?CCL21
+ SET 'CHR,13
+ JUMP ?CND11
+?CCL21: EQUAL? TMP,-4 \?CCL23
+ SET 'CHR,81
+?CND11: EQUAL? CHR,77,109,81 /?CTR25
+ EQUAL? CHR,113 \?CCL26
+?CTR25: SET 'Q,TRUE-VALUE
+ JUMP ?REP7
+?CCL23: SOUND S-BEEP
+ JUMP ?PRG6
+?CCL26: EQUAL? CHR,78,110,DOWN-ARROW \?CCL30
+ ICALL H-NEW-CURSOR,H-CHAPT-NUM,TRUE-VALUE
+ EQUAL? H-CHAPT-NUM,MAXC \?CCL33
+ SET 'H-CHAPT-NUM,1
+ JUMP ?CND31
+?CCL33: INC 'H-CHAPT-NUM
+?CND31: SET 'H-QUEST-NUM,1
+ ICALL2 H-NEW-CURSOR,H-CHAPT-NUM
+ JUMP ?PRG6
+?CCL30: EQUAL? CHR,80,112,UP-ARROW \?CCL35
+ ICALL H-NEW-CURSOR,H-CHAPT-NUM,TRUE-VALUE
+ EQUAL? H-CHAPT-NUM,1 \?CCL38
+ SET 'H-CHAPT-NUM,MAXC
+ JUMP ?CND36
+?CCL38: DEC 'H-CHAPT-NUM
+?CND36: SET 'H-QUEST-NUM,1
+ ICALL2 H-NEW-CURSOR,H-CHAPT-NUM
+ JUMP ?PRG6
+?CCL35: EQUAL? CHR,13,10,32 \?CCL40
+ CALL1 H-PICK-QUESTION >Q
+ JUMP ?REP7
+?CCL40: EQUAL? CHR,CLICK1,CLICK2 \?CCL42
+ GRTR? TMP,MAXC \?CCL45
+ SOUND S-BEEP
+ JUMP ?PRG6
+?CCL45: ICALL H-NEW-CURSOR,H-CHAPT-NUM,TRUE-VALUE
+ SET 'H-CHAPT-NUM,TMP
+ SET 'H-QUEST-NUM,1
+ ICALL2 H-NEW-CURSOR,H-CHAPT-NUM
+ EQUAL? CHR,CLICK2 \?PRG6
+ CALL1 H-PICK-QUESTION >Q
+?REP7: ZERO? Q /?PRG1
+ CLEAR -1
+ SCREEN WIN
+ BAND WCLR,255 >?TMP1
+ SHIFT WCLR,-8
+ COLOR ?TMP1,STACK
+ SCREEN S-FULL
+ BAND FCLR,255 >?TMP1
+ SHIFT FCLR,-8
+ COLOR ?TMP1,STACK
+ SCREEN S-TEXT
+ HLIGHT H-NORMAL
+ ICALL1 INIT-STATUS-LINE
+ PRINTI "Back to the story..."
+ CRLF
+ RETURN 2
+?CCL42: SOUND S-BEEP
+ JUMP ?PRG6
+
+
+ .FUNCT H-PICK-QUESTION,CHR,MAXQ,Q,WID,TMP
+?FCN: CATCH >PARSE-SENTENCE-ACTIVATION
+ HLIGHT H-NORMAL
+ CLEAR S-TEXT
+ GET HINTS,H-CHAPT-NUM
+ GET STACK,1
+ ICALL HINT-TITLE,STACK,S-WINDOW
+ CALL CENTER-LINE,M-MAIN-HINT-MENU,2 >WID
+ GET HINTS,H-CHAPT-NUM
+ GET STACK,0
+ SUB STACK,1 >MAXQ
+ SCREEN S-FULL
+ SET 'GET-HINT-ROUTINE,H-GET-QUEST
+ GET HINTS,H-CHAPT-NUM
+ GET STACK,0
+ SUB STACK,1
+ ICALL2 H-PUT-UP-FROBS,STACK
+ ICALL2 H-NEW-CURSOR,H-QUEST-NUM
+?PRG1: ZERO? DEMO-VERSION? /?CCL5
+ CALL2 INPUT-DEMO,1 >CHR
+ JUMP ?CND3
+?CCL5: INPUT 1 >CHR
+?CND3: EQUAL? CHR,CLICK1,CLICK2 \?CND6
+ CALL2 SELECT-HINT-BY-MOUSE,WID >TMP
+ GRTR? TMP,0 /?CND6
+ EQUAL? TMP,-1 \?CCL12
+ SET 'CHR,78
+ JUMP ?CND6
+?CCL12: EQUAL? TMP,-2 \?CCL14
+ SET 'CHR,80
+ JUMP ?CND6
+?CCL14: EQUAL? TMP,-3 \?CCL16
+ SET 'CHR,13
+ JUMP ?CND6
+?CCL16: EQUAL? TMP,-4 \?CCL18
+ SET 'CHR,81
+ JUMP ?CND6
+?CCL18: EQUAL? TMP,-5 \?CCL20
+ SET 'CHR,77
+?CND6: EQUAL? CHR,81,113 /TRUE
+ EQUAL? CHR,77,109 \?CCL25
+ SET 'Q,TRUE-VALUE
+ JUMP ?REP2
+?CCL20: SOUND S-BEEP
+ JUMP ?PRG1
+?CCL25: EQUAL? CHR,78,110,DOWN-ARROW \?CCL27
+ ICALL H-NEW-CURSOR,H-QUEST-NUM,TRUE-VALUE
+ EQUAL? H-QUEST-NUM,MAXQ \?CCL30
+ SET 'H-QUEST-NUM,1
+ JUMP ?CND28
+?CCL30: INC 'H-QUEST-NUM
+?CND28: ICALL2 H-NEW-CURSOR,H-QUEST-NUM
+ JUMP ?PRG1
+?CCL27: EQUAL? CHR,80,112,UP-ARROW \?CCL32
+ ICALL H-NEW-CURSOR,H-QUEST-NUM,TRUE-VALUE
+ EQUAL? H-QUEST-NUM,1 \?CCL35
+ SET 'H-QUEST-NUM,MAXQ
+ JUMP ?CND33
+?CCL35: DEC 'H-QUEST-NUM
+?CND33: ICALL2 H-NEW-CURSOR,H-QUEST-NUM
+ JUMP ?PRG1
+?CCL32: EQUAL? CHR,CLICK1,CLICK2 \?CCL37
+ GRTR? TMP,MAXQ \?CCL40
+ SOUND S-BEEP
+ JUMP ?PRG1
+?CCL40: ICALL H-NEW-CURSOR,H-QUEST-NUM,TRUE-VALUE
+ SET 'H-QUEST-NUM,TMP
+ ICALL2 H-NEW-CURSOR,H-QUEST-NUM
+ EQUAL? CHR,CLICK2 \?PRG1
+ ICALL1 DISPLAY-HINT
+ JUMP ?REP2
+?CCL37: EQUAL? CHR,13,10,32 \?CCL44
+ ICALL1 DISPLAY-HINT
+?REP2: ZERO? Q /?FCN
+ RFALSE
+?CCL44: SOUND S-BEEP
+ JUMP ?PRG1
+
+
+ .FUNCT H-NEW-CURSOR,POS,OFF?,Y,X
+ ADD TOP-HINT-LINE,POS >Y
+ SET 'X,LEFT-HINT-COLUMN
+ GRTR? POS,BOTTOM-HINT-NUM \?CND1
+ SUB Y,BOTTOM-HINT-NUM >Y
+ GETB 0,33
+ DIV STACK,2 >X
+?CND1: ICALL CCURSET,Y,X
+ ZERO? OFF? \?CCL5
+ HLIGHT H-INVERSE
+ JUMP ?CND3
+?CCL5: HLIGHT H-NORMAL
+?CND3: CALL GET-HINT-ROUTINE,POS
+ PRINT STACK
+ PRINTC 32
+ ZERO? OFF? \FALSE
+ HLIGHT H-NORMAL
+ RTRUE
+
+
+ .FUNCT SELECT-HINT-BY-MOUSE,WID,VAL,MID,X,Y,?TMP1
+ WINGET -3,WFSIZE
+ SHIFT STACK,-8 >VAL
+ GET 0,27
+ GET STACK,2 >Y
+ GET 0,27
+ GET STACK,1 >X
+ SUB Y,1
+ DIV STACK,VAL >VAL
+ GETB 0,33 >?TMP1
+ WINGET -3,WFSIZE
+ BAND STACK,255
+ MUL ?TMP1,STACK
+ DIV STACK,2 >MID
+ SUB TOP-HINT-LINE,1
+ LESS? VAL,STACK \?CCL3
+ EQUAL? VAL,1 \?CCL6
+ DIV WID,2 >VAL
+ ZERO? VAL /?CCL9
+ SUB MID,VAL
+ GRTR? X,STACK \?CCL9
+ ADD MID,VAL
+ LESS? X,STACK \?CCL9
+ RETURN -5
+?CCL9: GRTR? X,MID /?CCL14
+ RETURN -1
+?CCL14: RETURN -3
+?CCL6: EQUAL? VAL,2 \FALSE
+ GRTR? X,MID /?CCL19
+ RETURN -2
+?CCL19: RETURN -4
+?CCL3: ADD 1,VAL
+ SUB STACK,TOP-HINT-LINE >VAL
+ GRTR? X,MID \?CND21
+ ADD VAL,BOTTOM-HINT-NUM >VAL
+?CND21: RETURN VAL
+
+
+ .FUNCT INVERSE-LINE,LN,INV
+ ASSIGNED? 'INV /?CND1
+ SET 'INV,H-INVERSE
+?CND1: ZERO? LN /?CND3
+ ICALL CCURSET,LN,1
+?CND3: HLIGHT INV
+ ZERO? INV \?CCL7
+ ERASE 1
+ RTRUE
+?CCL7: FONT 4
+ GETB 0,39 >LN
+ WINGET -3,WWIDE
+ ADD LN,STACK
+ DIV STACK,LN
+ ICALL2 PRINT-SPACES,STACK
+ FONT 1
+ HLIGHT H-NORMAL
+ RTRUE
+
+
+ .FUNCT DISPLAY-HINT,H,MX,CNT,CV,SHIFT?,COUNT-OFFS,WID,CURCX,CURC,FLG,?TMP1
+ SET 'CNT,2
+ HLIGHT H-NORMAL
+ CLEAR S-TEXT
+ SCREEN S-WINDOW
+ ICALL INVERSE-LINE,3,H-NORMAL
+ ICALL RIGHT-LINE,Q-RESUME-STORY,3
+ ICALL INVERSE-LINE,2,H-NORMAL
+ ICALL RIGHT-LINE,RETURN-SEE-NEW-HINT,2
+ GET 0,8
+ BTST STACK,32 \?CND1
+ ICALL CENTER-LINE,H-OR-USE-MOUSE,3
+?CND1: ICALL INVERSE-LINE,1,H-NORMAL
+ HLIGHT H-BOLD
+ GET HINTS,H-CHAPT-NUM >?TMP1
+ ADD H-QUEST-NUM,1
+ GET ?TMP1,STACK >H
+ SUB H-CHAPT-NUM,1
+ GET HINT-COUNTS,STACK >CV
+ GET H,1
+ ICALL CENTER-LINE,STACK,1,H-INVERSE
+ HLIGHT H-NORMAL
+ CALL CENTER-LINE,M-SEE-HINT-MENU,2 >WID
+ GET H,0 >MX
+ SCREEN S-TEXT
+ CURSET 1,1
+ MOD H-QUEST-NUM,2 >SHIFT?
+ SUB H-QUEST-NUM,1
+ DIV STACK,2 >COUNT-OFFS
+ GETB CV,COUNT-OFFS >CURCX
+ ZERO? SHIFT? /?CCL5
+ SHIFT CURCX,-4
+ JUMP ?CND3
+?CCL5: PUSH CURCX
+?CND3: BAND STACK,15
+ ADD 2,STACK >CURC
+?PRG6: EQUAL? CNT,CURC /?REP7
+ PRINTC 9
+ GET H,CNT
+ PRINT STACK
+ CRLF
+ INC 'CNT
+ JUMP ?PRG6
+?REP7: SET 'FLG,TRUE-VALUE
+?PRG11: ZERO? FLG /?CND13
+ SET 'FLG,FALSE-VALUE
+ GRTR? CNT,MX \?CCL17
+ PRINT NO-MORE-HINTS
+ CRLF
+ SCREEN S-WINDOW
+ ICALL INVERSE-LINE,2,H-NORMAL
+ ICALL CENTER-LINE,M-SEE-HINT-MENU,2
+ SCREEN S-TEXT
+ JUMP ?CND13
+?CCL17: SUB MX,CNT
+ ADD STACK,1
+ PRINTN STACK
+ PRINTI "> "
+?CND13: ZERO? DEMO-VERSION? /?CCL20
+ CALL2 INPUT-DEMO,1 >CURC
+ JUMP ?CND18
+?CCL20: INPUT 1 >CURC
+?CND18: EQUAL? CURC,CLICK1,CLICK2 \?CND21
+ CALL2 SELECT-HINT-BY-MOUSE,WID >CURCX
+ GRTR? CURCX,0 /?CND21
+ EQUAL? CURCX,-3 \?CCL27
+ SET 'CURC,13
+ JUMP ?CND21
+?CCL27: EQUAL? CURCX,-4 \?CCL29
+ SET 'CURC,81
+ JUMP ?CND21
+?CCL29: EQUAL? CURCX,-5 \?CCL31
+ SET 'CURC,77
+?CND21: EQUAL? CURC,77,109,81 /?CTR33
+ EQUAL? CURC,113 \?CCL34
+?CTR33: ZERO? SHIFT? /?CCL39
+ GETB CV,COUNT-OFFS
+ BAND STACK,15 >?TMP1
+ SUB CNT,2
+ SHIFT STACK,4
+ BOR ?TMP1,STACK
+ PUTB CV,COUNT-OFFS,STACK
+ JUMP ?CND37
+?CCL31: SOUND S-BEEP
+ JUMP ?PRG11
+?CCL39: GETB CV,COUNT-OFFS
+ BAND STACK,240 >?TMP1
+ SUB CNT,2
+ BOR ?TMP1,STACK
+ PUTB CV,COUNT-OFFS,STACK
+?CND37: EQUAL? CURC,81,113 \TRUE
+ THROW TRUE-VALUE,PARSE-SENTENCE-ACTIVATION
+ JUMP ?PRG11
+?CCL34: EQUAL? CURC,13,10 \?CCL44
+ GRTR? CNT,MX /?CCL47
+ SET 'FLG,TRUE-VALUE
+ GET H,CNT
+ PRINT STACK
+ CRLF
+ IGRTR? 'CNT,MX \?PRG11
+ SET 'FLG,FALSE-VALUE
+ PRINT NO-MORE-HINTS
+ CRLF
+ SCREEN S-WINDOW
+ ICALL INVERSE-LINE,2,H-NORMAL
+ ICALL CENTER-LINE,M-SEE-HINT-MENU,2
+ SCREEN S-TEXT
+ JUMP ?PRG11
+?CCL47: SOUND S-BEEP
+ JUMP ?PRG11
+?CCL44: SOUND S-BEEP
+ JUMP ?PRG11
+
+
+ .FUNCT H-CHAPT-NAME,N
+ GET HINTS,N
+ GET STACK,1
+ RSTACK
+
+
+ .FUNCT H-GET-QUEST,N,?TMP1
+ GET HINTS,H-CHAPT-NUM >?TMP1
+ ADD N,1
+ GET ?TMP1,STACK
+ GET STACK,1
+ RSTACK
+
+
+ .FUNCT H-PUT-UP-FROBS,MX,ST,X,Y
+ HLIGHT H-NORMAL
+ SET 'X,LEFT-HINT-COLUMN
+ SET 'Y,TOP-HINT-LINE
+?PRG1: IGRTR? 'ST,MX /TRUE
+ INC 'Y
+ ICALL CCURSET,Y,X
+ CALL GET-HINT-ROUTINE,ST
+ PRINT STACK
+ EQUAL? ST,BOTTOM-HINT-NUM \?PRG1
+ SET 'Y,TOP-HINT-LINE
+ GETB 0,33
+ DIV STACK,2 >X
+ JUMP ?PRG1
+
+
+ .FUNCT INIT-HINT-SCREEN
+ CLEAR -1
+ SCREEN S-FULL
+ ZERO? BORDER-ON /?CND1
+ DISPLAY HINT-BORDER,1,1
+?CND1: ICALL2 SPLIT-BY-PICTURE,TEXT-WINDOW-PIC-LOC
+ SCREEN S-TEXT
+ RETURN S-WINDOW
+
+
+ .FUNCT HINT-TITLE,TITLE,WIN,THIRD
+ ASSIGNED? 'THIRD /?CND1
+ SET 'THIRD,TRUE-VALUE
+?CND1: SCREEN WIN
+ ICALL INVERSE-LINE,1,H-NORMAL
+ ICALL INVERSE-LINE,2,H-NORMAL
+ ICALL INVERSE-LINE,3,H-NORMAL
+ HLIGHT H-BOLD
+ ICALL CENTER-LINE,TITLE,1,H-INVERSE
+ HLIGHT H-NORMAL
+ ICALL LEFT-LINE,2,NEXT-HINT
+ GET 0,8
+ BTST STACK,32 \?CND3
+ ICALL CENTER-LINE,H-OR-USE-MOUSE,3
+?CND3: ICALL LEFT-LINE,3,PREVIOUS-HINT
+ ZERO? THIRD /FALSE
+ ICALL RIGHT-LINE,RETURN-SEE-HINT,2
+ CALL RIGHT-LINE,Q-RESUME-STORY,3
+ RSTACK
+
+
+ .FUNCT LEFT-LINE,LN,STR,INV
+ ICALL CCURSET,LN,1
+ ZERO? INV /?CND1
+ HLIGHT INV
+?CND1: PRINT STR
+ ZERO? INV /FALSE
+ HLIGHT H-NORMAL
+ RTRUE
+
+
+ .FUNCT RIGHT-LINE,STR,LN,INV,LEN
+ CALL JUSTIFIED-LINE,STR,LN,INV,LEN,1
+ RSTACK
+
+
+ .FUNCT CENTER-LINE,STR,LN,INV,LEN
+ CALL JUSTIFIED-LINE,STR,LN,INV,LEN,2
+ RSTACK
+
+
+ .FUNCT JUSTIFIED-LINE,STR,LN,INV,LEN,CTR
+ ZERO? LN \?CCL3
+ CURGET SLINE
+ GET SLINE,0 >LN
+ JUMP ?CND1
+?CCL3: DEC 'LN
+ WINGET -3,WFSIZE
+ SHIFT STACK,-8
+ MUL LN,STACK
+ ADD 1,STACK >LN
+?CND1: ZERO? LEN \?CND4
+ DIROUT D-TABLE-ON,SLINE
+ PRINT STR
+ PRINTC 32
+ DIROUT D-TABLE-OFF
+ GET 0,24 >LEN
+?CND4: WINGET -3,WWIDE
+ SUB STACK,LEN
+ DIV STACK,CTR
+ CURSET LN,STACK
+ ZERO? INV /?CND6
+ HLIGHT INV
+?CND6: PRINT STR
+ PRINTC 32
+ ZERO? INV \?CCL9
+ RETURN LEN
+?CCL9: HLIGHT H-NORMAL
+ RETURN LEN
+
+ .ENDSEG
+
+ .ENDI
diff --git a/clues.zil b/clues.zil
new file mode 100644
index 0000000..3c8a9b7
--- /dev/null
+++ b/clues.zil
@@ -0,0 +1,538 @@
+"CLUES for LIBRARY
+(c) Copyright 1988 Infocom, Inc. All Rights Reserved."
+
+"To install:
+Add <XFLOAD <ZILLIB>CLUES> to your GAME.ZIL file.
+Modify ROUTINE FINISH in VERBS to include Hint.
+Add HINT syntaxes (be careful -- you might already have some variety).
+Add verb routines for V-HINT and V-HINTS-OFF.
+Add HINT to list of verbs in CLOCKER-VERB (a.k.a. GAME-VERB?).
+Make sure flag in V-HINTS-OFF syntax is correct (RLANDBIT, KLUDGEBIT, etc.)."
+
+<FILE-FLAGS CLEAN-STACK? MDL-ZIL? ;ZAP-TO-SOURCE-DIRECTORY?>
+
+<DEFAULTS-DEFINED
+ FIRST-HINT-POS
+ INIT-HINT-SCREEN>
+
+<BEGIN-SEGMENT HINTS>
+
+<CONSTANT RETURN-SEE-HINT "Hit Return to see hints.">
+<CONSTANT RETURN-SEE-NEW-HINT "Hit Return to see a hint.">
+<CONSTANT INVISICLUES "InvisiClues (tm)">
+<CONSTANT M-MAIN-HINT-MENU "Hit M to see main menu.">
+<CONSTANT M-SEE-HINT-MENU "Hit M to see hint menu.">
+<CONSTANT PREVIOUS-HINT "Hit P for previous item.">
+<CONSTANT NEXT-HINT "Hit N for next item.">
+<CONSTANT Q-RESUME-STORY "Hit Q to resume story.">
+<CONSTANT H-OR-USE-MOUSE "(Or use your mouse.)">
+<CONSTANT NO-MORE-HINTS "[No more hints.]">
+
+"If the first argument is non-false, build a parallel impure table
+ for storing the count of answers already seen; make it a constant
+ under the given name."
+
+<DEFINE20 CONSTRUCT-HINTS (COUNT-NAME "TUPLE" STUFF "AUX" (SS <>)
+ (HL (T)) (HLL .HL) V
+ (CL (T)) (CLL .CL)
+ TCL TCLL)
+ <REPEAT ((CT 0))
+ <COND (<OR <EMPTY? .STUFF>
+ <TYPE? <1 .STUFF> STRING>>
+ ;"Chapter break"
+ <COND
+ (<NOT .SS>
+ ;"First one, just do setup"
+ <SET SS .STUFF>
+ <SET TCL (T)>
+ <SET TCLL .TCL>
+ <SET CT 0>)
+ (T
+ <SET V <SUBSTRUC .SS 0 <- <LENGTH .SS> <LENGTH .STUFF>>>>
+ ;"One chapter's worth"
+ <COND (<L? 17 <LENGTH .V>>
+ <WARN!-ZILCH!-PACKAGE!- "Too many answers for: " <1 .V>>)>
+ <SET HLL <REST <PUTREST .HLL (<EVAL <FORM PLTABLE !.V>>)>>>
+ <COND (.COUNT-NAME
+ <SET CLL <REST <PUTREST .CLL
+ (<EVAL <FORM TABLE (BYTE)
+ !<REST .TCL>>>)>>>
+ <SET TCL (T)>
+ <SET TCLL .TCL>
+ <SET CT 0>)>
+ <SET SS .STUFF>)>
+ <COND (<EMPTY? .STUFF> <RETURN>)>
+ <SET STUFF <REST .STUFF>>)
+ (T
+ <COND (.COUNT-NAME
+ <COND (<1? <MOD <SET CT <+ .CT 1>> 2>>
+ <SET TCLL <REST <PUTREST .TCLL
+ (0)>>>)>)>
+ <SET STUFF <REST .STUFF>>)>>
+ <COND (.COUNT-NAME
+ <EVAL <FORM CONSTANT .COUNT-NAME
+ <EVAL <FORM PTABLE !<REST .CL>>>>>)>
+ <EVAL <FORM PLTABLE !<REST .HL>>>>
+
+"Longest hint topic and longest question can be one line, unless it shares
+a line with another such in the other column. Each question can have up to
+16 answers but no more."
+
+;<CONSTANT HINTS
+ <CONSTRUCT-HINTS HINT-COUNTS ;"Put topics in Quotes - followed by PLTABLEs
+ of Questions and Answers in quotes"
+ ;"17 character wide"
+ ;"this set of quotes is 36 chars. wide"
+ "Topic/Chapter"
+ <PLTABLE "Question"
+ "Hint 1"
+ "Hint 2">>>
+
+<GLOBAL H-QUEST-NUM 1> "shows in HINTS LTABLE which question it's on"
+
+<GLOBAL H-CHAPT-NUM 1> "shows in HINTS LTABLE which chapter it's on"
+
+<DEFAULT-DEFINITION FIRST-HINT-POS
+<CONSTANT FIRST-HINT-LINE 5>
+<CONSTANT FIRST-HINT-COLUMN 4>>
+
+<GLOBAL BOTTOM-HINT-NUM:NUMBER 0>
+<GLOBAL TOP-HINT-LINE:NUMBER 0>
+<GLOBAL LEFT-HINT-COLUMN:NUMBER 0>
+
+<GLOBAL GET-HINT-ROUTINE 0> "APPLY this to get pointer to text"
+
+<DEFINE DO-HINTS ("AUX" Q WIN FCLR WCLR)
+ <IF-SOUND <SETG SOUND-QUEUED? <>>
+ <KILL-SOUNDS>>
+ <HLIGHT ,H-NORMAL>
+ <SET WIN <INIT-HINT-SCREEN>>
+ ;<WINATTR -3 ,A-SCRIPT ,O-CLEAR>
+ <SET Q <SHIFT <WINGET -3 ,WFSIZE> -8>> ;"height"
+ <SETG TOP-HINT-LINE <+ 1 </ <- <WINGET -3 ,WTOP> 1> .Q>>>
+ <SETG BOTTOM-HINT-NUM <- </ <WINGET -3 ,WHIGH> .Q> 1>>
+ <SET Q <BAND <WINGET -3 ,WFSIZE> *377*>>
+ <SETG LEFT-HINT-COLUMN <+ 2 </ <- <WINGET -3 ,WLEFT> 1> .Q>>>
+ <PROG ()
+ <CLEAR ,S-TEXT>
+ <SCREEN .WIN>
+ <SET WCLR <WINGET .WIN ,WCOLOR>>
+ <COND (<BAND 1 <LOWCORE ZVERSION>> ;"colors visible?"
+ <CCURSET 2 9> ;<CURSET 1 1>
+ <COLOR 1 -1>)
+ (T
+ <COLOR 1 1>)>
+ <HINT-TITLE ,INVISICLUES .WIN>
+ <SCREEN ,S-FULL>
+ <SET FCLR <WINGET ,S-FULL ,WCOLOR>>
+ <COLOR <BAND <WINGET ,S-TEXT ,WCOLOR> *377*>;"Match colors with text screen."
+ <SHIFT <WINGET ,S-TEXT ,WCOLOR> -8>>
+ <DIROUT ,D-TABLE-ON ,SLINE ;-80>
+ <DIROUT ,D-TABLE-OFF> ;"flush TWID"
+ <SETG GET-HINT-ROUTINE ,H-CHAPT-NAME>
+ <H-PUT-UP-FROBS <GET ,HINTS 0>>
+ <H-NEW-CURSOR ,H-CHAPT-NUM>
+ <REPEAT (CHR TMP (MAXC <GET ,HINTS 0>))
+ <COND (,DEMO-VERSION?
+ <SET CHR <INPUT-DEMO 1>>)
+ (T
+ <SET CHR <INPUT 1>>)>
+ <COND (<EQUAL? .CHR ,CLICK1 ,CLICK2>
+ <SET TMP <SELECT-HINT-BY-MOUSE>>
+ <COND (<L=? .TMP 0>
+ <COND (<EQUAL? .TMP -1>
+ <SET CHR !\N>)
+ (<EQUAL? .TMP -2>
+ <SET CHR !\P>)
+ (<EQUAL? .TMP -3>
+ <SET CHR 13>)
+ (<EQUAL? .TMP -4>
+ <SET CHR !\Q>)
+ (T
+ <SOUND ,S-BEEP>
+ <AGAIN>)>)>)
+ ;(T
+ <CCURSET ,BOTTOM-HINT-NUM 1>
+ <TELL "[CHR=" N .CHR "]">)>
+ <COND (<EQUAL? .CHR !\M !\m !\Q !\q ;,ESCAPE-KEY>
+ <SET Q T>
+ <RETURN>)
+ (<EQUAL? .CHR !\N !\n ,DOWN-ARROW>
+ <H-NEW-CURSOR ,H-CHAPT-NUM T>
+ <COND (<EQUAL? ,H-CHAPT-NUM .MAXC>
+ <SETG H-CHAPT-NUM 1>)
+ (T
+ <SETG H-CHAPT-NUM <+ ,H-CHAPT-NUM 1>>)>
+ <SETG H-QUEST-NUM 1>
+ <H-NEW-CURSOR ,H-CHAPT-NUM>)
+ (<EQUAL? .CHR !\P !\p ,UP-ARROW>
+ <H-NEW-CURSOR ,H-CHAPT-NUM T>
+ <COND (<EQUAL? ,H-CHAPT-NUM 1>
+ <SETG H-CHAPT-NUM .MAXC>)
+ (T
+ <SETG H-CHAPT-NUM <- ,H-CHAPT-NUM 1>>)>
+ <SETG H-QUEST-NUM 1>
+ <H-NEW-CURSOR ,H-CHAPT-NUM>)
+ (<EQUAL? .CHR 13 10 32>
+ <SET Q <H-PICK-QUESTION>>
+ <RETURN>)
+ (<EQUAL? .CHR ,CLICK1 ,CLICK2>
+ <COND (<G? .TMP .MAXC>
+ <SOUND ,S-BEEP>)
+ ;(<EQUAL? ,H-CHAPT-NUM .TMP>
+ <SET Q <H-PICK-QUESTION>>
+ <RETURN>) ;"not like Mac"
+ (T
+ <H-NEW-CURSOR ,H-CHAPT-NUM T>
+ <SETG H-CHAPT-NUM .TMP>
+ <SETG H-QUEST-NUM 1>
+ <H-NEW-CURSOR ,H-CHAPT-NUM>
+ <COND (<EQUAL? .CHR ,CLICK2>
+ <SET Q <H-PICK-QUESTION>>
+ <RETURN>)>)>)
+ (T
+ <SOUND ,S-BEEP>)>>
+ <COND (<NOT .Q>
+ <AGAIN>)>>
+ <CLEAR -1>
+ <SCREEN .WIN>
+ <COLOR <BAND .WCLR 255> <SHIFT .WCLR -8>>
+ <SCREEN ,S-FULL>
+ <COLOR <BAND .FCLR 255> <SHIFT .FCLR -8>>
+ <SCREEN ,S-TEXT>
+ <HLIGHT ,H-NORMAL>
+ ;<WINATTR -3 ,A-SCRIPT ,O-SET>
+ <INIT-STATUS-LINE>
+ <TELL "Back to the story..." CR>
+ <IF-SOUND <COND (,SOUND-ON?
+ <CHECK-LOOPING>)>>
+ <RFATAL>>
+
+<DEFINE H-PICK-QUESTION ("AUX" CHR MAXQ (Q <>) ;WIN WID)
+ <SETG PARSE-SENTENCE-ACTIVATION <CATCH>> ;"for Q command"
+ <HLIGHT ,H-NORMAL>
+ <CLEAR ,S-TEXT>
+ ;<SET WIN <INIT-HINT-SCREEN>>
+ <HINT-TITLE <GET <GET ,HINTS ,H-CHAPT-NUM> 1> ,S-WINDOW ;.WIN>
+ <SET WID <CENTER-LINE ,M-MAIN-HINT-MENU 2 ;,H-INVERSE>>
+ <SET MAXQ <- <GET <GET ,HINTS ,H-CHAPT-NUM> 0> 1>>
+ <SCREEN ,S-FULL>
+ <SETG GET-HINT-ROUTINE ,H-GET-QUEST>
+ <H-PUT-UP-FROBS <- <GET <GET ,HINTS ,H-CHAPT-NUM> 0> 1>>
+ <H-NEW-CURSOR ,H-QUEST-NUM>
+ <REPEAT (TMP)
+ <COND (,DEMO-VERSION?
+ <SET CHR <INPUT-DEMO 1>>)
+ (T
+ <SET CHR <INPUT 1>>)>
+ <COND (<EQUAL? .CHR ,CLICK1 ,CLICK2>
+ <SET TMP <SELECT-HINT-BY-MOUSE .WID>>
+ <COND (<L=? .TMP 0>
+ <COND (<EQUAL? .TMP -1>
+ <SET CHR !\N>)
+ (<EQUAL? .TMP -2>
+ <SET CHR !\P>)
+ (<EQUAL? .TMP -3>
+ <SET CHR 13>)
+ (<EQUAL? .TMP -4>
+ <SET CHR !\Q>)
+ (<EQUAL? .TMP -5>
+ <SET CHR !\M>)
+ (T
+ <SOUND ,S-BEEP>
+ <AGAIN>)>)>)
+ ;(T
+ <CCURSET ,BOTTOM-HINT-NUM 1>
+ <TELL "[CHR=" N .CHR "]">)>
+ <COND (<EQUAL? .CHR !\Q !\q ;,ESCAPE-KEY>
+ <RTRUE>)
+ (<EQUAL? .CHR !\M !\m>
+ <SET Q T>
+ <RETURN>)
+ (<EQUAL? .CHR !\N !\n ,DOWN-ARROW>
+ <H-NEW-CURSOR ,H-QUEST-NUM T>
+ <COND (<EQUAL? ,H-QUEST-NUM .MAXQ>
+ <SETG H-QUEST-NUM 1>)
+ (T
+ <SETG H-QUEST-NUM <+ ,H-QUEST-NUM 1>>)>
+ <H-NEW-CURSOR ,H-QUEST-NUM>)
+ (<EQUAL? .CHR !\P !\p ,UP-ARROW>
+ <H-NEW-CURSOR ,H-QUEST-NUM T>
+ <COND (<EQUAL? ,H-QUEST-NUM 1>
+ <SETG H-QUEST-NUM .MAXQ>)
+ (T
+ <SETG H-QUEST-NUM <- ,H-QUEST-NUM 1>>)>
+ <H-NEW-CURSOR ,H-QUEST-NUM>)
+ (<EQUAL? .CHR ,CLICK1 ,CLICK2>
+ <COND (<G? .TMP .MAXQ>
+ <SOUND ,S-BEEP>)
+ ;(<EQUAL? ,H-QUEST-NUM .TMP>
+ <DISPLAY-HINT>
+ <RETURN>) ;"not like Mac"
+ (T
+ <H-NEW-CURSOR ,H-QUEST-NUM T>
+ <SETG H-QUEST-NUM .TMP>
+ <H-NEW-CURSOR ,H-QUEST-NUM>
+ <COND (<EQUAL? .CHR ,CLICK2>
+ <DISPLAY-HINT>
+ <RETURN>)>)>)
+ (<EQUAL? .CHR 13 10 32>
+ <DISPLAY-HINT>
+ <RETURN>)
+ (T
+ <SOUND ,S-BEEP>)>>
+ <COND (<NOT .Q>
+ <AGAIN>)>>
+
+<DEFINE H-NEW-CURSOR (POS "OPT" (OFF? <>) "AUX" Y X)
+ <SET Y <+ ,TOP-HINT-LINE .POS>>
+ <SET X ,LEFT-HINT-COLUMN>
+ <COND (<G? .POS ,BOTTOM-HINT-NUM>
+ <SET Y <- .Y ,BOTTOM-HINT-NUM>>
+ <SET X </ <LOWCORE SCRH> ;<WINGET -3 ,WWIDE> 2>>)>
+ <CCURSET .Y .X>
+ <COND (<NOT .OFF?>
+ <HLIGHT ,H-INVERSE>)
+ (T
+ <HLIGHT ,H-NORMAL>)>
+ <TELL <ZAPPLY ,GET-HINT-ROUTINE .POS> !\ >
+ <COND (<NOT .OFF?>
+ <HLIGHT ,H-NORMAL>)>>
+
+<DEFINE SELECT-HINT-BY-MOUSE ("OPT" (WID 0) "AUX" VAL MID X Y)
+ <SET VAL <SHIFT <WINGET -3 ,WFSIZE> -8>>
+ <SET Y <LOWCORE MSLOCY>>
+ <SET X <LOWCORE MSLOCX>>
+ ;<CCURSET ,BOTTOM-HINT-NUM 1>
+ ;<TELL "[">
+ <SET VAL </ <- .Y 1> .VAL>>
+ <SET MID </ <* <LOWCORE SCRH> <BAND <WINGET -3 ,WFSIZE> *377*>>
+ ;<WINGET -3 ,WWIDE>
+ 2>>
+ ;<TELL "LN=" N .VAL " FHL=" N ,TOP-HINT-LINE " X=" N .X " MID=" N .MID " TWID=" N .WID>
+ <COND (<L? .VAL <- ,TOP-HINT-LINE 1>>
+ <COND (<EQUAL? .VAL 1>
+ <COND (<AND <SET VAL </ .WID 2>>
+ <G? .X <- .MID .VAL>>
+ <L? .X <+ .MID .VAL>>>
+ ;<TELL " VAL=-5">
+ <RETURN -5>)
+ (<L=? .X .MID>
+ ;<TELL " VAL=-1">
+ <RETURN -1>)
+ (T
+ ;<TELL " VAL=-3">
+ <RETURN -3>)>)
+ (<EQUAL? .VAL 2>
+ <COND (<L=? .X .MID>
+ ;<TELL " VAL=-2">
+ <RETURN -2>)
+ (T
+ ;<TELL " VAL=-4">
+ <RETURN -4>)>)
+ (T
+ <COND (T
+ ;<TELL " VAL=0">
+ <RETURN 0>)>)>)
+ (T
+ <SET VAL <- <+ 1 .VAL> ,TOP-HINT-LINE>>
+ ;<TELL " VAL=" N .VAL>
+ <COND (<G? .X .MID>
+ <SET VAL <+ .VAL ,BOTTOM-HINT-NUM>>
+ ;<TELL " -> " N .VAL>)>
+ ;<TELL "]|">
+ .VAL)>>
+
+<DEFINE INVERSE-LINE ("OPT" (LN 0) (INV ,H-INVERSE))
+ <COND (<T? .LN>
+ <CCURSET .LN 1>)>
+ <HLIGHT .INV>
+ <COND (<EQUAL? .INV ,H-NORMAL>
+ <ERASE 1>)
+ (T
+ <FONT 4>
+ <SET LN <LOWCORE (FWRD 1)>>
+ <PRINT-SPACES </ <+ .LN <WINGET -3 ,WWIDE>> .LN>>
+ <FONT 1>
+ <HLIGHT ,H-NORMAL>)>>
+
+<DEFINE DISPLAY-HINT ("AUX" H MX (CNT 2) CV SHIFT? COUNT-OFFS ;WIN WID)
+ <HLIGHT ,H-NORMAL>
+ <CLEAR ,S-TEXT>
+ ;<SET WIN <INIT-HINT-SCREEN>>
+ <SCREEN ,S-WINDOW ;.WIN>
+ <INVERSE-LINE 3 ,H-NORMAL>
+ <RIGHT-LINE ,Q-RESUME-STORY 3 ;,H-INVERSE>
+ <INVERSE-LINE 2 ,H-NORMAL>
+ <RIGHT-LINE ,RETURN-SEE-NEW-HINT 2 ;,H-INVERSE>
+ <COND (<NOT <EQUAL? <BAND <LOWCORE FLAGS> 32> 0>>
+ <CENTER-LINE ,H-OR-USE-MOUSE 3 ;,H-INVERSE>)>
+ <INVERSE-LINE 1 ,H-NORMAL>
+ <HLIGHT ,H-BOLD>
+ <SET H <GET <GET ,HINTS ,H-CHAPT-NUM> <+ ,H-QUEST-NUM 1>>>
+ ;"Byte table to use for showing questions already seen.
+ Actually a nibble table. The high four bits of each byte are for
+ H-QUEST-NUM odd; the low four bits are for H-QUEST-NUM even. See SHIFT?
+ and COUNT-OFFS."
+ <SET CV <GET ,HINT-COUNTS <- ,H-CHAPT-NUM 1>>>
+ <CENTER-LINE <GET .H 1> 1 ,H-INVERSE>
+ <HLIGHT ,H-NORMAL>
+ <SET WID <CENTER-LINE ,M-SEE-HINT-MENU 2 ;,H-INVERSE>>
+ <SET MX <GET .H 0>>
+ <SCREEN ,S-TEXT>
+ <CURSET 1 1>
+ ;<WINATTR -3 ,A-SCRIPT ,O-SET>
+ ;<PRINT <GET .H 1>>
+ ;<CRLF>
+ <SET SHIFT? <MOD ,H-QUEST-NUM 2>>
+ <SET COUNT-OFFS </ <- ,H-QUEST-NUM 1> 2>>
+ <REPEAT ((CURCX <GETB .CV .COUNT-OFFS>)
+ (CURC <+ 2 <ANDB <COND (.SHIFT? <LSH .CURCX -4>)
+ (T .CURCX)> *17*>>))
+ <COND (<==? .CNT .CURC>
+ <RETURN>)
+ (T
+ <TELL C 9 <GET .H .CNT> CR>
+ <SET CNT <+ .CNT 1>>)>>
+ <REPEAT (CHR ;N TMP (FLG T))
+ <COND (.FLG
+ <SET FLG <>>
+ <COND (<G? .CNT .MX>
+ <PRINT ,NO-MORE-HINTS>
+ <CRLF>
+ <SCREEN ,S-WINDOW ;.WIN>
+ <INVERSE-LINE 2 ,H-NORMAL>
+ <CENTER-LINE ,M-SEE-HINT-MENU 2 ;,H-INVERSE>
+ <SCREEN ,S-TEXT>)
+ (T
+ <TELL ;"[" N <+ <- .MX .CNT> 1> ;" hint">
+ ;<COND (<NOT <EQUAL? .N 1>>
+ <TELL "s">)>
+ <TELL ;" left.] -" "> ">)>)>
+ <COND (,DEMO-VERSION?
+ <SET CHR <INPUT-DEMO 1>>)
+ (T
+ <SET CHR <INPUT 1>>)>
+ <COND (<EQUAL? .CHR ,CLICK1 ,CLICK2>
+ <SET TMP <SELECT-HINT-BY-MOUSE .WID>>
+ <COND (<L=? .TMP 0>
+ <COND (<EQUAL? .TMP -3>
+ <SET CHR 13>)
+ (<EQUAL? .TMP -4>
+ <SET CHR !\Q>)
+ (<EQUAL? .TMP -5>
+ <SET CHR !\M>)
+ (T
+ <SOUND ,S-BEEP>
+ <AGAIN>)>)>)
+ ;(T
+ <CCURSET ,BOTTOM-HINT-NUM 1>
+ <TELL "[CHR=" N .CHR "]">)>
+ <COND (<EQUAL? .CHR !\M !\m !\Q !\q ;,ESCAPE-KEY>
+ <COND (.SHIFT?
+ <PUTB .CV .COUNT-OFFS
+ <ORB <ANDB <GETB .CV .COUNT-OFFS> *17*>
+ <LSH <- .CNT 2> 4>>>)
+ (T
+ <PUTB .CV .COUNT-OFFS
+ <ORB <ANDB <GETB .CV .COUNT-OFFS> *360*>
+ <- .CNT 2>>>)>
+ <COND (<EQUAL? .CHR !\Q !\q ;,ESCAPE-KEY>
+ <THROW T ,PARSE-SENTENCE-ACTIVATION>)
+ (T
+ ;<WINATTR -3 ,A-SCRIPT ,O-CLEAR>
+ <RETURN>)>)
+ (<EQUAL? .CHR 13 10 ;"32 ,CLICK1 ,CLICK2">
+ <COND (<L=? .CNT .MX>
+ <SET FLG T> ;"CNT starts as 2"
+ <TELL <GET .H .CNT> CR>
+ ;"3rd = line 7, 4th = line 9, etc."
+ <COND (<G? <SET CNT <+ .CNT 1>> .MX>
+ <SET FLG <>>
+ <PRINT ,NO-MORE-HINTS>
+ <CRLF>
+ <SCREEN ,S-WINDOW ;.WIN>
+ <INVERSE-LINE 2 ,H-NORMAL>
+ <CENTER-LINE ,M-SEE-HINT-MENU 2 ;,H-INVERSE>
+ <SCREEN ,S-TEXT>)>)
+ (T
+ <SOUND ,S-BEEP>)>)
+ (T
+ <SOUND ,S-BEEP>)>>>
+
+<DEFINE H-CHAPT-NAME (N)
+ <GET <GET ,HINTS .N> 1>>
+
+<DEFINE H-GET-QUEST (N)
+ <GET <GET <GET ,HINTS ,H-CHAPT-NUM> <+ .N 1>> 1>>
+
+<DEFINE H-PUT-UP-FROBS (MX)
+ <HLIGHT ,H-NORMAL>
+ <REPEAT ((ST 0) (X ,LEFT-HINT-COLUMN) (Y ,TOP-HINT-LINE))
+ <COND (<G? <SET ST <+ .ST 1>> .MX>
+ <RETURN>)>
+ <SET Y <+ 1 .Y>>
+ <CCURSET .Y .X>
+ <TELL <ZAPPLY ,GET-HINT-ROUTINE .ST>>
+ <COND (<EQUAL? .ST ,BOTTOM-HINT-NUM>
+ <SET Y ,TOP-HINT-LINE>
+ <SET X </ <LOWCORE SCRH> ;<WINGET -3 ,WWIDE> 2>>)>>>
+
+<DEFAULT-DEFINITION INIT-HINT-SCREEN
+<DEFINE INIT-HINT-SCREEN ()
+ <CLEAR -1>
+ <CSPLIT 4>
+ <SCREEN ,S-TEXT>
+ ,S-WINDOW>>
+
+<DEFINE HINT-TITLE (TITLE WIN "OPTIONAL" (THIRD T))
+ <SCREEN .WIN>
+ <INVERSE-LINE 1 ,H-NORMAL>
+ <INVERSE-LINE 2 ,H-NORMAL>
+ <INVERSE-LINE 3 ,H-NORMAL>
+ <HLIGHT ,H-BOLD>
+ <CENTER-LINE .TITLE 1 ,H-INVERSE>
+ <HLIGHT ,H-NORMAL>
+ <LEFT-LINE 2 ,NEXT-HINT ;,H-INVERSE>
+ <COND (<NOT <EQUAL? <BAND <LOWCORE FLAGS> 32> 0>>
+ <CENTER-LINE ,H-OR-USE-MOUSE 3 ;,H-INVERSE>)>
+ <LEFT-LINE 3 ,PREVIOUS-HINT ;,H-INVERSE>
+ <COND (.THIRD
+ <RIGHT-LINE ,RETURN-SEE-HINT 2 ;,H-INVERSE>
+ <RIGHT-LINE ,Q-RESUME-STORY 3 ;,H-INVERSE>)>>
+
+<DEFINE LEFT-LINE (LN STR "OPTIONAL" (INV <>))
+ <CCURSET .LN 1>
+ <COND (.INV
+ <HLIGHT .INV>)>
+ <TELL .STR>
+ <COND (.INV
+ <HLIGHT ,H-NORMAL>)>>
+
+<DEFINE RIGHT-LINE (STR "OPTIONAL" (LN 0) (INV <>) (LEN 0))
+ <JUSTIFIED-LINE .STR .LN .INV .LEN 1>>
+
+<DEFINE CENTER-LINE (STR "OPTIONAL" (LN 0) (INV <>) (LEN 0))
+ <JUSTIFIED-LINE .STR .LN .INV .LEN 2>>
+
+<DEFINE JUSTIFIED-LINE (STR LN INV LEN CTR)
+ <COND (<ZERO? .LN>
+ <CURGET ,SLINE>
+ <SET LN <GET ,SLINE 0>>)
+ (T
+ <SET LN <- .LN 1>>
+ <SET LN <+ 1 <* .LN <SHIFT <WINGET -3 ,WFSIZE> -8>>>>)>
+ <COND (<ZERO? .LEN>
+ <DIROUT ,D-TABLE-ON ,SLINE ;-80>
+ <TELL .STR !\ >
+ <DIROUT ,D-TABLE-OFF>
+ <SET LEN <LOWCORE TWID>>)>
+ <CURSET .LN </ <- <WINGET -3 ,WWIDE> .LEN> .CTR>>
+ <COND (.INV
+ <HLIGHT .INV>)>
+ <TELL .STR !\ >
+ <COND (.INV
+ <HLIGHT ,H-NORMAL>)>
+ .LEN>
+
+<END-SEGMENT>
diff --git a/constants.zil b/constants.zil
new file mode 100644
index 0000000..25c0ead
--- /dev/null
+++ b/constants.zil
@@ -0,0 +1,208 @@
+"CONSTANTS for
+ Library
+ Copyright (C)1988 Infocom, Inc. All rights reserved."
+
+"what rfatal returns"
+
+<CONSTANT M-FATAL 2>
+
+"context names"
+
+<CONSTANT M-BEG 1>
+<CONSTANT M-END 2>
+<CONSTANT M-ENTER 3>
+<CONSTANT M-LEAVE 4>
+<CONSTANT M-LOOK 5>
+<CONSTANT M-FLASH 6>
+<CONSTANT M-OBJDESC 7>
+<CONSTANT M-CONTAINER 8>
+<CONSTANT M-OBJDESC? 9>
+<CONSTANT M-SCENE-SETUP 10>
+<CONSTANT M-WINNER 11>
+<CONSTANT M-SUBJ 12>
+
+"machines"
+
+<CONSTANT DEC-20 1>
+<CONSTANT APPLE-2E 2>
+<CONSTANT MACINTOSH 3>
+<CONSTANT AMIGA 4>
+<CONSTANT ATARI-ST 5>
+<CONSTANT IBM 6>
+<CONSTANT C128 7>
+<CONSTANT C64 8>
+<CONSTANT APPLE-2C 9>
+<CONSTANT APPLE-2GS 10>
+
+"fonts"
+
+<CONSTANT F-OLD 0>
+<CONSTANT F-DEFAULT 1>
+<CONSTANT F-PICTURES 2>
+<CONSTANT F-NEWFONT 3>
+
+"screens"
+
+<CONSTANT S-TEXT 0>
+<CONSTANT S-WINDOW 1>
+
+"yzip screen attribute offsets"
+
+<CONSTANT WTOP 0>
+<CONSTANT WLEFT 1>
+<CONSTANT WHIGH 2>
+<CONSTANT WWIDE 3>
+<CONSTANT WYPOS 4>
+<CONSTANT WXPOS 5>
+<CONSTANT WLMARGIN 6>
+<CONSTANT WRMARGIN 7>
+<CONSTANT WCRFUNC 8>
+<CONSTANT WCRCNT 9>
+<CONSTANT WHLIGHT 10>
+<CONSTANT WCOLOR 11>
+<CONSTANT WFONT 12>
+<CONSTANT WFSIZE 13>
+<CONSTANT WATTRS 14>
+<CONSTANT WLCNT 15>
+
+"screen attribute bits"
+
+<CONSTANT A-WRAP 1> ;"screen wrapping attribute"
+<CONSTANT A-SCROLL 2> ;"screen scrolling attribute"
+<CONSTANT A-SCRIPT 4> ;"screen scripting attribute"
+<CONSTANT A-BUFFER 8> ;"screen buffereing attribute"
+
+"screen attribute operations"
+
+<CONSTANT O-MOVE 0> ;"change all attributes"
+<CONSTANT O-SET 1> ;"set selected attributes"
+<CONSTANT O-CLEAR 2> ;"clear selected attributes"
+<CONSTANT O-COMP 3> ;"complement selected attributes"
+
+"sounds"
+
+<CONSTANT S-BEEP 1>
+<CONSTANT S-BOOP 2>
+
+"sound operations"
+
+<CONSTANT S-INIT 1>
+<CONSTANT S-START 2>
+<CONSTANT S-STOP 3>
+<CONSTANT S-CLEANUP 4>
+
+"highlighting modes"
+
+<CONSTANT H-NORMAL 0>
+<CONSTANT H-INVERSE 1>
+<CONSTANT H-BOLD 2>
+<CONSTANT H-ITALIC 4>
+ <CONSTANT H-UNDER 4>
+<CONSTANT H-MONO 8>
+
+"device control"
+
+<CONSTANT D-KEYBOARD 0>
+<CONSTANT D-COMMAND-FILE 1>
+
+<CONSTANT D-SCREEN 1>
+<CONSTANT D-SCREEN-ON 1>
+<CONSTANT D-SCREEN-OFF -1>
+<CONSTANT D-PRINTER 2>
+<CONSTANT D-PRINTER-ON 2>
+<CONSTANT D-PRINTER-OFF -2>
+<CONSTANT D-TABLE 3>
+<CONSTANT D-TABLE-ON 3>
+<CONSTANT D-TABLE-OFF -3>
+<CONSTANT D-RECORD 4>
+<CONSTANT D-RECORD-ON 4>
+<CONSTANT D-RECORD-OFF -4>
+
+"colors"
+
+<CONSTANT C-HERE -1>
+<CONSTANT C-SAME 0>
+<CONSTANT C-DEFAULT 1>
+<CONSTANT C-BLACK 2>
+<CONSTANT C-RED 3>
+<CONSTANT C-GREEN 4>
+<CONSTANT C-YELLOW 5>
+<CONSTANT C-BLUE 6>
+<CONSTANT C-MAGENTA 7>
+<CONSTANT C-CYAN 8>
+<CONSTANT C-WHITE 9>
+
+"function keys"
+
+<CONSTANT UP-ARROW 129>
+<CONSTANT DOWN-ARROW 130>
+<CONSTANT LEFT-ARROW 131>
+<CONSTANT RIGHT-ARROW 132>
+
+<CONSTANT F1 133>
+<CONSTANT F2 134>
+<CONSTANT F3 135>
+<CONSTANT F4 136>
+<CONSTANT F5 137>
+<CONSTANT F6 138>
+<CONSTANT F7 139>
+<CONSTANT F8 140>
+<CONSTANT F9 141>
+<CONSTANT F10 142>
+<CONSTANT F11 143>
+<CONSTANT F12 144>
+
+<CONSTANT PAD0 145>
+<CONSTANT PAD1 146>
+<CONSTANT PAD2 147>
+<CONSTANT PAD3 148>
+<CONSTANT PAD4 149>
+<CONSTANT PAD5 150>
+<CONSTANT PAD6 151>
+<CONSTANT PAD7 152>
+<CONSTANT PAD8 153>
+<CONSTANT PAD9 154>
+
+<CONSTANT CLICKM 252> ;"mouse clicked on a menu item"
+<CONSTANT CLICK2 253> ;"mouse second/double click"
+<CONSTANT CLICK1 254> ;"mouse first/single click"
+
+"MODE byte bits"
+
+<CONSTANT M-COLOR 1>
+<CONSTANT M-DISPLAY 2>
+<CONSTANT M-BOLD 4>
+<CONSTANT M-UNDERLINE 8>
+<CONSTANT M-MONOSPACE 16>
+<CONSTANT M-SOUND 32>
+
+<DEFMAC MODE-ON? ('F)
+ <FORM NOT <FORM ZERO? <FORM BAND <FORM LOWCORE MODE> .F>>>>
+
+"FLAGS word bits"
+
+<CONSTANT F-SCRIPT 1>
+<CONSTANT F-FIXED 2>
+<CONSTANT F-STATUS 4>
+ <CONSTANT F-REFRESH 4>
+<CONSTANT F-DISPLAY 8>
+<CONSTANT F-UNDO 16>
+<CONSTANT F-MOUSE 32>
+<CONSTANT F-COLOR 64>
+<CONSTANT F-SOUND 128>
+<CONSTANT F-MENU 256>
+
+<DEFMAC FLAG-ON? ('F)
+ <FORM NOT <FORM ZERO? <FORM BAND <FORM LOWCORE FLAGS> .F>>>>
+
+<DEFMAC HIGH-BYTE ('W)
+ <FORM SHIFT .W -8>>
+
+<DEFMAC LOW-BYTE ('W)
+ <FORM BAND .W 255>>
+
+<DEFMAC SET-HIGH-BYTE ('W 'B)
+ <FORM BOR <FORM SHIFT .B 8> <FORM BAND .W 255>>>
+
+<DEFMAC SET-LOW-BYTE ('W 'B)
+ <FORM BOR <FORM BAND .W 65280> .W>> \ No newline at end of file
diff --git a/defs.zil b/defs.zil
new file mode 100644
index 0000000..1ba0bd4
--- /dev/null
+++ b/defs.zil
@@ -0,0 +1,132 @@
+"DEFS to replace parser's versions for
+
+ ZORK ZERO
+ (c) Copyright 1988 Infocom, Inc. All Rights Reserved."
+
+<BEGIN-SEGMENT 0>
+
+<INCLUDE "SYMBOLS">
+
+<COMPILATION-FLAG P-DEBUGGING-PARSER <>>
+
+<ADD-TELL-TOKENS D * <DPRINT .X>>
+
+<DELAY-DEFINITION CAPITAL-NOUN?>
+
+<REPLACE-DEFINITION FIRST-HINT-POS
+ <CONSTANT FIRST-HINT-LINE 5>
+ <CONSTANT FIRST-HINT-COLUMN 7>>
+
+<DELAY-DEFINITION READ-INPUT>
+<DELAY-DEFINITION GAME-VERB?>
+<DELAY-DEFINITION LIT?>
+
+<REPLACE-DEFINITION NO-M-WINNER-VERB?
+ <DEFMAC NO-M-WINNER-VERB? ()
+ '<VERB? ASK-ABOUT ;MAKE-WITH SRIDE-DIR SSEARCH-OBJECT-FOR
+ ;SGIVE SPUT-ON SSHOW STHROW SWRAP ;TELL-ABOUT STOUCH>>>
+
+<REPLACE-DEFINITION NOT-HERE-VERB?
+<ROUTINE NOT-HERE-VERB? (V)
+ <EQUAL? .V ,V?WALK-TO ,V?RESEARCH>>>
+
+<REPLACE-DEFINITION OWNERS
+ <CONSTANT OWNERS <TABLE (PURE LENGTH) JESTER WALL>>>
+<REPLACE-DEFINITION PARSER-REPORT <CONSTANT PARSER-REPORT <>>>
+
+<REPLACE-DEFINITION PERSONBIT <CONSTANT PERSONBIT ACTORBIT>>
+<REPLACE-DEFINITION PLAYER <CONSTANT PLAYER PROTAGONIST>>
+<REPLACE-DEFINITION PRINT-INTQUOTE <CONSTANT PRINT-INTQUOTE 0>>
+<DELAY-DEFINITION REFRESH>
+<REPLACE-DEFINITION ROOMSBIT <CONSTANT ROOMSBIT KLUDGEBIT>>
+
+<REPLACE-DEFINITION SEE-VERB?
+ <ROUTINE SEE-VERB? ()
+ <VERB? CHASTISE COUNT EXAMINE FIND TAKE
+ ;INVENTORY LOOK LOOK-BEHIND LOOK-DOWN LOOK-INSIDE
+ LOOK-UNDER READ SEARCH>>>
+
+<COMPILATION-FLAG P-APOSTROPHE-BREAKS-WORDS <>>
+<REPLACE-DEFINITION SIBREAKS <SETG20 SIBREAKS ".,\"!?">>
+
+<REPLACE-DEFINITION SETUP-ORPHAN-NP <CONSTANT SETUP-ORPHAN-NP 0>>
+
+<REPLACE-DEFINITION SPEAKING-VERB?
+<ROUTINE SPEAKING-VERB? ("OPT" (A ,PRSA))
+ <COND (<EQUAL? .A ;,V?ANSWER ,V?ASK-ABOUT ,V?ASK-FOR ,V?HELLO
+ ,V?NO ;,V?REPLY ,V?TELL ,V?TELL-ABOUT ,V?YES>
+ <RTRUE>)>>>
+
+<DELAY-DEFINITION STATUS-LINE>
+
+<REPLACE-DEFINITION TELL-TOO-DARK
+ <ROUTINE TELL-TOO-DARK ()
+ <SETG P-CONT -1> ;<RFATAL>
+ <TELL ,TOO-DARK>
+ <COND (<VERB? LOOK>
+ <GRUE-PIT-WARNING>)
+ (T
+ <CRLF>)>>>
+
+<COMPILATION-FLAG P-TITLE-ABBRS T>
+
+<REPLACE-DEFINITION TITLE-ABBR?
+<DEFMAC TITLE-ABBR?!- ('WRD) <FORM EQUAL? .WRD ',W?ST ',W?D ',W?J ',W?A>>>
+
+<DELAY-DEFINITION VERB-ALL-TEST>
+<REPLACE-DEFINITION YES? <CONSTANT YES? 0>>
+
+<COMPILATION-FLAG P-PS-ADV T>
+<COMPILATION-FLAG P-PS-COMMA T>
+<COMPILATION-FLAG P-PS-OFWORD T>
+;<COMPILATION-FLAG P-PS-THEWORD T>
+<COMPILATION-FLAG P-PS-QUOTE T>
+<TERMINALS VERB NOUN ADJ ;"keep these three in order! -- SWG"
+ DIR
+ PARTICLE PREP ;"keep these two in order! -- SWG"
+ ASKWORD ;7
+ OFWORD ;ARTICLE QUOTE COMMA
+ ADV QUANT MISCWORD>
+
+<PROPDEF DIRECTIONS <>
+ (DIR TO R:ROOM =
+ (UEXIT 1) ;444 #SEMI "UNCONDITIONAL EXIT"
+ (REXIT <ROOM .R>) #SEMI "TO ROOM")
+ (DIR S:STRING =
+ (NEXIT 2) ;99 #SEMI "IMPOSSIBLE EXIT"
+ (NEXITSTR <STRING .S>) #SEMI "FAILURE MESSAGE")
+ (DIR SORRY S:STRING =
+ (NEXIT 2) #SEMI "IMPOSSIBLE EXIT"
+ (NEXITSTR <STRING .S>) #SEMI "FAILURE MESSAGE")
+ (DIR PER F:FCN =
+ (FEXIT 3) ;53 #SEMI "CONDITIONAL EXIT"
+ (FEXITFCN <WORD .F>) #SEMI "PER FUNCTION"
+ <BYTE 0>)
+ (DIR TO R:ROOM IF F:GLOBAL "OPT" ELSE S:STRING =
+ (CEXIT 4) ;7 #SEMI "CONDITIONAL EXIT"
+ (REXIT <ROOM .R>) #SEMI "TO ROOM"
+ (CEXITFLAG <GLOBAL .F>) #SEMI "IF FLAG IS TRUE"
+ (CEXITSTR <STRING .S>) #SEMI "FAILURE MESSAGE")
+ (DIR TO R:ROOM IF O:OBJECT IS OPEN "OPT" ELSE S:STRING =
+ (DEXIT 5) ;15 #SEMI "CONDITIONAL EXIT"
+ (DEXITOBJ <OBJECT .O>) #SEMI "IF DOOR IS OPEN"
+ (DEXITSTR <STRING .S>) #SEMI "FAILURE MESSAGE"
+ (DEXITRM <ROOM .R>) #SEMI "TO ROOM")>
+
+;<REPLACE-DEFINITION GET-DEXITOBJ
+<ROUTINE GET-DEXITOBJ (PT) <ZGET <REST .PT> ,DEXITOBJ>>>
+
+<DIRECTIONS NORTH NE EAST SE SOUTH SW WEST NW UP DOWN IN OUT>
+
+<OBJECT INTDIR
+ (LOC GLOBAL-OBJECTS)
+ (DESC "direction")
+ (SYNONYM NORTH NE EAST SE SOUTH SW WEST NW ;UP ;DOWN)>
+
+;<CONSTANT M-OBJDESC? 10>
+
+<ZSTART GO> ;"else, ZIL gets confused between verb-word GO and routine GO"
+
+<CONSTANT S-FULL 7>
+
+<END-SEGMENT> \ No newline at end of file
diff --git a/defs2.zabstr b/defs2.zabstr
new file mode 100644
index 0000000..6834c93
--- /dev/null
+++ b/defs2.zabstr
@@ -0,0 +1,69 @@
+
+<BEGIN-SEGMENT 0>
+<INCLUDE "BASEDEFS" "PBITDEFS" "PDEFS">
+<NEW-ADD-WORD "CAGES" NOUN <VOC "CAGE"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "STALLS" NOUN <VOC "STALL"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "DOORS" NOUN <VOC "DOOR"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "BUTTONS" NOUN <VOC "BUTTON"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "ORBS" NOUN <VOC "ORB"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "SLABS" NOUN <VOC "SLAB"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "WEIGHTS" NOUN <VOC "WEIGHT"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "ANIMALS" NOUN <VOC "ANIMAL"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "SNAKES" NOUN <VOC "SNAKE"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "KEYS" NOUN <VOC "KEY"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "PEGS" NOUN <VOC "PEG"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "POSTS" NOUN <VOC "POST"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "SHELLS" NOUN <VOC "SHELL"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "FLIES" NOUN <VOC "FLY"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "VIALS" NOUN <VOC "VIAL"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "TREES" NOUN <VOC "TREE"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "ELMS" NOUN <VOC "ELM"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "OAKS" NOUN <VOC "OAK"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "PINES" NOUN <VOC "PINE"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "WITCHES" NOUN <VOC "WITCH"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "PASSAGES" NOUN <VOC "PASSAGE"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "FLOWERS" NOUN <VOC "FLOWER"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "BOARDS" NOUN <VOC "BOARD"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "SHUTTERS" NOUN <VOC "SHUTTER"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "DIMWIT'S" ADJ DIMWIT ,POSSESSIVE>
+<NEW-ADD-WORD "JESTER'S" ADJ JESTER ,POSSESSIVE>
+<DEFINE-ROUTINE DIRECTION-CONVERSION>
+<REPLACE-DEFINITION MOBY-FIND? <ROUTINE MOBY-FIND? (SEARCH) <COND (<OR <NOT <0?
+<ANDB .SEARCH ,SEARCH-MOBY>>> <EQUAL? ,WINNER ,EXECUTIONER>> T)>>>
+<REPLACE-DEFINITION WHICH-LIST? <ROUTINE WHICH-LIST? (NP SR "AUX" (CT <
+FIND-RES-COUNT .SR>) (V <REST-TO-SLOT .SR FIND-RES-OBJ1>)) <COND (<G? .CT <
+FIND-RES-SIZE .SR>> <RFALSE>) (<AND <SET NP <INTBL? ,PSEUDO-OBJECT .V .CT>> <
+INTBL? ,PSEUDO-OBJECT <REST .NP 2> <- .CT </ <+ 2 <- .NP .V>> 2>>>> <RFALSE>)>
+<REPEAT () <COND (<L? <SET CT <- .CT 1>> 0> <RFALSE>) (<ACCESSIBLE? <ZGET .V 0>
+> <RTRUE>) (T <SET V <ZREST .V 2>>)>>>>
+<REPLACE-DEFINITION PSEUDO-OBJECTS <PUTPROP THINGS PROPSPEC HACK-PSEUDOS> <
+DEFINE20 HACK-PSEUDOS (LIST "AUX" (N 0) (CT 0) NL) <SET LIST <REST .LIST>> <SET
+LIST <MAPF ,LIST <FUNCTION (X) <COND (<0? .N> <SET CT <+ .CT 1>> <SET N 1> <
+COND (<TYPE? .X ATOM> <TABLE (PURE) 1 <VOC <SPNAME .X> ADJ>>) (<TYPE? .X LIST>
+<EVAL <CHTYPE (TABLE (PURE) <LENGTH .X> !<MAPF ,LIST <FUNCTION (Y) <VOC <SPNAME
+.Y> ADJ>> .X!>) FORM>>) (T 0)>) (<1? .N> <SET N 2> <COND (<TYPE? .X ATOM> <
+TABLE (PURE) 1 <VOC <SPNAME .X> NOUN>>) (<TYPE? .X LIST> <EVAL <CHTYPE (TABLE (
+PURE) <LENGTH .X> !<MAPF ,LIST <FUNCTION (Y) <VOC <SPNAME .Y> NOUN>> .X!>) FORM
+>>) (T 0)>) (T <SET N 0> .X)>> .LIST>> (<> <EVAL <CHTYPE (TABLE (PURE) .CT !.
+LIST) FORM>>)> <DEFINE TEST-THINGS (RM F "AUX" CT (RMG <GETP .RM ,P?THINGS>) (
+RMGL <GET .RMG 0>)) <SET RMG <REST .RMG 2>> <COND (<T? <SET CT <FIND-ADJS .F>>>
+<SET CT <ADJS-COUNT .CT>>)> <REPEAT (TTBL (NOUN <FIND-NOUN .F>) (V <
+REST-TO-SLOT <FIND-ADJS .F> ADJS-COUNT 1>)) <COND (<AND <SET TTBL <GET .RMG 1>>
+<OR <EQUAL? .NOUN ,W?ONE> <INTBL? .NOUN <REST .TTBL 2> <GET .TTBL 0>>> <OR <0?
+.CT> <AND <SET TTBL <GET .RMG 0>> <INTBL? <ZGET .V 0> <REST .TTBL 2> <GET .TTBL
+0>>>> <OR <NOT <FIND-OF .F>> <AND <EQUAL? 1 <FIND-RES-COUNT ,OWNER-SR-HERE>> <
+EQUAL? ,PSEUDO-OBJECT <FIND-RES-OBJ1 ,OWNER-SR-HERE>> <EQUAL? ,LAST-PSEUDO-LOC
+.RM> <EQUAL? <GETP ,PSEUDO-OBJECT ,P?ACTION> <GET .RMG 2>>>>> <SETG
+LAST-PSEUDO-LOC .RM> <PUTP ,PSEUDO-OBJECT ,P?ACTION <GET .RMG 2>> <SET V <ZBACK
+<GETPT ,PSEUDO-OBJECT ,P?ACTION> 7>> <COPYT .NOUN .V 6> <ADD-OBJECT ,
+PSEUDO-OBJECT .F> <RFALSE>)> <SET RMG <REST .RMG 6>> <COND (<L? <SET RMGL <- .
+RMGL 1>> 1> <RTRUE>)>>> <GLOBAL LAST-PSEUDO-LOC:OBJECT <>> <OBJECT
+PSEUDO-OBJECT (LOC LOCAL-GLOBALS) (DESC "pseudoxxx") (ACTION 0)>>
+<REPLACE-DEFINITION INVALID-OBJECT? <ROUTINE INVALID-OBJECT? (OBJ) <COND (<
+EVERYWHERE-VERB?> <RFALSE>)> <COND (<AND <EQUAL? .OBJ ,CEILING> <FSET? ,HERE ,
+OUTSIDEBIT> <NOT <EQUAL? ,HERE ,ROOF ,PARAPET>>> <RTRUE>) (<AND <EQUAL? .OBJ ,
+LOCK-OBJECT> <NOUN-USED? ,LOCK-OBJECT ,W?KEYHOLE> <EQUAL? ,HERE ,LOWEST-HALL>>
+<RTRUE>) (<AND <EQUAL? .OBJ ,WALL> <FSET? ,HERE ,OUTSIDEBIT> <NOT <EQUAL? ,
+W?ONE <FIND-NOUN ,FINDER>>> <NOT <EQUAL? ,HERE ,PERIMETER-WALL>>> <RTRUE>) (T <
+RFALSE>)>>>
+<END-SEGMENT> \ No newline at end of file
diff --git a/defs2.zap b/defs2.zap
new file mode 100644
index 0000000..a70b90c
--- /dev/null
+++ b/defs2.zap
@@ -0,0 +1,13 @@
+
+ .SEGMENT "0"
+
+
+ .FUNCT DIRECTION-CONVERSION
+ CALL2 GET-NP,INTDIR
+ GET STACK,2
+ GETB STACK,6
+ RSTACK
+
+ .ENDSEG
+
+ .ENDI
diff --git a/defs2.zil b/defs2.zil
new file mode 100644
index 0000000..531f344
--- /dev/null
+++ b/defs2.zil
@@ -0,0 +1,165 @@
+"DEFS2 for
+
+ ZORK ZERO
+ (c) Copyright 1988 Infocom, Inc. All Rights Reserved."
+
+<BEGIN-SEGMENT 0>
+
+<INCLUDE "BASEDEFS" "PBITDEFS" "PDEFS">
+
+<NEW-ADD-WORD "CAGES" NOUN <VOC "CAGE"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "STALLS" NOUN <VOC "STALL"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "DOORS" NOUN <VOC "DOOR"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "BUTTONS" NOUN <VOC "BUTTON"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "ORBS" NOUN <VOC "ORB"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "SLABS" NOUN <VOC "SLAB"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "WEIGHTS" NOUN <VOC "WEIGHT"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "ANIMALS" NOUN <VOC "ANIMAL"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "SNAKES" NOUN <VOC "SNAKE"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "KEYS" NOUN <VOC "KEY"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "PEGS" NOUN <VOC "PEG"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "POSTS" NOUN <VOC "POST"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "SHELLS" NOUN <VOC "SHELL"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "FLIES" NOUN <VOC "FLY"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "VIALS" NOUN <VOC "VIAL"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "TREES" NOUN <VOC "TREE"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "ELMS" NOUN <VOC "ELM"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "OAKS" NOUN <VOC "OAK"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "PINES" NOUN <VOC "PINE"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "WITCHES" NOUN <VOC "WITCH"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "PASSAGES" NOUN <VOC "PASSAGE"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "FLOWERS" NOUN <VOC "FLOWER"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "BOARDS" NOUN <VOC "BOARD"> ,PLURAL-FLAG>
+<NEW-ADD-WORD "SHUTTERS" NOUN <VOC "SHUTTER"> ,PLURAL-FLAG>
+
+<NEW-ADD-WORD "DIMWIT\'S" ADJ DIMWIT ,POSSESSIVE>
+<NEW-ADD-WORD "JESTER\'S" ADJ JESTER ,POSSESSIVE>
+
+<ROUTINE DIRECTION-CONVERSION ()
+ <WORD-DIR-ID <NP-NAME <GET-NP ,INTDIR>>>>
+
+<REPLACE-DEFINITION MOBY-FIND?
+ <ROUTINE MOBY-FIND? (SEARCH)
+ <COND (<OR <NOT <0? <ANDB .SEARCH ,SEARCH-MOBY ;128>>>
+ <EQUAL? ,WINNER ,EXECUTIONER>>
+ T)>>>
+
+<REPLACE-DEFINITION WHICH-LIST?
+<ROUTINE WHICH-LIST? (NP SR "AUX" (CT <FIND-RES-COUNT .SR>)
+ (V <REST-TO-SLOT .SR FIND-RES-OBJ1>))
+ <COND (<G? .CT <FIND-RES-SIZE .SR>>
+ <RFALSE>)
+ ;(<EQUAL? <NP-NAME .NP> ,W?FLY ,W?FLIES>
+ <RFALSE>)
+ (<AND <SET NP <INTBL? ,PSEUDO-OBJECT .V .CT>>
+ <INTBL? ,PSEUDO-OBJECT <REST .NP 2>
+ <- .CT </ <+ 2 <- .NP .V>> 2>>>>
+ <RFALSE>)>
+ <REPEAT ()
+ <COND (<L? <SET CT <- .CT 1>> 0>
+ <RFALSE>)
+ (<ACCESSIBLE? <ZGET .V 0>>
+ <RTRUE>)
+ (T
+ <SET V <ZREST .V 2>>)>>>>
+
+<REPLACE-DEFINITION PSEUDO-OBJECTS
+
+<PUTPROP THINGS PROPSPEC HACK-PSEUDOS>
+
+<DEFINE20 HACK-PSEUDOS (LIST "AUX" (N 0) (CT 0) NL)
+ <SET LIST <REST .LIST>>
+ <SET LIST
+ <MAPF ,LIST
+ <FUNCTION (X)
+ <COND (<0? .N>
+ <SET CT <+ .CT 1>>
+ <SET N 1>
+ <COND (<TYPE? .X ATOM>
+ <TABLE (PURE ;PATTERN ;(BYTE [REST WORD]))
+ 1
+ <VOC <SPNAME .X> ADJ>>)
+ (<TYPE? .X LIST>
+ <EVAL <CHTYPE (TABLE (PURE ;PATTERN ;(BYTE [REST WORD]))
+ <LENGTH .X>
+ !<MAPF ,LIST
+ <FUNCTION (Y)
+ <VOC <SPNAME .Y> ADJ>>
+ .X>) FORM>>)
+ (T 0)>)
+ (<1? .N>
+ <SET N 2>
+ <COND (<TYPE? .X ATOM>
+ <TABLE (PURE ;PATTERN ;(BYTE [REST WORD]))
+ 1 <VOC <SPNAME .X> NOUN>>)
+ (<TYPE? .X LIST>
+ <EVAL <CHTYPE (TABLE (PURE ;PATTERN ;(BYTE [REST WORD]))
+ <LENGTH .X>
+ !<MAPF ,LIST
+ <FUNCTION (Y)
+ <VOC <SPNAME .Y> NOUN>>
+ .X>) FORM>>)
+ (T 0)>)
+ (T
+ <SET N 0>
+ .X)>>
+ .LIST>>
+ (<> <EVAL <CHTYPE (TABLE (PURE ;PATTERN ;(BYTE [REST WORD]))
+ .CT !.LIST) FORM>>)>
+
+<DEFINE TEST-THINGS (RM F
+ "AUX" CT (RMG <GETP .RM ,P?THINGS>) (RMGL <GET .RMG 0>))
+ <SET RMG <REST .RMG 2>>
+ <COND (<T? <SET CT <FIND-ADJS .F>>>
+ <SET CT <ADJS-COUNT .CT>>)>
+ <REPEAT (TTBL (NOUN <FIND-NOUN .F>)
+ (V <REST-TO-SLOT <FIND-ADJS .F> ADJS-COUNT 1>))
+ <COND (<AND <SET TTBL <GET .RMG 1>>
+ <OR <EQUAL? .NOUN ;<> ,W?ONE>
+ <INTBL? .NOUN <REST .TTBL 2> <GET .TTBL 0>>>
+ <OR <0? .CT>
+ <AND <SET TTBL <GET .RMG 0>>
+ <INTBL? <ZGET .V 0> <REST .TTBL 2> <GET .TTBL 0>>>>
+ <OR <NOT <FIND-OF .F>>
+ <AND <EQUAL? 1 <FIND-RES-COUNT ,OWNER-SR-HERE>>
+ <EQUAL? ,PSEUDO-OBJECT <FIND-RES-OBJ1 ,OWNER-SR-HERE>>
+ <EQUAL? ,LAST-PSEUDO-LOC .RM>
+ <EQUAL? <GETP ,PSEUDO-OBJECT ,P?ACTION> <GET .RMG 2>>>>>
+ <SETG LAST-PSEUDO-LOC .RM>
+ <PUTP ,PSEUDO-OBJECT ,P?ACTION <GET .RMG 2>>
+ <SET V <ZBACK <GETPT ,PSEUDO-OBJECT ,P?ACTION> 7>>
+ <COPYT .NOUN .V 6>
+ <ADD-OBJECT ,PSEUDO-OBJECT .F>
+ <RFALSE>)>
+ <SET RMG <REST .RMG 6>>
+ <COND (<L? <SET RMGL <- .RMGL 1>> 1>
+ <RTRUE>)>>>
+
+<GLOBAL LAST-PSEUDO-LOC:OBJECT <>>
+
+<OBJECT PSEUDO-OBJECT
+ (LOC LOCAL-GLOBALS)
+ (DESC "pseudoxxx")
+ (ACTION 0) ;"no other properties!">>
+
+<REPLACE-DEFINITION INVALID-OBJECT?
+<ROUTINE INVALID-OBJECT? (OBJ)
+ <COND (<EVERYWHERE-VERB?>
+ <RFALSE>)>
+ <COND (<AND <EQUAL? .OBJ ,CEILING>
+ <FSET? ,HERE ,OUTSIDEBIT>
+ <NOT <EQUAL? ,HERE ,ROOF ,PARAPET>>>
+ <RTRUE>)
+ (<AND <EQUAL? .OBJ ,LOCK-OBJECT>
+ <NOUN-USED? ,LOCK-OBJECT ,W?KEYHOLE>
+ <EQUAL? ,HERE ,LOWEST-HALL>>
+ <RTRUE>)
+ (<AND <EQUAL? .OBJ ,WALL>
+ <FSET? ,HERE ,OUTSIDEBIT>
+ <NOT <EQUAL? ,W?ONE <FIND-NOUN ,FINDER>>>
+ <NOT <EQUAL? ,HERE ,PERIMETER-WALL>>>
+ <RTRUE>)
+ (T
+ <RFALSE>)>>>
+
+<END-SEGMENT> \ No newline at end of file
diff --git a/fenshire.zabstr b/fenshire.zabstr
new file mode 100644
index 0000000..45c4192
--- /dev/null
+++ b/fenshire.zabstr
@@ -0,0 +1,153 @@
+
+<BEGIN-SEGMENT FENSHIRE>
+<ROOM DIRIGIBLE-HANGAR (LOC ROOMS) (REGION "Flatheadia") (DESC
+"Dirigible Hangar") (LDESC
+"Even after becoming accustomed to the oversized scale of the castle,
+this hangar seems tremendous. The only exit on foot is to the east.") (EAST TO
+WEST-WING) (OUT TO WEST-WING) (IN PER DIRIGIBLE-ENTER-F) (FLAGS RLANDBIT ONBIT)
+(SYNONYM HANGAR) (ADJECTIVE DIRIGIBLE LARGE) (MAP-LOC <PTABLE MAIN-MAP-NUM
+MAP-GEN-Y-5 MAP-GEN-X-1>) (GLOBAL GONDOLA) (ACTION DIRIGIBLE-HANGAR-F)>
+<DEFINE-ROUTINE DIRIGIBLE-ENTER-F>
+<DEFINE-ROUTINE DIRIGIBLE-HANGAR-F>
+<OBJECT DIRIGIBLE (LOC DIRIGIBLE-HANGAR) (DESC "dirigible") (LDESC
+"A tremendous dirigible is moored here. The gondola is just a few inches
+off the ground.") (SYNONYM DIRIGIBLE) (FLAGS VEHBIT) (ACTION DIRIGIBLE-F)>
+<DEFINE-ROUTINE DIRIGIBLE-F>
+<ROOM GONDOLA (LOC ROOMS) (REGION "Flatheadia") (DESC "Gondola") (OUT PER
+GONDOLA-EXIT-F) (FLAGS RLANDBIT ONBIT) (SYNONYM GONDOLA) (GLOBAL WINDOW
+DIRIGIBLE DIRIGIBLE-HANGAR SMALLER-HANGAR) (MAP-LOC <TABLE MAIN-MAP-NUM
+GONDOLA-AT-FLATHEADIA-LOC MAP-GEN-X-1>) (ICON GONDOLA-ICON) (ACTION GONDOLA-F)>
+
+<DEFINE-ROUTINE GONDOLA-F>
+<CONSTANT GONDOLA-CONTROLS-DESC
+"The controls consist of merely two buttons: the left button
+is marked \"Flatheadia\" and the right button is marked \"Fenshire.\"">
+<OBJECT GONDOLA-CONTROLS (LOC GONDOLA) (DESC "controls") (SYNONYM CONTROL
+CONTROLS) (FLAGS NDESCBIT) (ACTION GONDOLA-CONTROLS-F)>
+<DEFINE-ROUTINE GONDOLA-CONTROLS-F>
+<OBJECT LEFT-GONDOLA-BUTTON (LOC GONDOLA) (DESC "left button") (SYNONYM BUTTON)
+(ADJECTIVE LEFT) (FLAGS NDESCBIT) (ACTION GONDOLA-BUTTON-F)>
+<OBJECT RIGHT-GONDOLA-BUTTON (LOC GONDOLA) (DESC "right button") (SYNONYM
+BUTTON) (ADJECTIVE RIGHT) (FLAGS NDESCBIT) (ACTION GONDOLA-BUTTON-F)>
+<DEFINE-ROUTINE GONDOLA-BUTTON-F>
+<DEFINE-ROUTINE GONDOLA-EXIT-F>
+<GLOBAL DESTINATION <>>
+<GLOBAL DIRIGIBLE-COUNTER 0>
+<DEFINE-ROUTINE I-DIRIGIBLE>
+<CONSTANT DIRIGIBLE-TRIP-DESCS <PTABLE
+"It is now passing over a thickly tangled woods, stretching for miles in every
+direction." "You are now above the Frigid River. Cliffs crowd the river on both sides. To
+the south, you can just make out the spray of Aragain Falls."
+"The dirigible rises even higher as it crosses the Flathead Mountains. Jagged,
+snow-topped peaks slide by below."
+"Below you are vast square bloits of dismal swampland: the endless marshes of
+Fenshire.">>
+<ROOM SMALLER-HANGAR (LOC ROOMS) (REGION "Fenshire") (DESC "Smaller Hangar") (
+LDESC "This hangar, though still large, is smaller than the one in Flatheadia.
+The only exit is south.") (SOUTH TO DESERTED-CASTLE) (IN PER DIRIGIBLE-ENTER-F)
+(OUT TO DESERTED-CASTLE) (FLAGS RLANDBIT ONBIT) (SYNONYM HANGAR) (ADJECTIVE
+SMALLER) (GLOBAL GONDOLA) (VALUE 6) (MAP-LOC <PTABLE FENSHIRE-MAP-NUM
+MAP-GEN-Y-3 MAP-GEN-X-2>) (ACTION 0)>
+<DEFINE-ROUTINE SMALLER-HANGAR-F>
+<ROOM DESERTED-CASTLE (LOC ROOMS) (REGION "Fenshire") (DESC "Deserted Castle")
+(LDESC "The summer palace of the Kings of Quendor now lies in ruins, unoccupied
+and uncared for, forgotten for many years. What's left of the castle can
+be entered to the east, and a hangar lies to the north.") (NORTH TO
+SMALLER-HANGAR) (EAST TO RUINED-HALL) (FLAGS RLANDBIT ONBIT OUTSIDEBIT) (GLOBAL
+SMALLER-HANGAR) (MAP-LOC <PTABLE FENSHIRE-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-2>) (
+ACTION 0)>
+<DEFINE-ROUTINE DESERTED-CASTLE-F>
+<ROOM RUINED-HALL (LOC ROOMS) (REGION "Fenshire") (DESC "Ruined Hall") (NORTH
+TO MARSH IF ARCHWAY-OPEN ELSE "That archway has crumbled!") (SOUTH TO HOTHOUSE)
+(WEST TO DESERTED-CASTLE) (EAST TO SECRET-ROOM IF SECRET-ROOM-REVEALED) (UP
+SORRY "The stairs have crumbled beyond use.") (FLAGS RLANDBIT ONBIT) (GLOBAL
+STAIRS) (MAP-LOC <PTABLE FENSHIRE-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-3>) (ICON
+RUINED-HALL-ICON) (ACTION RUINED-HALL-F)>
+<DEFINE-ROUTINE RUINED-HALL-F>
+<OBJECT FIREPLACE (LOC RUINED-HALL) (DESC "fireplace") (SYNONYM FIREPLACE) (
+ADJECTIVE CHOKED) (FLAGS NDESCBIT) (ACTION FIREPLACE-F)>
+<DEFINE-ROUTINE FIREPLACE-F>
+<OBJECT FRESCO (LOC RUINED-HALL) (DESC "fresco") (SYNONYM FRESCO) (ADJECTIVE
+FADED) (FLAGS NDESCBIT) (ACTION FRESCO-F)>
+<DEFINE-ROUTINE FRESCO-F>
+<OBJECT VASE (LOC RUINED-HALL) (DESC "vase") (SYNONYM VASE) (ADJECTIVE SMALL) (
+FLAGS NDESCBIT CONTBIT SEARCHBIT OPENBIT TRYTAKEBIT) (ACTION VASE-F)>
+<DEFINE-ROUTINE VASE-F>
+<GLOBAL SECRET-ROOM-REVEALED <>>
+<ROOM SECRET-ROOM (LOC ROOMS) (REGION "Fenshire") (DESC "Secret Room") (LDESC
+"You are the first person to breathe the air of this room in uncounted years.
+The only exit is west.") (WEST TO RUINED-HALL) (OUT TO RUINED-HALL) (FLAGS
+RLANDBIT) (SYNONYM ROOM) (ADJECTIVE SECRET) (MAP-LOC <PTABLE FENSHIRE-MAP-NUM
+MAP-GEN-Y-4 MAP-GEN-X-4>) (ICON SECRET-ROOM-ICON)>
+<OBJECT LADDER (LOC SECRET-ROOM) (DESC "ladder") (FDESC
+"This room was probably intended as a hiding place for the royal family
+in the event of a revolution, and may have once been well-stocked with
+supplies. Now, however, the only item here is a small stepladder.") (SYNONYM
+LADDER STEPLADDER) (ADJECTIVE SMALL) (CAPACITY 20) (SIZE 20) (FLAGS TAKEBIT
+VEHBIT CONTBIT SEARCHBIT SURFACEBIT) (ACTION LADDER-F)>
+<BEGIN-SEGMENT 0>
+<DEFINE-ROUTINE LADDER-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT FENSHIRE>
+<GLOBAL ARCHWAY-OPEN T>
+<GLOBAL STEPPING-STONES-VISIBLE <>>
+<ROOM MARSH (LOC ROOMS) (REGION "Fenshire") (DESC "Marsh") (SOUTH TO
+RUINED-HALL IF ARCHWAY-OPEN ELSE
+"The archway has collapsed; that way is now impassable.") (NORTH PER
+STEPPING-STONES-F) (FLAGS RLANDBIT ONBIT OUTSIDEBIT) (GLOBAL SWAMP ARCH) (ICON
+MARSH-ICON) (MAP-LOC <PTABLE FENSHIRE-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-3>) (ACTION
+MARSH-F)>
+<DEFINE-ROUTINE MARSH-F>
+<DEFINE-ROUTINE STEPPING-STONES-F>
+<ROOM NICE-LUNCH-SPOT (LOC ROOMS) (REGION "Fenshire") (DESC "Nice Lunch Spot")
+(LDESC "Maybe the jester likes the ambience here, but to you it just looks like
+a slightly drier spot amidst a reedy marsh. The reeds are impassably thick
+in every direction, except to the south where a series of stepping stones
+offers a way to cross a malodorous patch of quicksand.") (SOUTH TO MARSH) (
+FLAGS RLANDBIT ONBIT OUTSIDEBIT) (MAP-LOC <PTABLE FENSHIRE-MAP-NUM MAP-GEN-Y-2
+MAP-GEN-X-3>) (ACTION NICE-LUNCH-SPOT-F)>
+<DEFINE-ROUTINE NICE-LUNCH-SPOT-F>
+<BEGIN-SEGMENT 0>
+<OBJECT HEXAGONAL-BLOCK (LOC LOCAL-GLOBALS) (DESC "hexagonal block") (SYNONYM
+BLOCK ROCK) (ADJECTIVE SMALL ELONGATED HEXAGONAL HEXAGON-SHAPED) (FLAGS TAKEBIT
+) (SIZE 3) (ACTION HEXAGONAL-BLOCK-F)>
+<DEFINE-ROUTINE HEXAGONAL-BLOCK-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT FENSHIRE>
+<ROOM HOTHOUSE (LOC ROOMS) (REGION "Fenshire") (DESC "Hothouse") (LDESC
+"This enclosed arboretum must have been a breathtaking room at one time. Now,
+much of the glass is broken and the foliage has run wild, nearly obscuring the
+exit to the north. Despite the broken glass, it's stiflingly hot in here.") (
+NORTH TO RUINED-HALL) (OUT TO RUINED-HALL) (FLAGS RLANDBIT ONBIT) (SYNONYM
+HOTHOUSE GREENHOUSE ARBORETUM) (GLOBAL WINDOW) (MAP-LOC <PTABLE
+FENSHIRE-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-3>) (ICON HOTHOUSE-ICON) (ACTION
+HOTHOUSE-F)>
+<DEFINE-ROUTINE HOTHOUSE-F>
+<CONSTANT SN-PICSET-TBL <TABLE BOX-1 BOX-2 BOX-3 BOX-4 BOX-5 BOX-6 BOX-7 BOX-8
+BOX-9 DIM-BOX-1 DIM-BOX-2 DIM-BOX-3 DIM-BOX-4 DIM-BOX-5 DIM-BOX-6 DIM-BOX-7
+DIM-BOX-8 DIM-BOX-9 PILE-OF-0 PILE-OF-1 PILE-OF-2 PILE-OF-3 PILE-OF-4 PILE-OF-5
+PILE-OF-6 PILE-OF-7 PILE-OF-8 PILE-OF-9 R-FLOWERS-0 R-FLOWERS-1 R-FLOWERS-2
+R-FLOWERS-3 R-FLOWERS-4 R-FLOWERS-5 R-FLOWERS-6 R-FLOWERS-7 R-FLOWERS-8
+R-FLOWERS-9 L-FLOWERS-0 L-FLOWERS-1 L-FLOWERS-2 L-FLOWERS-3 L-FLOWERS-4 0>>
+<DEFINE-ROUTINE I-SN>
+<DEFINE-ROUTINE SETUP-SN>
+<DEFINE-ROUTINE DRAW-SN-BOXES>
+<CONSTANT BOX-TBL <PTABLE 0 BOX-1 BOX-2 BOX-3 BOX-4 BOX-5 BOX-6 BOX-7 BOX-8
+BOX-9>>
+<CONSTANT DIM-BOX-TBL <PTABLE 0 DIM-BOX-1 DIM-BOX-2 DIM-BOX-3 DIM-BOX-4
+DIM-BOX-5 DIM-BOX-6 DIM-BOX-7 DIM-BOX-8 DIM-BOX-9>>
+<CONSTANT PILE-TABLE <TABLE 0 0 0 0 0>>
+<DEFINE-ROUTINE DRAW-PILE>
+<DEFINE-ROUTINE DRAW-FLOWERS>
+<DEFINE-ROUTINE SNARFEM>
+<DEFINE-ROUTINE SN-CLICK>
+<DEFINE-ROUTINE COUNTDOWN-PILE>
+<CONSTANT BINARY-TABLE <PTABLE 0 1 10 11 100 101 110 111 1000 1001>>
+<DEFINE-ROUTINE SAFE-NUMBER?>
+<CONSTANT TEMP-TABLE <TABLE 0 0 0 0 0>>
+<DEFINE-ROUTINE J-MOVE>
+<DEFINE-ROUTINE END-SN?>
+<OBJECT FAN (DESC "fan") (SYNONYM FAN) (ADJECTIVE DELICATE DAINTY PAPER) (FLAGS
+TAKEBIT TRYTAKEBIT MAGICBIT) (VALUE 0) (ACTION FAN-F)>
+<DEFINE-ROUTINE FAN-F>
+<END-SEGMENT> \ No newline at end of file
diff --git a/fenshire.zap b/fenshire.zap
new file mode 100644
index 0000000..bb23f4a
--- /dev/null
+++ b/fenshire.zap
@@ -0,0 +1,948 @@
+
+ .SEGMENT "FENSHIRE"
+
+
+ .FUNCT DIRIGIBLE-ENTER-F,RARG
+ IN? DIRIGIBLE,HERE \?CCL3
+ RETURN GONDOLA
+?CCL3: ZERO? RARG \FALSE
+ ICALL1 V-WALK-AROUND
+ RFALSE
+
+
+ .FUNCT DIRIGIBLE-HANGAR-F,RARG
+ ZERO? DEMO-VERSION? /FALSE
+ EQUAL? RARG,M-END \FALSE
+ CALL1 END-DEMO
+ RSTACK
+
+
+ .FUNCT DIRIGIBLE-F
+ EQUAL? PRSA,V?PUT-THROUGH,V?THROW-FROM \?CCL3
+ EQUAL? PRSI,DIRIGIBLE \?CCL3
+ CALL PERFORM-PRSA,PRSO,GONDOLA
+ RSTACK
+?CCL3: EQUAL? PRSA,V?EXAMINE \?CCL7
+ EQUAL? HERE,GONDOLA \?CCL10
+ CALL1 V-LOOK
+ RSTACK
+?CCL10: GETP DIRIGIBLE,P?LDESC
+ PRINT STACK
+ CRLF
+ RTRUE
+?CCL7: EQUAL? PRSA,V?LOOK-INSIDE \?CCL12
+ EQUAL? HERE,GONDOLA \?CCL15
+ PRINT LOOK-AROUND
+ RTRUE
+?CCL15: PRINTR "You can't see much from out here."
+?CCL12: EQUAL? PRSA,V?ENTER \FALSE
+ CALL2 GOTO,GONDOLA
+ RSTACK
+
+
+ .FUNCT GONDOLA-F,RARG
+ EQUAL? RARG,M-LOOK \?CCL3
+ PRINTI "You are in the luxurious gondola of the dirigible. A window wraps completely around the gondola. "
+ PRINT GONDOLA-CONTROLS-DESC
+ RTRUE
+?CCL3: ZERO? RARG \FALSE
+ EQUAL? PRSA,V?EXAMINE \?CCL7
+ CALL2 PERFORM-PRSA,DIRIGIBLE
+ RSTACK
+?CCL7: EQUAL? PRSA,V?ENTER \?CCL9
+ EQUAL? HERE,GONDOLA /?CCL9
+ CALL2 DO-WALK,P?IN
+ RSTACK
+?CCL9: EQUAL? PRSA,V?EXIT,V?LEAP-OFF \?CCL13
+ EQUAL? HERE,GONDOLA \?CCL13
+ CALL2 DO-WALK,P?OUT
+ RSTACK
+?CCL13: EQUAL? PRSA,V?LOOK-INSIDE \?CCL17
+ CALL2 PERFORM-PRSA,DIRIGIBLE
+ RSTACK
+?CCL17: EQUAL? PRSA,V?PUT-THROUGH,V?THROW-FROM \FALSE
+ EQUAL? PRSI,GLOBAL-HERE,GONDOLA \FALSE
+ IN? DIRIGIBLE,DIRIGIBLE-HANGAR /?CTR23
+ IN? DIRIGIBLE,SMALLER-HANGAR \?CCL24
+?CTR23: LOC DIRIGIBLE
+ MOVE PRSO,STACK
+ JUMP ?CND22
+?CCL24: EQUAL? PRSO,PERCH /?CCL28
+ CALL ULTIMATELY-IN?,PERCH,PRSO
+ ZERO? STACK /?CND27
+?CCL28: SET 'REMOVED-PERCH-LOC,GROUND
+?CND27: REMOVE PRSO
+?CND22: PRINTI "You fling"
+ ICALL1 TPRINT-PRSO
+ PRINTR " out of the gondola."
+
+
+ .FUNCT GONDOLA-CONTROLS-F
+ EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINT GONDOLA-CONTROLS-DESC
+ CRLF
+ RTRUE
+
+
+ .FUNCT GONDOLA-BUTTON-F
+ EQUAL? PRSA,V?PUSH \FALSE
+ ZERO? TIME-STOPPED \?CTR5
+ FSET? OUTER-GATE,OPENBIT /?CTR5
+ GRTR? DIRIGIBLE-COUNTER,0 /?CTR5
+ EQUAL? PRSO,LEFT-GONDOLA-BUTTON \?PRD11
+ IN? DIRIGIBLE,DIRIGIBLE-HANGAR /?CTR5
+?PRD11: EQUAL? PRSO,RIGHT-GONDOLA-BUTTON \?CCL6
+ IN? DIRIGIBLE,SMALLER-HANGAR \?CCL6
+?CTR5: PRINT NOTHING-HAPPENS
+ RTRUE
+?CCL6: ICALL QUEUE,I-DIRIGIBLE,-1
+ SET 'DIRIGIBLE-COUNTER,1
+ ZERO? BORDER-ON /?CND16
+ GETB 0,30
+ EQUAL? STACK,DEC-20 /?CND16
+ ICALL1 CLEAR-BORDER
+ ICALL2 INIT-STATUS-LINE,TRUE-VALUE
+?CND16: PRINTI "The dirigible rises out of the hangar and sails "
+ IN? DIRIGIBLE,DIRIGIBLE-HANGAR \?CCL22
+ SET 'DESTINATION,SMALLER-HANGAR
+ PRINTI "ea"
+ JUMP ?CND20
+?CCL22: SET 'DESTINATION,DIRIGIBLE-HANGAR
+ PRINTI "we"
+?CND20: PUTP GONDOLA,P?REGION,STR?939
+ GETP GONDOLA,P?MAP-LOC
+ PUT STACK,0,FALSE-VALUE
+ FSET DIRIGIBLE,NDESCBIT
+ MOVE DIRIGIBLE,GONDOLA
+ PRINTR "stward."
+
+
+ .FUNCT GONDOLA-EXIT-F,RARG
+ GRTR? DIRIGIBLE-COUNTER,0 \?CCL3
+ ZERO? RARG \FALSE
+ CALL2 JIGS-UP,STR?940
+ RSTACK
+?CCL3: LOC DIRIGIBLE
+ RSTACK
+
+
+ .FUNCT I-DIRIGIBLE,TBL
+ EQUAL? HERE,GONDOLA \?CND1
+ ICALL1 RETURN-FROM-MAP
+ PRINTI " "
+?CND1: EQUAL? DIRIGIBLE-COUNTER,5 \?CCL5
+ GETP GONDOLA,P?MAP-LOC >TBL
+ EQUAL? DESTINATION,SMALLER-HANGAR \?CCL8
+ PUT TBL,0,FENSHIRE-MAP-NUM
+ PUT TBL,1,GONDOLA-AT-FENSHIRE-LOC
+ PUT TBL,2,MAP-GEN-X-2
+ PUTP GONDOLA,P?REGION,STR?249
+ JUMP ?CND6
+?CCL8: PUT TBL,0,MAIN-MAP-NUM
+ PUT TBL,1,GONDOLA-AT-FLATHEADIA-LOC
+ PUT TBL,2,MAP-GEN-X-1
+ PUTP GONDOLA,P?REGION,STR?250
+?CND6: MOVE DIRIGIBLE,DESTINATION
+ FCLEAR DIRIGIBLE,NDESCBIT
+ ICALL2 DEQUEUE,I-DIRIGIBLE
+ SET 'DIRIGIBLE-COUNTER,0
+ ZERO? BORDER-ON /?CND9
+ EQUAL? HERE,GONDOLA \?CND9
+ GETB 0,30
+ EQUAL? STACK,DEC-20 /?CND9
+ ICALL1 CLEAR-BORDER
+ SET 'CURRENT-BORDER,CASTLE-BORDER
+ SCREEN S-FULL
+ ICALL2 INIT-STATUS-LINE,TRUE-VALUE
+ SCREEN S-TEXT
+?CND9: EQUAL? HERE,GONDOLA \?CCL16
+ PRINTR "The dirigible descends into a hangar and comes to a stop."
+?CCL16: EQUAL? HERE,DESTINATION \FALSE
+ ICALL1 RETURN-FROM-MAP
+ PRINTR " A dirigible descends into the hangar."
+?CCL5: EQUAL? HERE,GONDOLA /?CCL20
+ INC 'DIRIGIBLE-COUNTER
+ RFALSE
+?CCL20: ICALL1 RETURN-FROM-MAP
+ PRINTI "The dirigible continues to glide along. "
+ EQUAL? DESTINATION,DIRIGIBLE-HANGAR \?CCL23
+ SUB 4,DIRIGIBLE-COUNTER
+ GET DIRIGIBLE-TRIP-DESCS,STACK
+ PRINT STACK
+ JUMP ?CND21
+?CCL23: SUB DIRIGIBLE-COUNTER,1
+ GET DIRIGIBLE-TRIP-DESCS,STACK
+ PRINT STACK
+?CND21: INC 'DIRIGIBLE-COUNTER
+ CRLF
+ RTRUE
+
+
+ .FUNCT SMALLER-HANGAR-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ FSET? SMALLER-HANGAR,TOUCHBIT /FALSE
+ CALL QUEUE,I-FOX,-1
+ RSTACK
+
+
+ .FUNCT DESERTED-CASTLE-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ FSET? DESERTED-CASTLE,TOUCHBIT /FALSE
+ CALL QUEUE,I-ROOSTER,-1
+ RSTACK
+
+
+ .FUNCT RUINED-HALL-F,RARG
+ EQUAL? RARG,M-LOOK \?CCL3
+ PRINTI "The entrance hall of the summer castle retains but a shadow of its former elegance; the ceiling has partially collapsed, and myriad weeds grow amongst the debris that covers the floor. A fireplace is choked with the rubble of its collapsed chimney. Above the fireplace is a faded fresco, and next to that, a tiny vase is mounted on the wall. Arched openings lead "
+ ZERO? ARCHWAY-OPEN /?CND4
+ PRINTI "north, "
+?CND4: PRINTI "south and west. "
+ ZERO? ARCHWAY-OPEN \?CND6
+ PRINTI "The archway to the north"
+ IN? HEXAGONAL-BLOCK,LOCAL-GLOBALS /?CCL10
+ SET 'ARCHWAY-OPEN,TRUE-VALUE
+ PRINTI ", which had earlier crumbled, seems restored to its former condition: decayed but passable! "
+ JUMP ?CND6
+?CCL10: PRINTI " has crumbled to rubble. "
+?CND6: ZERO? SECRET-ROOM-REVEALED /?CND11
+ PRINTI "In addition, a dusty passage leads east. "
+?CND11: PRINTI "A stairway once led upwards, but there's little left of it."
+ RTRUE
+?CCL3: EQUAL? RARG,M-END \FALSE
+ ZERO? ARCHWAY-OPEN \FALSE
+ IN? HEXAGONAL-BLOCK,LOCAL-GLOBALS /FALSE
+ SET 'ARCHWAY-OPEN,TRUE-VALUE
+ RETURN ARCHWAY-OPEN
+
+
+ .FUNCT FIREPLACE-F
+ EQUAL? PRSA,V?ENTER \?CCL3
+ CALL2 DO-FIRST,STR?949
+ RSTACK
+?CCL3: EQUAL? PRSA,V?CLEAN \?CCL5
+ PRINTR "Not a chance (unless you're actually a team of thirty people, in disguise)."
+?CCL5: EQUAL? PRSA,V?LOOK-INSIDE \FALSE
+ PRINTR "Rubble. Lots of rubble."
+
+
+ .FUNCT FRESCO-F
+ EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTR "The fresco depicts the death of Duncanthrax. His spirit is ascending to heaven on a tremendous ladder, surrounded by a host of angels."
+
+
+ .FUNCT VASE-F
+ EQUAL? PRSA,V?OPEN,V?CLOSE \?CCL3
+ PRINT HUH
+ RTRUE
+?CCL3: EQUAL? PRSA,V?TAKE \?CCL5
+ EQUAL? PRSO,VASE \?CCL5
+ PRINTR "The vase is affixed to the wall."
+?CCL5: EQUAL? PRSA,V?PUT \FALSE
+ EQUAL? PRSO,FLOWER \FALSE
+ ZERO? SECRET-ROOM-REVEALED \FALSE
+ SET 'SECRET-ROOM-REVEALED,TRUE-VALUE
+ SET 'COMPASS-CHANGED,TRUE-VALUE
+ MOVE FLOWER,VASE
+ PRINTI "The flower seems to grow fuller, its colors richer. You hear a noise, and turn to see a passageway opening to the east!"
+ CRLF
+ CALL2 INC-SCORE,16
+ RSTACK
+
+ .SEGMENT "0"
+
+
+ .FUNCT LADDER-F,VARG
+ ZERO? VARG \FALSE
+ EQUAL? PRSA,V?EXAMINE,V?CLOSE,V?OPEN \?CCL5
+ PRINTR "The stepladder seems to be stuck in the open position."
+?CCL5: EQUAL? PRSA,V?PUT-UNDER \?CCL7
+ EQUAL? PRSO,MEGABOZ-TRAP-DOOR \?CCL7
+ PRINTR "The ladder is now standing beneath the trap door."
+?CCL7: EQUAL? PRSA,V?CLIMB-ON,V?CLIMB,V?STAND-ON \FALSE
+ ICALL PERFORM,V?ENTER,LADDER
+ RTRUE
+
+ .ENDSEG
+
+ .SEGMENT "FENSHIRE"
+
+
+ .FUNCT MARSH-F,RARG
+ EQUAL? RARG,M-LOOK \?CCL3
+ PRINTI "The swamps of Fenshire have encroached on this once-beautiful garden. The garden wall is now just a pile of mossy stones, and the garden terraces are ankle-deep with squishy mud. A c"
+ ZERO? ARCHWAY-OPEN /?CCL6
+ PRINTI "rumbling archway leads"
+ JUMP ?CND4
+?CCL6: PRINTI "ollapsed archway blocks the exit to the"
+?CND4: PRINTI " south. To the north"
+ ZERO? STEPPING-STONES-VISIBLE /?CCL9
+ PRINTI ", stepping stones lead across a field of quicksand."
+ RTRUE
+?CCL9: PRINTI " is a wide expanse of fetid quicksand."
+ RTRUE
+?CCL3: EQUAL? RARG,M-END \FALSE
+ IN? JESTER,HERE \?CCL14
+ CALL2 VISIBLE?,ROOSTER
+ ZERO? STACK /?CCL14
+ FSET? ROOSTER,ANIMATEDBIT \?CCL14
+ CALL2 VISIBLE?,FOX
+ ZERO? STACK /?CCL14
+ FSET? FOX,ANIMATEDBIT \?CCL14
+ CALL2 VISIBLE?,WORM
+ ZERO? STACK /?CCL14
+ FSET? WORM,ANIMATEDBIT \?CCL14
+ MOVE JESTER,NICE-LUNCH-SPOT
+ MOVE COOKPOT,NICE-LUNCH-SPOT
+ MOVE COOKFIRE,NICE-LUNCH-SPOT
+ SET 'ARCHWAY-OPEN,FALSE-VALUE
+ SET 'STEPPING-STONES-VISIBLE,TRUE-VALUE
+ SET 'COMPASS-CHANGED,TRUE-VALUE
+ FSET RUINED-HALL,REDESCBIT
+ ICALL1 RETURN-FROM-MAP
+ PRINTR " The jester looks delighted. ""Sacre bleu! At last! All zee ingredients for Borphbelly Stew! But zee ambience here eesn't quite right."" He picks up his cookpot AND his cookfire, and dashes across the quicksand to the north, using a series of stepping stones which you'd swear weren't there a minute ago. This flurry of activity seems to have been too much for the archway behind you; it crumbles into a pile of rubble, blocking the exit to the south.
+ The jester, out of sight amongst the reeds to the north, shouts, ""Yoo hoo! I've found a lovely spot for lunch! Bring over zee ingredients!"""
+?CCL14: IN? JESTER,HERE /FALSE
+ IN? HEXAGONAL-BLOCK,LOCAL-GLOBALS \FALSE
+ ZERO? ARCHWAY-OPEN /FALSE
+ ICALL2 DEQUEUE,I-JESTER
+ ICALL2 THIS-IS-IT,JESTER
+ MOVE JESTER,HERE
+ MOVE COOKPOT,HERE
+ MOVE COOKFIRE,HERE
+ PRINTI " A string of eloquent cursing in a foreign tongue assaults you, and you spy the jester "
+ PRINT COOK-DESC
+ PRINTR " He is stirring a cookpot which sits upon a roaring cookfire. ""Impossible!"" he shrieks, switching to a more familiar language. ""Eet is impossible to cook a Borphbelly Stew weethout zee proper ingredients! Impossible, impossible, impossible!"""
+
+
+ .FUNCT STEPPING-STONES-F,RARG
+ ZERO? STEPPING-STONES-VISIBLE \?CCL3
+ ZERO? RARG \FALSE
+ PRINTI "You'd be sucked into the quicksand!"
+ CRLF
+ RFALSE
+?CCL3: CALL2 CCOUNT,PROTAGONIST
+ GRTR? STACK,1 \?CCL7
+ ZERO? RARG \FALSE
+ PRINTI "It's difficult to balance on the stepping stones with all you're carrying. You try, but after almost falling into the quicksand, you give up."
+ CRLF
+ RFALSE
+?CCL7: EQUAL? HERE,MARSH \?CCL11
+ RETURN NICE-LUNCH-SPOT
+?CCL11: RETURN MARSH
+
+
+ .FUNCT NICE-LUNCH-SPOT-F,RARG
+ EQUAL? RARG,M-END \FALSE
+ CALL2 VISIBLE?,ROOSTER
+ ZERO? STACK /FALSE
+ FSET? ROOSTER,ANIMATEDBIT \FALSE
+ CALL2 VISIBLE?,FOX
+ ZERO? STACK /FALSE
+ FSET? FOX,ANIMATEDBIT \FALSE
+ CALL2 VISIBLE?,WORM
+ ZERO? STACK /FALSE
+ FSET? WORM,ANIMATEDBIT \FALSE
+ MOVE HEXAGONAL-BLOCK,SMALLER-HANGAR
+ FSET SMALLER-HANGAR,REDESCBIT
+ FSET RUINED-HALL,REDESCBIT
+ REMOVE WORM
+ REMOVE FOX
+ REMOVE ROOSTER
+ REMOVE COOKPOT
+ REMOVE COOKFIRE
+ ICALL2 DEQUEUE,I-FOX
+ ICALL2 DEQUEUE,I-ROOSTER
+ ICALL1 RETURN-FROM-MAP
+ PRINTI " The jester says, ""Excellent! Zee ingredients for Borphbelly Stew and a "
+ ICALL2 DPRINT,HERE
+ PRINTI " to enjoy eet!"" He tosses the animals into the cookpot, and begins dishing out two generous portions of stew. Before you can eat it, a tremendous weariness comes over you. The last thing you hear is the jester saying, ""Waiter? Check, please!""
+
+You awake from a deep sleep and struggle to your feet. As your head clears you realize that you're not where you were when you fell asleep"
+ PRINT ELLIPSIS
+ ICALL2 GOTO,SMALLER-HANGAR
+ CALL2 INC-SCORE,9
+ RSTACK
+
+ .SEGMENT "0"
+
+
+ .FUNCT HEXAGONAL-BLOCK-F
+ EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTR "It's just a small rock which has been neatly carved into the shape of an elongated hexagon."
+
+ .ENDSEG
+
+ .SEGMENT "FENSHIRE"
+
+
+ .FUNCT HOTHOUSE-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ FSET? FAN,TRYTAKEBIT \FALSE
+ CALL QUEUE,I-SN,1
+ RSTACK
+
+
+ .FUNCT I-SN,?TMP3,?TMP2,?TMP1
+ EQUAL? HERE,HOTHOUSE \FALSE
+ ZERO? ALLIGATOR /?CND1
+ ICALL QUEUE,I-SN,1
+ RFALSE
+?CND1: ICALL1 RETURN-FROM-MAP
+ ICALL1 UPDATE-STATUS-LINE
+ PRINTI " The jester steps out from behind some tropical vines, fanning himself with a dainty paper fan. ""Hot enough for you? I know just the thing to take your mind off this heat! It's one of my favorite games, Snarfem.
+ ""The rules: I'll produce four piles of pebbles. Each of us, starting with you, will remove as many pebbles as we feel like -- as long as they come from the same pile. You must take at least one pebble each turn. The player who takes the last pebble wins. It's that simple!"""
+ CRLF
+ CRLF
+ ICALL2 HIT-ANY-KEY,STR?955
+ ICALL SPLIT-BY-PICTURE,SN-SPLIT,TRUE-VALUE
+ ICALL2 ADJUST-TEXT-WINDOW,SN-BOTTOM
+?PRG5: RANDOM 9
+ PUT PILE-TABLE,1,STACK
+?PRG7: RANDOM 9
+ PUT PILE-TABLE,2,STACK
+ GET PILE-TABLE,2 >?TMP1
+ GET PILE-TABLE,1
+ EQUAL? ?TMP1,STACK \?PRG14
+ GET PILE-TABLE,2
+ ADD STACK,1
+ PUT PILE-TABLE,2,STACK
+ GET PILE-TABLE,2
+ EQUAL? STACK,10 \?PRG7
+ PUT PILE-TABLE,2,1
+ JUMP ?PRG7
+?PRG14: RANDOM 9
+ PUT PILE-TABLE,3,STACK
+ GET PILE-TABLE,3 >?TMP2
+ GET PILE-TABLE,2 >?TMP1
+ GET PILE-TABLE,1
+ EQUAL? ?TMP2,?TMP1,STACK \?PRG21
+ GET PILE-TABLE,3
+ ADD STACK,1
+ PUT PILE-TABLE,3,STACK
+ GET PILE-TABLE,3
+ EQUAL? STACK,10 \?PRG14
+ PUT PILE-TABLE,3,1
+ JUMP ?PRG14
+?PRG21: RANDOM 9
+ PUT PILE-TABLE,4,STACK
+ GET PILE-TABLE,4 >?TMP3
+ GET PILE-TABLE,3 >?TMP2
+ GET PILE-TABLE,2 >?TMP1
+ GET PILE-TABLE,1
+ EQUAL? ?TMP3,?TMP2,?TMP1,STACK \?REP22
+ GET PILE-TABLE,4
+ ADD STACK,1
+ PUT PILE-TABLE,4,STACK
+ GET PILE-TABLE,4
+ EQUAL? STACK,10 \?PRG21
+ PUT PILE-TABLE,4,1
+ JUMP ?PRG21
+?REP22: CALL2 SAFE-NUMBER?,PILE-TABLE
+ ZERO? STACK \?PRG5
+ ICALL1 SETUP-SN
+ CRLF
+ ICALL1 SNARFEM
+ ICALL2 INIT-SL-WITH-SPLIT,TEXT-WINDOW-PIC-LOC
+ FSET? FAN,TRYTAKEBIT \?CCL32
+ PRINTI "The jester claps you on the back and says, ""He who wins and runs away, returns to let you win another day!"""
+ CALL1 J-EXITS
+ RSTACK
+?CCL32: MOVE FAN,HERE
+ ICALL1 REMOVE-J
+ PRINTI """You're undoubtedly not a flash in the pan; you've turned me into your biggest fan!"" The jester is suddenly wearing a cap and sweater bearing your initials, and waving a pennant with your name on it. Still chanting a cheer, he vanishes, and you notice a delicate paper fan lying at your feet."
+ CRLF
+ CALL2 INC-SCORE,12
+ RSTACK
+
+
+ .FUNCT SETUP-SN
+ SCREEN S-FULL
+ DISPLAY SN-BORDER,1,1
+ SCREEN S-WINDOW
+ PICSET SN-PICSET-TBL
+ ICALL2 DRAW-PILE,1
+ ICALL2 DRAW-PILE,2
+ ICALL2 DRAW-PILE,3
+ ICALL2 DRAW-PILE,4
+ CALL1 DRAW-FLOWERS
+ RSTACK
+
+
+ .FUNCT DRAW-SN-BOXES,PILE,X,Y,SPACE,CNT,TBL
+ SET 'CNT,1
+ SCREEN S-WINDOW
+ ICALL2 PICINF-PLUS-ONE,BOX-1-LOC
+ GET PICINF-TBL,0 >Y
+ GET PICINF-TBL,1 >X
+ PICINF SN-BOX-SPACE,PICINF-TBL /?BOGUS1
+?BOGUS1: GET PICINF-TBL,1 >SPACE
+?PRG2: ZERO? PILE \?CCL6
+ GRTR? CNT,4 \?CCL9
+ SET 'TBL,DIM-BOX-TBL
+ JUMP ?CND4
+?CCL9: GET PILE-TABLE,CNT
+ ZERO? STACK \?CCL11
+ SET 'TBL,DIM-BOX-TBL
+ JUMP ?CND4
+?CCL11: SET 'TBL,BOX-TBL
+ JUMP ?CND4
+?CCL6: GET PILE-TABLE,PILE
+ GRTR? CNT,STACK \?CCL13
+ SET 'TBL,DIM-BOX-TBL
+ JUMP ?CND4
+?CCL13: SET 'TBL,BOX-TBL
+?CND4: GET TBL,CNT
+ DISPLAY STACK,Y,X
+ EQUAL? CNT,9 /?REP3
+ ADD X,SPACE >X
+ INC 'CNT
+ JUMP ?PRG2
+?REP3: SCREEN S-TEXT
+ RTRUE
+
+
+ .FUNCT DRAW-PILE,PILE,NUM,PIC,?TMP1
+ SCREEN S-WINDOW
+ GET PILE-TABLE,PILE >NUM
+ EQUAL? PILE,1 \?CCL3
+ PUSH PILE-1-PIC-LOC
+ JUMP ?CND1
+?CCL3: EQUAL? PILE,2 \?CCL5
+ PUSH PILE-2-PIC-LOC
+ JUMP ?CND1
+?CCL5: EQUAL? PILE,3 \?CCL7
+ PUSH PILE-3-PIC-LOC
+ JUMP ?CND1
+?CCL7: PUSH PILE-4-PIC-LOC
+?CND1: ICALL2 PICINF-PLUS-ONE,STACK
+ ZERO? NUM \?CCL10
+ SET 'PIC,PILE-OF-0
+ JUMP ?CND8
+?CCL10: EQUAL? NUM,1 \?CCL12
+ SET 'PIC,PILE-OF-1
+ JUMP ?CND8
+?CCL12: EQUAL? NUM,2 \?CCL14
+ SET 'PIC,PILE-OF-2
+ JUMP ?CND8
+?CCL14: EQUAL? NUM,3 \?CCL16
+ SET 'PIC,PILE-OF-3
+ JUMP ?CND8
+?CCL16: EQUAL? NUM,4 \?CCL18
+ SET 'PIC,PILE-OF-4
+ JUMP ?CND8
+?CCL18: EQUAL? NUM,5 \?CCL20
+ SET 'PIC,PILE-OF-5
+ JUMP ?CND8
+?CCL20: EQUAL? NUM,6 \?CCL22
+ SET 'PIC,PILE-OF-6
+ JUMP ?CND8
+?CCL22: EQUAL? NUM,7 \?CCL24
+ SET 'PIC,PILE-OF-7
+ JUMP ?CND8
+?CCL24: EQUAL? NUM,8 \?CCL26
+ SET 'PIC,PILE-OF-8
+ JUMP ?CND8
+?CCL26: SET 'PIC,PILE-OF-9
+?CND8: GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY PIC,?TMP1,STACK
+ SCREEN S-TEXT
+ RTRUE
+
+
+ .FUNCT DRAW-FLOWERS,PILE,NUM,LEFT,RIGHT,?TMP1,?TMP2,?TMP3,?TMP4
+ SET 'PILE,1
+ SET 'NUM,1
+ CALL2 SAFE-NUMBER?,PILE-TABLE
+ ZERO? STACK /?PRG4
+ SET 'LEFT,L-FLOWERS-0
+ SET 'RIGHT,R-FLOWERS-0
+ JUMP ?CND1
+?PRG4: ADD TEMP-TABLE,2
+ COPYT PILE-TABLE+2,STACK,8
+ GET PILE-TABLE,PILE
+ ZERO? STACK \?CCL8
+ INC 'PILE
+ JUMP ?PRG4
+?CCL8: GET PILE-TABLE,1 >?TMP4
+ GET PILE-TABLE,2
+ ADD ?TMP4,STACK >?TMP3
+ GET PILE-TABLE,3
+ ADD ?TMP3,STACK >?TMP2
+ GET PILE-TABLE,4
+ ADD ?TMP2,STACK >?TMP1
+ GET PILE-TABLE,PILE
+ EQUAL? ?TMP1,STACK \?CCL10
+ GET PILE-TABLE,PILE >NUM
+?REP5: EQUAL? PILE,1 \?CCL18
+ SET 'LEFT,L-FLOWERS-1
+ JUMP ?CND16
+?CCL10: GET TEMP-TABLE,PILE
+ SUB STACK,NUM
+ PUT TEMP-TABLE,PILE,STACK
+ CALL2 SAFE-NUMBER?,TEMP-TABLE
+ ZERO? STACK \?REP5
+ GET PILE-TABLE,PILE
+ SUB STACK,NUM
+ ZERO? STACK \?CCL15
+ SET 'NUM,1
+ INC 'PILE
+ JUMP ?PRG4
+?CCL15: INC 'NUM
+ JUMP ?PRG4
+?CCL18: EQUAL? PILE,2 \?CCL20
+ SET 'LEFT,L-FLOWERS-2
+ JUMP ?CND16
+?CCL20: EQUAL? PILE,3 \?CCL22
+ SET 'LEFT,L-FLOWERS-3
+ JUMP ?CND16
+?CCL22: EQUAL? PILE,4 /?CCL24
+ SET 'LEFT,0
+ JUMP ?CND16
+?CCL24: SET 'LEFT,L-FLOWERS-4
+?CND16: EQUAL? NUM,1 \?CCL27
+ SET 'RIGHT,R-FLOWERS-1
+ JUMP ?CND1
+?CCL27: EQUAL? NUM,2 \?CCL29
+ SET 'RIGHT,R-FLOWERS-2
+ JUMP ?CND1
+?CCL29: EQUAL? NUM,3 \?CCL31
+ SET 'RIGHT,R-FLOWERS-3
+ JUMP ?CND1
+?CCL31: EQUAL? NUM,4 \?CCL33
+ SET 'RIGHT,R-FLOWERS-4
+ JUMP ?CND1
+?CCL33: EQUAL? NUM,5 \?CCL35
+ SET 'RIGHT,R-FLOWERS-5
+ JUMP ?CND1
+?CCL35: EQUAL? NUM,6 \?CCL37
+ SET 'RIGHT,R-FLOWERS-6
+ JUMP ?CND1
+?CCL37: EQUAL? NUM,7 \?CCL39
+ SET 'RIGHT,R-FLOWERS-7
+ JUMP ?CND1
+?CCL39: EQUAL? NUM,8 \?CCL41
+ SET 'RIGHT,R-FLOWERS-8
+ JUMP ?CND1
+?CCL41: EQUAL? NUM,9 /?CCL43
+ SET 'RIGHT,0
+ JUMP ?CND1
+?CCL43: SET 'RIGHT,R-FLOWERS-9
+?CND1: SCREEN S-WINDOW
+ ICALL2 PICINF-PLUS-ONE,L-FLOWERS-PIC-LOC
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY LEFT,?TMP1,STACK
+ ICALL2 PICINF-PLUS-ONE,R-FLOWERS-PIC-LOC
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY RIGHT,?TMP1,STACK
+ SCREEN S-TEXT
+ RTRUE
+
+
+ .FUNCT SNARFEM,X,NUM,PILE,STOP-SN
+?PRG1: ZERO? STOP-SN \TRUE
+ ZERO? PILE /?CCL7
+ CLEAR S-TEXT
+ ZERO? ACTIVE-MOUSE /?CND8
+ ICALL2 DRAW-SN-BOXES,PILE
+?CND8: PRINTI "Type a number "
+ ZERO? ACTIVE-MOUSE /?CND10
+ PRINTI "(or click on one of the numbered boxes with your mouse) "
+?CND10: PRINTI "to indicate how many pebbles you want to remove from Pile #"
+ PRINTN PILE
+ PRINTC 46
+?PRG12: INPUT 'X >X
+ ICALL1 MOUSE-INPUT?
+ EQUAL? X,CLICK1,CLICK2 \?CCL16
+ CALL2 SN-CLICK,TRUE-VALUE >X
+ JUMP ?CND14
+?CCL16: GRTR? X,144 \?CCL18
+ LESS? X,155 \?CCL18
+ SUB X,145 >X
+ JUMP ?CND14
+?CCL18: SUB X,48 >X
+?CND14: GRTR? X,9 /?CTR22
+ LESS? X,1 \?CCL23
+?CTR22: CLEAR S-TEXT
+ PRINT TYPE-A-NUMBER
+ PRINTC 57
+ ZERO? ACTIVE-MOUSE /?CND26
+ PRINTI " (or click on one of the numbered boxes with your mouse)"
+?CND26: PRINTC 46
+ JUMP ?PRG12
+?CCL23: GRTR? X,NUM \?CCL29
+ CLEAR S-TEXT
+ PRINTI "There "
+ EQUAL? NUM,1 \?CCL32
+ PRINTI "is"
+ JUMP ?CND30
+?CCL32: PRINTI "are"
+?CND30: PRINTI " only "
+ PRINTN NUM
+ PRINTI " pebble"
+ EQUAL? NUM,1 /?CND33
+ PRINTC 115
+?CND33: PRINTI " in Pile #"
+ PRINTN PILE
+ PRINTC 46
+ JUMP ?PRG12
+?CCL29: CLEAR S-TEXT
+ PRINTI "You remove "
+ PRINTN X
+ PRINTI " pebble"
+ EQUAL? X,1 /?CND35
+ PRINTC 115
+?CND35: PRINTI " from Pile #"
+ PRINTN PILE
+ PRINTC 46
+ ICALL COUNTDOWN-PILE,PILE,NUM,X
+ ICALL1 DRAW-FLOWERS
+ SET 'PILE,FALSE-VALUE
+ CALL1 END-SN?
+ ZERO? STACK /?CCL39
+ SET 'STOP-SN,TRUE-VALUE
+ FCLEAR FAN,TRYTAKEBIT
+ CRLF
+ CRLF
+ ICALL1 HIT-ANY-KEY
+ JUMP ?PRG1
+?CCL39: CRLF
+ PRINTI " "
+ ICALL1 J-MOVE
+ CALL1 END-SN?
+ ZERO? STACK /?CCL42
+ SET 'STOP-SN,TRUE-VALUE
+ CRLF
+ CRLF
+ ICALL1 HIT-ANY-KEY
+ JUMP ?PRG1
+?CCL42: CRLF
+ PRINTI " "
+ JUMP ?PRG1
+?CCL7: ZERO? ACTIVE-MOUSE /?CND43
+ ICALL1 DRAW-SN-BOXES
+?CND43: PRINTI "Type a number "
+ ZERO? ACTIVE-MOUSE /?CND45
+ PRINTI "(or click on one of the numbered boxes with your mouse) "
+?CND45: PRINTI "to select the pile from which you'd like to remove a pebble or pebbles."
+?PRG47: INPUT 'X >X
+ ICALL1 MOUSE-INPUT?
+ EQUAL? X,CLICK1,CLICK2 \?CCL51
+ CALL1 SN-CLICK >X
+ JUMP ?CND49
+?CCL51: GRTR? X,144 \?CCL53
+ LESS? X,155 \?CCL53
+ SUB X,145 >X
+ JUMP ?CND49
+?CCL53: SUB X,48 >X
+?CND49: GRTR? X,4 /?CTR57
+ LESS? X,1 \?CCL58
+?CTR57: CLEAR S-TEXT
+ PRINT TYPE-A-NUMBER
+ PRINTC 52
+ ZERO? ACTIVE-MOUSE /?CND61
+ PRINTI " (or click on one of the numbered boxes with your mouse)"
+?CND61: PRINTC 46
+ JUMP ?PRG47
+?CCL58: GET PILE-TABLE,X
+ ZERO? STACK \?CCL64
+ CLEAR S-TEXT
+ PRINTI "There are no longer any pebbles in Pile #"
+ PRINTN X
+ PRINTC 46
+ JUMP ?PRG47
+?CCL64: SET 'PILE,X
+ GET PILE-TABLE,PILE >NUM
+ JUMP ?PRG1
+
+
+ .FUNCT SN-CLICK,ALREADY-PICKED-PILE,TL-X,TL-Y,BR-X,BR-Y,BOX-WIDTH,BOX-HEIGHT,CNT,HIT-SPOT
+ SET 'CNT,1
+ PICINF BOX-1,PICINF-TBL /?BOGUS1
+?BOGUS1: GET PICINF-TBL,1 >BOX-WIDTH
+ GET PICINF-TBL,0 >BOX-HEIGHT
+ ICALL2 PICINF-PLUS-ONE,BOX-1-LOC
+ GET PICINF-TBL,1 >TL-X
+ GET PICINF-TBL,0 >TL-Y
+ ADD TL-Y,BOX-HEIGHT >BR-Y
+ PICINF SN-BOX-SPACE,PICINF-TBL /?PRG3
+?PRG3: ADD TL-X,BOX-WIDTH >BR-X
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK /?CCL7
+ SET 'HIT-SPOT,TRUE-VALUE
+?REP4: ZERO? HIT-SPOT /?CCL12
+ RETURN CNT
+?CCL7: EQUAL? CNT,9 /?REP4
+ INC 'CNT
+ GET PICINF-TBL,1
+ ADD TL-X,STACK >TL-X
+ JUMP ?PRG3
+?CCL12: ZERO? ALREADY-PICKED-PILE \FALSE
+ ICALL2 PICINF-PLUS-ONE,PILE-OF-1
+ GET PICINF-TBL,1 >BOX-WIDTH
+ GET PICINF-TBL,0 >BOX-HEIGHT
+ ICALL2 PICINF-PLUS-ONE,PILE-1-PIC-LOC
+ GET PICINF-TBL,1 >TL-X
+ GET PICINF-TBL,0 >TL-Y
+ ADD TL-X,BOX-WIDTH >BR-X
+ ADD TL-Y,BOX-HEIGHT >BR-Y
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK /?CND14
+ SET 'CNT,1
+ SET 'HIT-SPOT,TRUE-VALUE
+?CND14: ZERO? HIT-SPOT \?CND16
+ ICALL2 PICINF-PLUS-ONE,PILE-2-PIC-LOC
+ GET PICINF-TBL,1 >TL-X
+ GET PICINF-TBL,0 >TL-Y
+ ADD TL-X,BOX-WIDTH >BR-X
+ ADD TL-Y,BOX-HEIGHT >BR-Y
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK /?CND16
+ SET 'CNT,2
+ SET 'HIT-SPOT,TRUE-VALUE
+?CND16: ZERO? HIT-SPOT \?CND20
+ ICALL2 PICINF-PLUS-ONE,PILE-3-PIC-LOC
+ GET PICINF-TBL,1 >TL-X
+ GET PICINF-TBL,0 >TL-Y
+ ADD TL-X,BOX-WIDTH >BR-X
+ ADD TL-Y,BOX-HEIGHT >BR-Y
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK /?CND20
+ SET 'CNT,3
+ SET 'HIT-SPOT,TRUE-VALUE
+?CND20: ZERO? HIT-SPOT \?CND24
+ ICALL2 PICINF-PLUS-ONE,PILE-4-PIC-LOC
+ GET PICINF-TBL,1 >TL-X
+ GET PICINF-TBL,0 >TL-Y
+ ADD TL-X,BOX-WIDTH >BR-X
+ ADD TL-Y,BOX-HEIGHT >BR-Y
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK /?CND24
+ SET 'CNT,4
+ SET 'HIT-SPOT,TRUE-VALUE
+?CND24: ZERO? HIT-SPOT /FALSE
+ RETURN CNT
+
+
+ .FUNCT COUNTDOWN-PILE,PILE,NUM,X
+?PRG1: GET PILE-TABLE,PILE
+ SUB STACK,1
+ PUT PILE-TABLE,PILE,STACK
+ ICALL2 DRAW-PILE,PILE
+ DEC 'X
+ ZERO? X \?PRG1
+ RTRUE
+
+
+ .FUNCT SAFE-NUMBER?,TBL,X,?TMP1,?TMP2,?TMP3
+ GET TBL,1
+ GET BINARY-TABLE,STACK >?TMP3
+ GET TBL,2
+ GET BINARY-TABLE,STACK
+ ADD ?TMP3,STACK >?TMP2
+ GET TBL,3
+ GET BINARY-TABLE,STACK
+ ADD ?TMP2,STACK >?TMP1
+ GET TBL,4
+ GET BINARY-TABLE,STACK
+ ADD ?TMP1,STACK >X
+ MOD X,2
+ ZERO? STACK \FALSE
+ DIV X,10
+ MOD STACK,2
+ ZERO? STACK \FALSE
+ DIV X,100
+ MOD STACK,2
+ ZERO? STACK \FALSE
+ DIV X,1000
+ MOD STACK,2
+ ZERO? STACK /TRUE
+ RFALSE
+
+
+ .FUNCT J-MOVE,PILE,NUM,?TMP1,?TMP2,?TMP3,?TMP4
+ SET 'PILE,1
+ SET 'NUM,1
+ PRINTI "The jester peruses the piles, considering his move."
+ CRLF
+ CRLF
+ ICALL1 HIT-ANY-KEY
+ CLEAR S-TEXT
+ CALL2 SAFE-NUMBER?,PILE-TABLE
+ ZERO? STACK /?PRG12
+?PRG4: RANDOM 4 >PILE
+ GET PILE-TABLE,PILE
+ ZERO? STACK \?REP5
+ EQUAL? PILE,4 \?CCL11
+ SET 'PILE,0
+ JUMP ?PRG4
+?CCL11: INC 'PILE
+ JUMP ?PRG4
+?REP5: GET PILE-TABLE,PILE
+ RANDOM STACK >NUM
+ JUMP ?CND1
+?PRG12: COPYT PILE-TABLE+2,TEMP-TABLE+2,8
+ GET PILE-TABLE,PILE
+ ZERO? STACK \?CCL16
+ INC 'PILE
+ JUMP ?PRG12
+?CCL16: GET PILE-TABLE,1 >?TMP4
+ GET PILE-TABLE,2
+ ADD ?TMP4,STACK >?TMP3
+ GET PILE-TABLE,3
+ ADD ?TMP3,STACK >?TMP2
+ GET PILE-TABLE,4
+ ADD ?TMP2,STACK >?TMP1
+ GET PILE-TABLE,PILE
+ EQUAL? ?TMP1,STACK \?CCL18
+ GET PILE-TABLE,PILE >NUM
+?CND1: PRINTI "The jester removes "
+ PRINTN NUM
+ PRINTI " pebble"
+ EQUAL? NUM,1 /?CND24
+ PRINTC 115
+?CND24: PRINTI " from Pile #"
+ PRINTN PILE
+ PRINTC 46
+ GET PILE-TABLE,PILE
+ ICALL COUNTDOWN-PILE,PILE,STACK,NUM
+ CALL1 DRAW-FLOWERS
+ RSTACK
+?CCL18: GET TEMP-TABLE,PILE
+ SUB STACK,NUM
+ PUT TEMP-TABLE,PILE,STACK
+ CALL2 SAFE-NUMBER?,TEMP-TABLE
+ ZERO? STACK \?CND1
+ GET PILE-TABLE,PILE
+ SUB STACK,NUM
+ ZERO? STACK \?CCL23
+ SET 'NUM,1
+ INC 'PILE
+ JUMP ?PRG12
+?CCL23: INC 'NUM
+ JUMP ?PRG12
+
+
+ .FUNCT END-SN?
+ GET PILE-TABLE,1
+ ZERO? STACK \FALSE
+ GET PILE-TABLE,2
+ ZERO? STACK \FALSE
+ GET PILE-TABLE,3
+ ZERO? STACK \FALSE
+ GET PILE-TABLE,4
+ ZERO? STACK /TRUE
+ RFALSE
+
+
+ .FUNCT FAN-F
+ EQUAL? PRSA,V?POINT \FALSE
+ EQUAL? P-PRSA-WORD,W?WAVE \FALSE
+ PRINTR "You produce a light breeze."
+
+ .ENDSEG
+
+ .ENDI
diff --git a/fenshire.zil b/fenshire.zil
new file mode 100644
index 0000000..f75da06
--- /dev/null
+++ b/fenshire.zil
@@ -0,0 +1,1122 @@
+"FENSHIRE for
+
+ ZORK ZERO
+ (c) Copyright 1988 Infocom, Inc. All Rights Reserved."
+
+<BEGIN-SEGMENT FENSHIRE>
+
+;"the dirigible"
+
+<ROOM DIRIGIBLE-HANGAR
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Dirigible Hangar")
+ (LDESC
+"Even after becoming accustomed to the oversized scale of the castle,
+this hangar seems tremendous. The only exit on foot is to the east.")
+ (EAST TO WEST-WING)
+ (OUT TO WEST-WING)
+ (IN PER DIRIGIBLE-ENTER-F)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM HANGAR)
+ (ADJECTIVE DIRIGIBLE LARGE)
+ (MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-1>)
+ (GLOBAL GONDOLA)
+ (ACTION DIRIGIBLE-HANGAR-F)>
+
+<ROUTINE DIRIGIBLE-ENTER-F ("OPTIONAL" (RARG <>)) ;"called by NEXT-ROOM?"
+ <COND (<IN? ,DIRIGIBLE ,HERE>
+ ,GONDOLA)
+ (T
+ <COND (<NOT .RARG>
+ <V-WALK-AROUND>)>
+ <RFALSE>)>>
+
+<ROUTINE DIRIGIBLE-HANGAR-F ("OPT" (RARG <>))
+ <COND (<AND ,DEMO-VERSION? <EQUAL? .RARG ,M-END>>
+ <END-DEMO>)>>
+
+<OBJECT DIRIGIBLE
+ (LOC DIRIGIBLE-HANGAR)
+ (DESC "dirigible")
+ (LDESC
+"A tremendous dirigible is moored here. The gondola is just a few inches
+off the ground.")
+ (SYNONYM DIRIGIBLE)
+ (FLAGS VEHBIT) ;"so GET IN finds the dirigible"
+ (ACTION DIRIGIBLE-F)>
+
+<ROUTINE DIRIGIBLE-F ()
+ <COND (<AND <VERB? THROW-FROM PUT-THROUGH>
+ <PRSI? ,DIRIGIBLE>>
+ <PERFORM-PRSA ,PRSO ,GONDOLA>)
+ (<VERB? EXAMINE>
+ <COND (<EQUAL? ,HERE ,GONDOLA>
+ <V-LOOK>)
+ (T
+ <TELL <GETP ,DIRIGIBLE ,P?LDESC> CR>)>)
+ (<VERB? LOOK-INSIDE>
+ <COND (<EQUAL? ,HERE ,GONDOLA>
+ <TELL ,LOOK-AROUND>)
+ (T
+ <TELL "You can't see much from out here." CR>)>)
+ (<VERB? ENTER>
+ <GOTO ,GONDOLA>)>>
+
+<ROOM GONDOLA
+ (LOC ROOMS)
+ (REGION "Flatheadia")
+ (DESC "Gondola")
+ (OUT PER GONDOLA-EXIT-F)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM GONDOLA)
+ (GLOBAL WINDOW DIRIGIBLE DIRIGIBLE-HANGAR SMALLER-HANGAR)
+ (MAP-LOC ;"not a PTABLE because the info changes during dirigible trip"
+ <TABLE MAIN-MAP-NUM GONDOLA-AT-FLATHEADIA-LOC MAP-GEN-X-1>)
+ (ICON GONDOLA-ICON)
+ (ACTION GONDOLA-F)>
+
+<ROUTINE GONDOLA-F ("OPTIONAL" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"You are in the luxurious gondola of the dirigible. A window wraps completely
+around the gondola. " ,GONDOLA-CONTROLS-DESC>)
+ (.RARG
+ <RFALSE>)
+ (<VERB? EXAMINE>
+ <PERFORM-PRSA ,DIRIGIBLE>)
+ (<AND <VERB? ENTER>
+ <NOT <EQUAL? ,HERE ,GONDOLA>>>
+ <DO-WALK ,P?IN>)
+ (<AND <VERB? LEAP-OFF EXIT>
+ <EQUAL? ,HERE ,GONDOLA>>
+ <DO-WALK ,P?OUT>)
+ (<VERB? LOOK-INSIDE>
+ <PERFORM-PRSA ,DIRIGIBLE>)
+ (<AND <VERB? THROW-FROM PUT-THROUGH>
+ <PRSI? ,GONDOLA ,GLOBAL-HERE>>
+ <COND (<OR <IN? ,DIRIGIBLE ,DIRIGIBLE-HANGAR>
+ <IN? ,DIRIGIBLE ,SMALLER-HANGAR>>
+ <MOVE ,PRSO <LOC ,DIRIGIBLE>>)
+ (T
+ <COND (<OR <PRSO? ,PERCH>
+ <ULTIMATELY-IN? ,PERCH ,PRSO>>
+ <SETG REMOVED-PERCH-LOC ,GROUND>)>
+ <REMOVE ,PRSO>)>
+ <TELL "You fling" T ,PRSO " out of the gondola." CR>)>>
+
+<CONSTANT GONDOLA-CONTROLS-DESC
+"The controls consist of merely two buttons: the left button
+is marked \"Flatheadia\" and the right button is marked \"Fenshire.\"">
+
+<OBJECT GONDOLA-CONTROLS
+ (LOC GONDOLA)
+ (DESC "controls")
+ (SYNONYM CONTROL CONTROLS)
+ (FLAGS NDESCBIT)
+ (ACTION GONDOLA-CONTROLS-F)>
+
+<ROUTINE GONDOLA-CONTROLS-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL ,GONDOLA-CONTROLS-DESC CR>)>>
+
+<OBJECT LEFT-GONDOLA-BUTTON
+ (LOC GONDOLA)
+ (DESC "left button")
+ (SYNONYM BUTTON)
+ (ADJECTIVE LEFT)
+ (FLAGS NDESCBIT)
+ (ACTION GONDOLA-BUTTON-F)>
+
+<OBJECT RIGHT-GONDOLA-BUTTON
+ (LOC GONDOLA)
+ (DESC "right button")
+ (SYNONYM BUTTON)
+ (ADJECTIVE RIGHT)
+ (FLAGS NDESCBIT)
+ (ACTION GONDOLA-BUTTON-F)>
+
+<ROUTINE GONDOLA-BUTTON-F ()
+ <COND (<VERB? PUSH>
+ <COND (<OR ,TIME-STOPPED
+ <FSET? ,OUTER-GATE ,OPENBIT>
+ <G? ,DIRIGIBLE-COUNTER 0>
+ <AND <PRSO? ,LEFT-GONDOLA-BUTTON>
+ <IN? ,DIRIGIBLE ,DIRIGIBLE-HANGAR>>
+ <AND <PRSO? ,RIGHT-GONDOLA-BUTTON>
+ <IN? ,DIRIGIBLE ,SMALLER-HANGAR>>>
+ <TELL ,NOTHING-HAPPENS>)
+ (T
+ <QUEUE I-DIRIGIBLE -1>
+ <SETG DIRIGIBLE-COUNTER 1>
+ <COND (<AND ,BORDER-ON
+ <NOT <EQUAL? <LOWCORE INTID> ,DEC-20>>>
+ <CLEAR-BORDER>
+ <INIT-STATUS-LINE T>)>
+ <TELL
+"The dirigible rises out of the hangar and sails ">
+ <COND (<IN? ,DIRIGIBLE ,DIRIGIBLE-HANGAR>
+ <SETG DESTINATION ,SMALLER-HANGAR>
+ <TELL "ea">)
+ (T
+ <SETG DESTINATION ,DIRIGIBLE-HANGAR>
+ <TELL "we">)>
+ <PUTP ,GONDOLA ,P?REGION "In the Air">
+ <PUT <GETP ,GONDOLA ,P?MAP-LOC> 0 <>>
+ <FSET ,DIRIGIBLE ,NDESCBIT>
+ <MOVE ,DIRIGIBLE ,GONDOLA>
+ <TELL "stward." CR>)>)>>
+
+<ROUTINE GONDOLA-EXIT-F ("OPTIONAL" (RARG <>)) ;"called by NEXT-ROOM?"
+ <COND (<G? ,DIRIGIBLE-COUNTER 0>
+ <COND (.RARG
+ <RFALSE>)
+ (T
+ <JIGS-UP
+"The experience is exhilarating, but you don't have much time to
+enjoy it. Not as much time as you would've had if, for instance,
+you'd worn a parachute.">)>)
+ (T
+ <RETURN <LOC ,DIRIGIBLE>>)>>
+
+<GLOBAL DESTINATION <>>
+
+<GLOBAL DIRIGIBLE-COUNTER 0>
+
+<ROUTINE I-DIRIGIBLE ("AUX" TBL)
+ <COND (<EQUAL? ,HERE ,GONDOLA>
+ <RETURN-FROM-MAP>
+ <TELL " ">)>
+ <COND (<EQUAL? ,DIRIGIBLE-COUNTER 5>
+ <SET TBL <GETP ,GONDOLA ,P?MAP-LOC>>
+ <COND (<EQUAL? ,DESTINATION ,SMALLER-HANGAR>
+ <PUT .TBL 0 ,FENSHIRE-MAP-NUM>
+ <PUT .TBL 1 ,GONDOLA-AT-FENSHIRE-LOC>
+ <PUT .TBL 2 ,MAP-GEN-X-2>
+ <PUTP ,GONDOLA ,P?REGION "Fenshire">)
+ (T
+ <PUT .TBL 0 ,MAIN-MAP-NUM>
+ <PUT .TBL 1 ,GONDOLA-AT-FLATHEADIA-LOC>
+ <PUT .TBL 2 ,MAP-GEN-X-1>
+ <PUTP ,GONDOLA ,P?REGION "Flatheadia">)>
+ <MOVE ,DIRIGIBLE ,DESTINATION>
+ <FCLEAR ,DIRIGIBLE ,NDESCBIT>
+ <DEQUEUE I-DIRIGIBLE>
+ <SETG DIRIGIBLE-COUNTER 0>
+ <COND (<AND ,BORDER-ON
+ <EQUAL? ,HERE ,GONDOLA>
+ <NOT <EQUAL? <LOWCORE INTID> ,DEC-20>>>
+ <CLEAR-BORDER>
+ <SETG CURRENT-BORDER ,CASTLE-BORDER>
+ <SCREEN ,S-FULL>
+ <INIT-STATUS-LINE T>
+ <SCREEN ,S-TEXT>)>
+ <COND (<EQUAL? ,HERE ,GONDOLA>
+ <TELL
+"The dirigible descends into a hangar and comes to a stop.">)
+ (<EQUAL? ,HERE ,DESTINATION>
+ <RETURN-FROM-MAP>
+ <TELL " A dirigible descends into the hangar.">)
+ (T
+ <RFALSE>)>)
+ (<NOT <EQUAL? ,HERE ,GONDOLA>>
+ <SETG DIRIGIBLE-COUNTER <+ ,DIRIGIBLE-COUNTER 1>>
+ <RFALSE>)
+ (T
+ <RETURN-FROM-MAP>
+ <TELL "The dirigible continues to glide along. ">
+ <COND (<EQUAL? ,DESTINATION ,DIRIGIBLE-HANGAR>
+ <TELL
+<GET ,DIRIGIBLE-TRIP-DESCS <- 4 ,DIRIGIBLE-COUNTER>>>)
+ (T
+ <TELL
+<GET ,DIRIGIBLE-TRIP-DESCS <- ,DIRIGIBLE-COUNTER 1>>>)>
+ <SETG DIRIGIBLE-COUNTER <+ ,DIRIGIBLE-COUNTER 1>>)>
+ <CRLF>>
+
+<CONSTANT DIRIGIBLE-TRIP-DESCS
+ <PTABLE
+"It is now passing over a thickly tangled woods, stretching for miles in every
+direction."
+"You are now above the Frigid River. Cliffs crowd the river on both sides. To
+the south, you can just make out the spray of Aragain Falls."
+"The dirigible rises even higher as it crosses the Flathead Mountains. Jagged,
+snow-topped peaks slide by below."
+"Below you are vast square bloits of dismal swampland: the endless marshes of
+Fenshire.">>
+
+;"the summer castle"
+
+<ROOM SMALLER-HANGAR
+ (LOC ROOMS)
+ (REGION "Fenshire")
+ (DESC "Smaller Hangar")
+ (LDESC
+"This hangar, though still large, is smaller than the one in Flatheadia.
+The only exit is south.")
+ (SOUTH TO DESERTED-CASTLE)
+ (IN PER DIRIGIBLE-ENTER-F)
+ (OUT TO DESERTED-CASTLE)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM HANGAR)
+ (ADJECTIVE SMALLER)
+ (GLOBAL GONDOLA)
+ (VALUE 6)
+ (MAP-LOC <PTABLE FENSHIRE-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-2>)
+ (ACTION 0) ;"filled in by SLIDE-SHOW">
+
+<ROUTINE SMALLER-HANGAR-F ("OPT" (RARG <>))
+ <COND (<AND <EQUAL? .RARG ,M-ENTER>
+ <NOT <FSET? ,SMALLER-HANGAR ,TOUCHBIT>>>
+ <QUEUE I-FOX -1>)>>
+
+<ROOM DESERTED-CASTLE
+ (LOC ROOMS)
+ (REGION "Fenshire")
+ (DESC "Deserted Castle")
+ (LDESC
+"The summer palace of the Kings of Quendor now lies in ruins, unoccupied
+and uncared for, forgotten for many years. What's left of the castle can
+be entered to the east, and a hangar lies to the north.")
+ (NORTH TO SMALLER-HANGAR)
+ (EAST TO RUINED-HALL)
+ (FLAGS RLANDBIT ONBIT OUTSIDEBIT)
+ (GLOBAL SMALLER-HANGAR)
+ (MAP-LOC <PTABLE FENSHIRE-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-2>)
+ (ACTION 0) ;"filled in by SLIDE-SHOW">
+
+<ROUTINE DESERTED-CASTLE-F ("OPT" (RARG <>))
+ <COND (<AND <EQUAL? .RARG ,M-ENTER>
+ <NOT <FSET? ,DESERTED-CASTLE ,TOUCHBIT>>>
+ <QUEUE I-ROOSTER -1>)>>
+
+<ROOM RUINED-HALL
+ (LOC ROOMS)
+ (REGION "Fenshire")
+ (DESC "Ruined Hall")
+ (NORTH TO MARSH IF ARCHWAY-OPEN ELSE "That archway has crumbled!")
+ (SOUTH TO HOTHOUSE)
+ (WEST TO DESERTED-CASTLE)
+ (EAST TO SECRET-ROOM IF SECRET-ROOM-REVEALED)
+ (UP SORRY "The stairs have crumbled beyond use.")
+ (FLAGS RLANDBIT ONBIT)
+ (GLOBAL STAIRS)
+ (MAP-LOC <PTABLE FENSHIRE-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-3>)
+ (ICON RUINED-HALL-ICON)
+ (ACTION RUINED-HALL-F)>
+
+<ROUTINE RUINED-HALL-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"The entrance hall of the summer castle retains but a shadow of its former
+elegance; the ceiling has partially collapsed, and myriad weeds grow amongst
+the debris that covers the floor. A fireplace is choked with the rubble of its
+collapsed chimney. Above the fireplace is a faded fresco, and next to that,
+a tiny vase is mounted on the wall. Arched openings lead ">
+ <COND (,ARCHWAY-OPEN
+ <TELL "north, ">)>
+ <TELL "south and west. ">
+ <COND (<NOT ,ARCHWAY-OPEN>
+ <TELL "The archway to the north">
+ <COND (<NOT <IN? ,HEXAGONAL-BLOCK ,LOCAL-GLOBALS>>
+ <SETG ARCHWAY-OPEN T>
+ <TELL
+", which had earlier crumbled, seems restored to its
+former condition: decayed but passable! ">)
+ (T
+ <TELL " has crumbled to rubble. ">)>)>
+ <COND (,SECRET-ROOM-REVEALED
+ <TELL "In addition, a dusty passage leads east. ">)>
+ <TELL
+"A stairway once led upwards, but there's little left of it.">)
+ (<AND <EQUAL? .RARG ,M-END>
+ <NOT ,ARCHWAY-OPEN>
+ <NOT <IN? ,HEXAGONAL-BLOCK ,LOCAL-GLOBALS>>>
+ <SETG ARCHWAY-OPEN T>)>>
+
+<OBJECT FIREPLACE
+ (LOC RUINED-HALL)
+ (DESC "fireplace")
+ (SYNONYM FIREPLACE)
+ (ADJECTIVE CHOKED)
+ (FLAGS NDESCBIT)
+ (ACTION FIREPLACE-F)>
+
+<ROUTINE FIREPLACE-F ()
+ <COND (<VERB? ENTER>
+ <DO-FIRST "clear out all the rubble">)
+ (<VERB? CLEAN>
+ <TELL
+"Not a chance (unless you're actually a team of thirty people,
+in disguise)." CR>)
+ (<VERB? LOOK-INSIDE>
+ <TELL "Rubble. Lots of rubble." CR>)>>
+
+<OBJECT FRESCO
+ (LOC RUINED-HALL)
+ (DESC "fresco")
+ (SYNONYM FRESCO)
+ (ADJECTIVE FADED)
+ (FLAGS NDESCBIT)
+ (ACTION FRESCO-F)>
+
+<ROUTINE FRESCO-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"The fresco depicts the death of Duncanthrax. His spirit is ascending to
+heaven on a tremendous ladder, surrounded by a host of angels." CR>)>>
+
+<OBJECT VASE
+ (LOC RUINED-HALL)
+ (DESC "vase")
+ (SYNONYM VASE)
+ (ADJECTIVE SMALL)
+ (FLAGS NDESCBIT CONTBIT SEARCHBIT OPENBIT TRYTAKEBIT)
+ (ACTION VASE-F)>
+
+<ROUTINE VASE-F ()
+ <COND (<VERB? CLOSE OPEN>
+ <TELL ,HUH>)
+ (<AND <VERB? TAKE>
+ <PRSO? ,VASE>>
+ <TELL "The vase is affixed to the wall." CR>)
+ (<AND <VERB? PUT>
+ <PRSO? ,FLOWER>
+ <NOT ,SECRET-ROOM-REVEALED>>
+ <SETG SECRET-ROOM-REVEALED T>
+ <SETG COMPASS-CHANGED T>
+ <MOVE ,FLOWER ,VASE>
+ <TELL
+"The flower seems to grow fuller, its colors richer. You hear a noise,
+and turn to see a passageway opening to the east!" CR>
+ <INC-SCORE 16>)>>
+
+<GLOBAL SECRET-ROOM-REVEALED <>>
+
+<ROOM SECRET-ROOM
+ (LOC ROOMS)
+ (REGION "Fenshire")
+ (DESC "Secret Room")
+ (LDESC
+"You are the first person to breathe the air of this room in uncounted years.
+The only exit is west.")
+ (WEST TO RUINED-HALL)
+ (OUT TO RUINED-HALL)
+ (FLAGS RLANDBIT)
+ (SYNONYM ROOM)
+ (ADJECTIVE SECRET)
+ (MAP-LOC <PTABLE FENSHIRE-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-4>)
+ (ICON SECRET-ROOM-ICON)>
+
+;<BEGIN-SEGMENT 0>
+
+<OBJECT LADDER
+ (LOC SECRET-ROOM)
+ (DESC "ladder")
+ (FDESC
+"This room was probably intended as a hiding place for the royal family
+in the event of a revolution, and may have once been well-stocked with
+supplies. Now, however, the only item here is a small stepladder.")
+ ;(LDESC "A small stepladder is standing here.")
+ (SYNONYM LADDER STEPLADDER)
+ (ADJECTIVE SMALL)
+ (CAPACITY 20)
+ (SIZE 20)
+ (FLAGS TAKEBIT VEHBIT CONTBIT SEARCHBIT SURFACEBIT)
+ (ACTION LADDER-F)>
+
+<BEGIN-SEGMENT 0>
+
+<ROUTINE LADDER-F ("OPTIONAL" (VARG <>))
+ <COND (.VARG
+ <RFALSE>)
+ (<VERB? OPEN CLOSE EXAMINE>
+ <TELL
+"The stepladder seems to be stuck in the open position." CR>)
+ (<AND <VERB? PUT-UNDER>
+ <PRSO? ,MEGABOZ-TRAP-DOOR>>
+ <TELL "The ladder is now standing beneath the trap door." CR>)
+ (<VERB? STAND-ON CLIMB CLIMB-ON>
+ <PERFORM ,V?ENTER ,LADDER>
+ <RTRUE>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT FENSHIRE>
+
+<GLOBAL ARCHWAY-OPEN T>
+
+<GLOBAL STEPPING-STONES-VISIBLE <>>
+
+<ROOM MARSH
+ (LOC ROOMS)
+ (REGION "Fenshire")
+ (DESC "Marsh")
+ (SOUTH TO RUINED-HALL IF ARCHWAY-OPEN ELSE
+ "The archway has collapsed; that way is now impassable.")
+ (NORTH PER STEPPING-STONES-F)
+ (FLAGS RLANDBIT ONBIT OUTSIDEBIT)
+ (GLOBAL SWAMP ARCH)
+ (ICON MARSH-ICON)
+ (MAP-LOC <PTABLE FENSHIRE-MAP-NUM MAP-GEN-Y-3 MAP-GEN-X-3>)
+ (ACTION MARSH-F)>
+
+<ROUTINE MARSH-F ("OPT" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"The swamps of Fenshire have encroached on this once-beautiful garden. The
+garden wall is now just a pile of mossy stones, and the garden terraces are
+ankle-deep with squishy mud. A c">
+ <COND (,ARCHWAY-OPEN
+ <TELL "rumbling archway leads">)
+ (T
+ <TELL "ollapsed archway blocks the exit to the">)>
+ <TELL " south. To the north">
+ <COND (,STEPPING-STONES-VISIBLE
+ <TELL
+", stepping stones lead across a field of quicksand.">)
+ (T
+ <TELL " is a wide expanse of fetid quicksand.">)>)
+ (<EQUAL? .RARG ,M-END>
+ <COND (<AND <IN? ,JESTER ,HERE>
+ <VISIBLE? ,ROOSTER>
+ <FSET? ,ROOSTER ,ANIMATEDBIT>
+ <VISIBLE? ,FOX>
+ <FSET? ,FOX ,ANIMATEDBIT>
+ <VISIBLE? ,WORM>
+ <FSET? ,WORM ,ANIMATEDBIT>>
+ <MOVE ,JESTER ,NICE-LUNCH-SPOT>
+ <MOVE ,COOKPOT ,NICE-LUNCH-SPOT>
+ <MOVE ,COOKFIRE ,NICE-LUNCH-SPOT>
+ <SETG ARCHWAY-OPEN <>>
+ <SETG STEPPING-STONES-VISIBLE T>
+ <SETG COMPASS-CHANGED T>
+ <FSET ,RUINED-HALL ,REDESCBIT>
+ <RETURN-FROM-MAP>
+ <TELL
+" The jester looks delighted. \"Sacre bleu! At last! All zee ingredients for
+Borphbelly Stew! But zee ambience here eesn't quite right.\" He picks up his
+cookpot AND his cookfire, and dashes across the quicksand to the north, using
+a series of stepping stones which you'd swear weren't there a minute ago. This
+flurry of activity seems to have been too much for the archway behind you; it
+crumbles into a pile of rubble, blocking the exit to the south.|
+ The jester, out of sight amongst the reeds to the north, shouts, \"Yoo hoo!
+I've found a lovely spot for lunch! Bring over zee ingredients!\"" CR>)
+ (<AND <NOT <IN? ,JESTER ,HERE>>
+ <IN? ,HEXAGONAL-BLOCK ,LOCAL-GLOBALS>
+ ,ARCHWAY-OPEN>
+ <DEQUEUE I-JESTER>
+ <THIS-IS-IT ,JESTER>
+ <MOVE ,JESTER ,HERE>
+ <MOVE ,COOKPOT ,HERE>
+ <MOVE ,COOKFIRE ,HERE>
+ <TELL
+" A string of eloquent cursing in a foreign tongue assaults you, and you spy
+the jester " ,COOK-DESC " He is stirring a cookpot which sits upon a roaring
+cookfire. \"Impossible!\" he shrieks, switching to a more familiar language.
+\"Eet is impossible to cook a Borphbelly Stew weethout zee proper ingredients!
+Impossible, impossible, impossible!\"" CR>)>)>>
+
+<ROUTINE STEPPING-STONES-F ("OPTIONAL" (RARG <>)) ;"called by NEXT-ROOM?"
+ <COND (<NOT ,STEPPING-STONES-VISIBLE>
+ <COND (<NOT .RARG>
+ <TELL "You'd be sucked into the quicksand!" CR>)>
+ <RFALSE>)
+ (<G? <CCOUNT ,PROTAGONIST> 1>
+ <COND (<NOT .RARG>
+ <TELL
+"It's difficult to balance on the stepping stones with all you're carrying.
+You try, but after almost falling into the quicksand, you give up." CR>)>
+ <RFALSE>)
+ (<EQUAL? ,HERE ,MARSH>
+ ,NICE-LUNCH-SPOT)
+ (T
+ ,MARSH)>>
+
+<ROOM NICE-LUNCH-SPOT
+ (LOC ROOMS)
+ (REGION "Fenshire")
+ (DESC "Nice Lunch Spot")
+ (LDESC
+"Maybe the jester likes the ambience here, but to you it just looks like
+a slightly drier spot amidst a reedy marsh. The reeds are impassably thick
+in every direction, except to the south where a series of stepping stones
+offers a way to cross a malodorous patch of quicksand.")
+ (SOUTH TO MARSH)
+ (FLAGS RLANDBIT ONBIT OUTSIDEBIT)
+ (MAP-LOC <PTABLE FENSHIRE-MAP-NUM MAP-GEN-Y-2 MAP-GEN-X-3>)
+ (ACTION NICE-LUNCH-SPOT-F)>
+
+<ROUTINE NICE-LUNCH-SPOT-F ("OPT" (RARG <>))
+ <COND (<AND <EQUAL? .RARG ,M-END>
+ <VISIBLE? ,ROOSTER>
+ <FSET? ,ROOSTER ,ANIMATEDBIT>
+ <VISIBLE? ,FOX>
+ <FSET? ,FOX ,ANIMATEDBIT>
+ <VISIBLE? ,WORM>
+ <FSET? ,WORM ,ANIMATEDBIT>>
+ <MOVE ,HEXAGONAL-BLOCK ,SMALLER-HANGAR>
+ <FSET ,SMALLER-HANGAR ,REDESCBIT>
+ <FSET ,RUINED-HALL ,REDESCBIT>
+ <REMOVE ,WORM>
+ <REMOVE ,FOX>
+ <REMOVE ,ROOSTER>
+ <REMOVE ,COOKPOT>
+ <REMOVE ,COOKFIRE>
+ <DEQUEUE I-FOX>
+ <DEQUEUE I-ROOSTER>
+ <RETURN-FROM-MAP>
+ <TELL
+" The jester says, \"Excellent! Zee ingredients for Borphbelly Stew and a "
+D ,HERE " to enjoy eet!\" He tosses the animals into the cookpot, and begins
+dishing out two generous portions of stew. Before you can eat it, a tremendous
+weariness comes over you. The last thing you hear is the jester saying,
+\"Waiter? Check, please!\"|
+|
+You awake from a deep sleep and struggle to your feet. As your head clears
+you realize that you're not where you were when you fell asleep" ,ELLIPSIS>
+ <GOTO ,SMALLER-HANGAR>
+ <INC-SCORE 9>)>>
+
+<BEGIN-SEGMENT 0>
+
+<OBJECT HEXAGONAL-BLOCK
+ (LOC LOCAL-GLOBALS)
+ (DESC "hexagonal block")
+ (SYNONYM BLOCK ROCK)
+ (ADJECTIVE SMALL ELONGATED HEXAGONAL HEXAGON-SHAPED)
+ (FLAGS TAKEBIT)
+ (SIZE 3)
+ (ACTION HEXAGONAL-BLOCK-F)>
+
+<ROUTINE HEXAGONAL-BLOCK-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"It's just a small rock which has been neatly carved into the shape of an
+elongated hexagon." CR>)>>
+
+<END-SEGMENT>
+
+<BEGIN-SEGMENT FENSHIRE>
+
+<ROOM HOTHOUSE
+ (LOC ROOMS)
+ (REGION "Fenshire")
+ (DESC "Hothouse")
+ (LDESC
+"This enclosed arboretum must have been a breathtaking room at one time. Now,
+much of the glass is broken and the foliage has run wild, nearly obscuring the
+exit to the north. Despite the broken glass, it's stiflingly hot in here.")
+ (NORTH TO RUINED-HALL)
+ (OUT TO RUINED-HALL)
+ (FLAGS RLANDBIT ONBIT)
+ (SYNONYM HOTHOUSE GREENHOUSE ARBORETUM)
+ (GLOBAL WINDOW)
+ (MAP-LOC <PTABLE FENSHIRE-MAP-NUM MAP-GEN-Y-5 MAP-GEN-X-3>)
+ (ICON HOTHOUSE-ICON)
+ (ACTION HOTHOUSE-F)>
+
+<ROUTINE HOTHOUSE-F ("OPT" (RARG <>))
+ <COND (<AND <EQUAL? .RARG ,M-ENTER>
+ <FSET? ,FAN ,TRYTAKEBIT>>
+ <QUEUE I-SN 1>)>>
+
+<CONSTANT SN-PICSET-TBL
+ <TABLE BOX-1
+ BOX-2
+ BOX-3
+ BOX-4
+ BOX-5
+ BOX-6
+ BOX-7
+ BOX-8
+ BOX-9
+ DIM-BOX-1
+ DIM-BOX-2
+ DIM-BOX-3
+ DIM-BOX-4
+ DIM-BOX-5
+ DIM-BOX-6
+ DIM-BOX-7
+ DIM-BOX-8
+ DIM-BOX-9
+ PILE-OF-0
+ PILE-OF-1
+ PILE-OF-2
+ PILE-OF-3
+ PILE-OF-4
+ PILE-OF-5
+ PILE-OF-6
+ PILE-OF-7
+ PILE-OF-8
+ PILE-OF-9
+ R-FLOWERS-0
+ R-FLOWERS-1
+ R-FLOWERS-2
+ R-FLOWERS-3
+ R-FLOWERS-4
+ R-FLOWERS-5
+ R-FLOWERS-6
+ R-FLOWERS-7
+ R-FLOWERS-8
+ R-FLOWERS-9
+ L-FLOWERS-0
+ L-FLOWERS-1
+ L-FLOWERS-2
+ L-FLOWERS-3
+ L-FLOWERS-4
+ 0>>
+
+<ROUTINE I-SN ()
+ <COND (<NOT <EQUAL? ,HERE ,HOTHOUSE>>
+ <RFALSE>)
+ (,ALLIGATOR
+ <QUEUE I-SN 1>
+ <RFALSE>)>
+ <RETURN-FROM-MAP>
+ <UPDATE-STATUS-LINE>
+ <TELL
+" The jester steps out from behind some tropical vines, fanning himself with
+a dainty paper fan. \"Hot enough for you? I know just the thing to take your
+mind off this heat! It's one of my favorite games, Snarfem.|
+ \"The rules: I'll produce four piles of pebbles. Each of us, starting with
+you, will remove as many pebbles as we feel like -- as long as they come from
+the same pile. You must take at least one pebble each turn. The player who
+takes the last pebble wins. It's that simple!\"" CR CR>
+ <HIT-ANY-KEY "Snarfem">
+ <SPLIT-BY-PICTURE ,SN-SPLIT T>
+ <ADJUST-TEXT-WINDOW ,SN-BOTTOM>
+ <REPEAT ()
+ ;"All four piles should contain different numbers of pebbles,
+ such as 1-4-5-9 rather than 1-4-4-9. Also, the opening
+ position can't be a 'safe' position, or you can't win."
+ <PUT ,PILE-TABLE 1 <RANDOM 9>>
+ <REPEAT ()
+ <PUT ,PILE-TABLE 2 <RANDOM 9>>
+ <COND (<EQUAL? <GET ,PILE-TABLE 2>
+ <GET ,PILE-TABLE 1>>
+ <PUT ,PILE-TABLE 2 <+ <GET ,PILE-TABLE 2> 1>>
+ <COND (<EQUAL? <GET ,PILE-TABLE 2> 10>
+ <PUT ,PILE-TABLE 2 1>)>)
+ (T
+ <RETURN>)>>
+ <REPEAT ()
+ <PUT ,PILE-TABLE 3 <RANDOM 9>>
+ <COND (<EQUAL? <GET ,PILE-TABLE 3>
+ <GET ,PILE-TABLE 2>
+ <GET ,PILE-TABLE 1>>
+ <PUT ,PILE-TABLE 3 <+ <GET ,PILE-TABLE 3> 1>>
+ <COND (<EQUAL? <GET ,PILE-TABLE 3> 10>
+ <PUT ,PILE-TABLE 3 1>)>)
+ (T
+ <RETURN>)>>
+ <REPEAT ()
+ <PUT ,PILE-TABLE 4 <RANDOM 9>>
+ <COND (<EQUAL? <GET ,PILE-TABLE 4>
+ <GET ,PILE-TABLE 3>
+ <GET ,PILE-TABLE 2>
+ <GET ,PILE-TABLE 1>>
+ <PUT ,PILE-TABLE 4 <+ <GET ,PILE-TABLE 4> 1>>
+ <COND (<EQUAL? <GET ,PILE-TABLE 4> 10>
+ <PUT ,PILE-TABLE 4 1>)>)
+ (T
+ <RETURN>)>>
+ <COND (<NOT <SAFE-NUMBER? ,PILE-TABLE>>
+ <RETURN>)>>
+ <SETUP-SN>
+ <CRLF>
+ <SNARFEM>
+ <INIT-SL-WITH-SPLIT ,TEXT-WINDOW-PIC-LOC>
+ <COND (<FSET? ,FAN ,TRYTAKEBIT>
+ <TELL
+"The jester claps you on the back and says, \"He who wins and
+runs away, returns to let you win another day!\"">
+ <J-EXITS>)
+ (T
+ <MOVE ,FAN ,HERE>
+ <REMOVE-J>
+ <TELL
+"\"You're undoubtedly not a flash in the pan; you've turned me into your
+biggest fan!\" The jester is suddenly wearing a cap and sweater bearing your
+initials, and waving a pennant with your name on it. Still chanting a cheer,
+he vanishes, and you notice a delicate paper fan lying at your feet." CR>
+ <INC-SCORE 12>)>>
+
+<ROUTINE SETUP-SN ()
+ <SCREEN ,S-FULL>
+ <DISPLAY ,SN-BORDER 1 1>
+ <SCREEN ,S-WINDOW>
+ <PICSET ,SN-PICSET-TBL>
+ <DRAW-PILE 1>
+ <DRAW-PILE 2>
+ <DRAW-PILE 3>
+ <DRAW-PILE 4>
+ <DRAW-FLOWERS>>
+
+<ROUTINE DRAW-SN-BOXES ("OPTIONAL" (PILE <>) "AUX" X Y SPACE (CNT 1) TBL)
+ <SCREEN ,S-WINDOW>
+ <PICINF-PLUS-ONE ,BOX-1-LOC>
+ <SET Y <GET ,PICINF-TBL 0>>
+ <SET X <GET ,PICINF-TBL 1>>
+ <PICINF ,SN-BOX-SPACE ,PICINF-TBL>
+ <SET SPACE <GET ,PICINF-TBL 1>>
+ <REPEAT ()
+ <SET TBL <COND (<NOT .PILE>
+ <COND (<G? .CNT 4> ,DIM-BOX-TBL)
+ (<EQUAL? <GET ,PILE-TABLE .CNT> 0>
+ ,DIM-BOX-TBL)
+ (T ,BOX-TBL)>)
+ (<G? .CNT <GET ,PILE-TABLE .PILE>> ,DIM-BOX-TBL)
+ (T ,BOX-TBL)>>
+ <DISPLAY <GET .TBL .CNT> .Y .X>
+ <COND (<EQUAL? .CNT 9>
+ <RETURN>)
+ (T
+ <SET X <+ .X .SPACE>>
+ <SET CNT <+ .CNT 1>>)>>
+ <SCREEN ,S-TEXT>>
+
+<CONSTANT BOX-TBL
+ <PTABLE 0 BOX-1 BOX-2 BOX-3 BOX-4 BOX-5 BOX-6 BOX-7 BOX-8 BOX-9>>
+
+<CONSTANT DIM-BOX-TBL
+ <PTABLE 0 DIM-BOX-1 DIM-BOX-2 DIM-BOX-3 DIM-BOX-4 DIM-BOX-5
+ DIM-BOX-6 DIM-BOX-7 DIM-BOX-8 DIM-BOX-9>>
+
+<CONSTANT PILE-TABLE
+ <TABLE 0 0 0 0 0> ;"first element not used">
+
+<ROUTINE DRAW-PILE (PILE "AUX" NUM PIC)
+ <SCREEN ,S-WINDOW>
+ <SET NUM <GET ,PILE-TABLE .PILE>>
+ <PICINF-PLUS-ONE <COND (<EQUAL? .PILE 1> ,PILE-1-PIC-LOC)
+ (<EQUAL? .PILE 2> ,PILE-2-PIC-LOC)
+ (<EQUAL? .PILE 3> ,PILE-3-PIC-LOC)
+ (T ,PILE-4-PIC-LOC)>>
+ <SET PIC <COND (<EQUAL? .NUM 0> ,PILE-OF-0)
+ (<EQUAL? .NUM 1> ,PILE-OF-1)
+ (<EQUAL? .NUM 2> ,PILE-OF-2)
+ (<EQUAL? .NUM 3> ,PILE-OF-3)
+ (<EQUAL? .NUM 4> ,PILE-OF-4)
+ (<EQUAL? .NUM 5> ,PILE-OF-5)
+ (<EQUAL? .NUM 6> ,PILE-OF-6)
+ (<EQUAL? .NUM 7> ,PILE-OF-7)
+ (<EQUAL? .NUM 8> ,PILE-OF-8)
+ (T ,PILE-OF-9)>>
+ <DISPLAY .PIC <GET ,PICINF-TBL 0> <GET ,PICINF-TBL 1>>
+ <SCREEN ,S-TEXT>>
+
+<ROUTINE DRAW-FLOWERS ("AUX" (PILE 1) (NUM 1) LEFT RIGHT)
+ <COND (<SAFE-NUMBER? ,PILE-TABLE>
+ <SET LEFT ,L-FLOWERS-0>
+ <SET RIGHT ,R-FLOWERS-0>)
+ (T
+ <REPEAT ()
+ <COPYT <REST ,PILE-TABLE 2> <REST ,TEMP-TABLE 2> 8>
+ <COND (<EQUAL? <GET ,PILE-TABLE .PILE> 0>
+ <SET PILE <+ .PILE 1>>)
+ (<EQUAL? <+ <GET ,PILE-TABLE 1> <GET ,PILE-TABLE 2>
+ <GET ,PILE-TABLE 3> <GET ,PILE-TABLE 4>>
+ <GET ,PILE-TABLE .PILE>>
+ ;"case where three piles are empty"
+ <SET NUM <GET ,PILE-TABLE .PILE>>
+ <RETURN>)
+ (T
+ <PUT ,TEMP-TABLE .PILE
+ <- <GET ,TEMP-TABLE .PILE> .NUM>>
+ <COND (<SAFE-NUMBER? ,TEMP-TABLE>
+ <RETURN>)
+ (<EQUAL? <- <GET ,PILE-TABLE .PILE> .NUM> 0>
+ <SET NUM 1>
+ <SET PILE <+ .PILE 1>>)
+ (T
+ <SET NUM <+ .NUM 1>>)>)>>
+ <SET LEFT <COND (<EQUAL? .PILE 1> ,L-FLOWERS-1)
+ (<EQUAL? .PILE 2> ,L-FLOWERS-2)
+ (<EQUAL? .PILE 3> ,L-FLOWERS-3)
+ (<EQUAL? .PILE 4> ,L-FLOWERS-4)>>
+ <SET RIGHT <COND (<EQUAL? .NUM 1> ,R-FLOWERS-1)
+ (<EQUAL? .NUM 2> ,R-FLOWERS-2)
+ (<EQUAL? .NUM 3> ,R-FLOWERS-3)
+ (<EQUAL? .NUM 4> ,R-FLOWERS-4)
+ (<EQUAL? .NUM 5> ,R-FLOWERS-5)
+ (<EQUAL? .NUM 6> ,R-FLOWERS-6)
+ (<EQUAL? .NUM 7> ,R-FLOWERS-7)
+ (<EQUAL? .NUM 8> ,R-FLOWERS-8)
+ (<EQUAL? .NUM 9> ,R-FLOWERS-9)>>)>
+ <SCREEN ,S-WINDOW>
+ <PICINF-PLUS-ONE ,L-FLOWERS-PIC-LOC>
+ <DISPLAY .LEFT <GET ,PICINF-TBL 0> <GET ,PICINF-TBL 1>>
+ <PICINF-PLUS-ONE ,R-FLOWERS-PIC-LOC>
+ <DISPLAY .RIGHT <GET ,PICINF-TBL 0> <GET ,PICINF-TBL 1>>
+ <SCREEN ,S-TEXT>>
+
+<ROUTINE SNARFEM ("AUX" X NUM (PILE <>) (STOP-SN <>))
+ <REPEAT ()
+ <COND (.STOP-SN
+ <RETURN>)
+ (.PILE
+ <CLEAR ,S-TEXT>
+ <COND (,ACTIVE-MOUSE
+ <DRAW-SN-BOXES .PILE>)>
+ <TELL "Type a number ">
+ <COND (,ACTIVE-MOUSE
+ <TELL
+"(or click on one of the numbered boxes with your mouse) ">)>
+ <TELL
+"to indicate how many pebbles you want to remove from Pile #" N .PILE ".">
+ <REPEAT ()
+ <SET X <INPUT X>>
+ <MOUSE-INPUT?>
+ <COND (<EQUAL? .X ,CLICK1 ,CLICK2>
+ <SET X <SN-CLICK T>>)
+ (<AND <G? .X 144>
+ <L? .X 155>>
+ ;"numeric keypad, 0=145, 1=146, etc."
+ <SET .X <- .X 145>>)
+ (T
+ ;"normal # keys, 1 = 49, 2 = 50, etc."
+ <SET X <- .X 48>>)>
+ <COND (<OR <G? .X 9>
+ <L? .X 1>>
+ <CLEAR ,S-TEXT>
+ <TELL ,TYPE-A-NUMBER "9">
+ <COND (,ACTIVE-MOUSE
+ <TELL
+" (or click on one of the numbered boxes with your mouse)">)>
+ <TELL ".">)
+ (<G? .X .NUM>
+ <CLEAR ,S-TEXT>
+ <TELL "There ">
+ <COND (<EQUAL? .NUM 1>
+ <TELL "is">)
+ (T
+ <TELL "are">)>
+ <TELL " only " N .NUM " pebble">
+ <COND (<NOT <EQUAL? .NUM 1>>
+ <TELL "s">)>
+ <TELL " in Pile #" N .PILE ".">)
+ (T
+ <CLEAR ,S-TEXT>
+ <TELL "You remove " N .X " pebble">
+ <COND (<NOT <EQUAL? .X 1>>
+ <TELL "s">)>
+ <TELL " from Pile #" N .PILE ".">
+ <COUNTDOWN-PILE .PILE .NUM .X>
+ <DRAW-FLOWERS>
+ <SET PILE <>>
+ <COND (<END-SN?>
+ <SET STOP-SN T>
+ <FCLEAR ,FAN ,TRYTAKEBIT>
+ <CRLF> <CRLF>
+ <HIT-ANY-KEY>
+ <RETURN>)
+ (T
+ <TELL CR " ">)>
+ <J-MOVE>
+ <COND (<END-SN?>
+ <SET STOP-SN T>
+ <CRLF> <CRLF>
+ <HIT-ANY-KEY>)
+ (T
+ <TELL CR " ">)>
+ <RETURN>)>>)
+ (T
+ <COND (,ACTIVE-MOUSE
+ <DRAW-SN-BOXES>)>
+ <TELL "Type a number ">
+ <COND (,ACTIVE-MOUSE
+ <TELL
+"(or click on one of the numbered boxes with your mouse) ">)>
+ <TELL
+"to select the pile from which you'd like to remove a pebble or pebbles.">
+ <REPEAT ()
+ <SET X <INPUT X>>
+ <MOUSE-INPUT?>
+ <COND (<EQUAL? .X ,CLICK1 ,CLICK2>
+ <SET X <SN-CLICK>>)
+ (<AND <G? .X 144>
+ <L? .X 155>>
+ ;"numeric keypad, 0=145, 1=146, etc."
+ <SET .X <- .X 145>>)
+ (T
+ ;"normal # keys, 1 = 49, 2 = 50, etc."
+ <SET X <- .X 48>>)>
+ <COND (<OR <G? .X 4>
+ <L? .X 1>>
+ <CLEAR ,S-TEXT>
+ <TELL ,TYPE-A-NUMBER "4">
+ <COND (,ACTIVE-MOUSE
+ <TELL
+" (or click on one of the numbered boxes with your mouse)">)>
+ <TELL ".">)
+ (<EQUAL? <GET ,PILE-TABLE .X> 0>
+ <CLEAR ,S-TEXT>
+ <TELL
+"There are no longer any pebbles in Pile #" N .X ".">)
+ (T
+ <SET PILE .X>
+ <SET NUM <GET ,PILE-TABLE .PILE>>
+ <RETURN>)>>)>>>
+
+<ROUTINE SN-CLICK ("OPT" (ALREADY-PICKED-PILE <>)
+ "AUX" TL-X TL-Y BR-X BR-Y BOX-WIDTH BOX-HEIGHT (CNT 1) (HIT-SPOT <>))
+ <PICINF ,BOX-1 ,PICINF-TBL>
+ <SET BOX-WIDTH <GET ,PICINF-TBL 1>>
+ <SET BOX-HEIGHT <GET ,PICINF-TBL 0>>
+ <PICINF-PLUS-ONE ,BOX-1-LOC>
+ <SET TL-X <GET ,PICINF-TBL 1>>
+ <SET TL-Y <GET ,PICINF-TBL 0>>
+ <SET BR-Y <+ .TL-Y .BOX-HEIGHT>>
+ <PICINF ,SN-BOX-SPACE ,PICINF-TBL>
+ <REPEAT ()
+ <SET BR-X <+ .TL-X .BOX-WIDTH>>
+ <COND (<WITHIN? .TL-X .TL-Y .BR-X .BR-Y>
+ <SET HIT-SPOT T>
+ <RETURN>)
+ (<EQUAL? .CNT 9>
+ <RETURN>)
+ (T
+ <SET CNT <+ .CNT 1>>
+ <SET TL-X <+ .TL-X <GET ,PICINF-TBL 1>>>)>>
+ <COND (.HIT-SPOT
+ <RETURN .CNT>)
+ (.ALREADY-PICKED-PILE
+ <RFALSE>)>
+ <PICINF-PLUS-ONE ,PILE-OF-1>
+ <SET BOX-WIDTH <GET ,PICINF-TBL 1>>
+ <SET BOX-HEIGHT <GET ,PICINF-TBL 0>>
+ <PICINF-PLUS-ONE ,PILE-1-PIC-LOC>
+ <SET TL-X <GET ,PICINF-TBL 1>>
+ <SET TL-Y <GET ,PICINF-TBL 0>>
+ <SET BR-X <+ .TL-X .BOX-WIDTH>>
+ <SET BR-Y <+ .TL-Y .BOX-HEIGHT>>
+ <COND (<WITHIN? .TL-X .TL-Y .BR-X .BR-Y>
+ <SET CNT 1>
+ <SET HIT-SPOT T>)>
+ <COND (<NOT .HIT-SPOT>
+ <PICINF-PLUS-ONE ,PILE-2-PIC-LOC>
+ <SET TL-X <GET ,PICINF-TBL 1>>
+ <SET TL-Y <GET ,PICINF-TBL 0>>
+ <SET BR-X <+ .TL-X .BOX-WIDTH>>
+ <SET BR-Y <+ .TL-Y .BOX-HEIGHT>>
+ <COND (<WITHIN? .TL-X .TL-Y .BR-X .BR-Y>
+ <SET CNT 2>
+ <SET HIT-SPOT T>)>)>
+ <COND (<NOT .HIT-SPOT>
+ <PICINF-PLUS-ONE ,PILE-3-PIC-LOC>
+ <SET TL-X <GET ,PICINF-TBL 1>>
+ <SET TL-Y <GET ,PICINF-TBL 0>>
+ <SET BR-X <+ .TL-X .BOX-WIDTH>>
+ <SET BR-Y <+ .TL-Y .BOX-HEIGHT>>
+ <COND (<WITHIN? .TL-X .TL-Y .BR-X .BR-Y>
+ <SET CNT 3>
+ <SET HIT-SPOT T>)>)>
+ <COND (<NOT .HIT-SPOT>
+ <PICINF-PLUS-ONE ,PILE-4-PIC-LOC>
+ <SET TL-X <GET ,PICINF-TBL 1>>
+ <SET TL-Y <GET ,PICINF-TBL 0>>
+ <SET BR-X <+ .TL-X .BOX-WIDTH>>
+ <SET BR-Y <+ .TL-Y .BOX-HEIGHT>>
+ <COND (<WITHIN? .TL-X .TL-Y .BR-X .BR-Y>
+ <SET CNT 4>
+ <SET HIT-SPOT T>)>)>
+ <COND (.HIT-SPOT
+ <RETURN .CNT>)
+ (T
+ <RFALSE>)>>
+
+<ROUTINE COUNTDOWN-PILE (PILE NUM X)
+ <REPEAT ()
+ <PUT ,PILE-TABLE .PILE <- <GET ,PILE-TABLE .PILE> 1>>
+ <DRAW-PILE .PILE>
+ <SET X <- .X 1>>
+ <COND (<EQUAL? .X 0>
+ <RETURN>)>>>
+
+<CONSTANT BINARY-TABLE
+ <PTABLE 0 1 10 11 100 101 110 111 1000 1001>>
+
+<ROUTINE SAFE-NUMBER? (TBL "AUX" X)
+ <SET X <+ <GET ,BINARY-TABLE <GET .TBL 1>>
+ <GET ,BINARY-TABLE <GET .TBL 2>>
+ <GET ,BINARY-TABLE <GET .TBL 3>>
+ <GET ,BINARY-TABLE <GET .TBL 4>>>>
+ <COND (<AND <EQUAL? <MOD .X 2> 0>
+ <EQUAL? <MOD </ .X 10> 2> 0>
+ <EQUAL? <MOD </ .X 100> 2> 0>
+ <EQUAL? <MOD </ .X 1000> 2> 0>>
+ <RTRUE>)
+ (T
+ <RFALSE>)>>
+
+<CONSTANT TEMP-TABLE
+ <TABLE 0 0 0 0 0>>
+
+<ROUTINE J-MOVE ("AUX" (PILE 1) (NUM 1))
+ <TELL "The jester peruses the piles, considering his move." CR CR>
+ <HIT-ANY-KEY>
+ <CLEAR ,S-TEXT>
+ <COND (<SAFE-NUMBER? ,PILE-TABLE>
+ <REPEAT () ;"pick a random pile, but make sure it isn't empty"
+ <SET PILE <RANDOM 4>>
+ <COND (<EQUAL? <GET ,PILE-TABLE .PILE> 0>
+ <COND (<EQUAL? .PILE 4>
+ <SET PILE 0>)
+ (T
+ <SET PILE <+ .PILE 1>>)>)
+ (T
+ <RETURN>)>>
+ ;"now take a random number of pebbles between 1 and all of 'em"
+ <SET NUM <RANDOM <GET ,PILE-TABLE .PILE>>>)
+ (T
+ <REPEAT ()
+ <COPYT <REST ,PILE-TABLE 2> <REST ,TEMP-TABLE 2> 8>
+ <COND (<EQUAL? <GET ,PILE-TABLE .PILE> 0>
+ <SET PILE <+ .PILE 1>>)
+ (<EQUAL? <+ <GET ,PILE-TABLE 1> <GET ,PILE-TABLE 2>
+ <GET ,PILE-TABLE 3> <GET ,PILE-TABLE 4>>
+ <GET ,PILE-TABLE .PILE>>
+ ;"case where three piles are empty"
+ <SET NUM <GET ,PILE-TABLE .PILE>>
+ <RETURN>)
+ (T
+ <PUT ,TEMP-TABLE .PILE
+ <- <GET ,TEMP-TABLE .PILE> .NUM>>
+ <COND (<SAFE-NUMBER? ,TEMP-TABLE>
+ <RETURN>)
+ (<EQUAL? <- <GET ,PILE-TABLE .PILE> .NUM> 0>
+ <SET NUM 1>
+ <SET PILE <+ .PILE 1>>)
+ (T
+ <SET NUM <+ .NUM 1>>)>)>>)>
+ <TELL "The jester removes " N .NUM " pebble">
+ <COND (<NOT <EQUAL? .NUM 1>>
+ <TELL "s">)>
+ <TELL " from Pile #" N .PILE ".">
+ <COUNTDOWN-PILE .PILE <GET ,PILE-TABLE .PILE> .NUM>
+ <DRAW-FLOWERS>>
+
+<ROUTINE END-SN? ()
+ <COND (<AND <EQUAL? <GET ,PILE-TABLE 1> 0>
+ <EQUAL? <GET ,PILE-TABLE 2> 0>
+ <EQUAL? <GET ,PILE-TABLE 3> 0>
+ <EQUAL? <GET ,PILE-TABLE 4> 0>>
+ <RTRUE>)
+ (T
+ <RFALSE>)>>
+
+<OBJECT FAN
+ (DESC "fan")
+ (SYNONYM FAN)
+ (ADJECTIVE DELICATE DAINTY PAPER)
+ (FLAGS TAKEBIT TRYTAKEBIT MAGICBIT)
+ (VALUE 0) ;"12 points given elsewhere"
+ (ACTION FAN-F)>
+
+<ROUTINE FAN-F ()
+ <COND (<AND <VERB? POINT>
+ <EQUAL? ,P-PRSA-WORD ,W?WAVE>>
+ <TELL "You produce a light breeze." CR>)>>
+
+<END-SEGMENT>
diff --git a/find.zap b/find.zap
new file mode 100644
index 0000000..84487f1
--- /dev/null
+++ b/find.zap
@@ -0,0 +1,499 @@
+
+ .SEGMENT "0"
+
+
+ .FUNCT FIND-DESCENDANTS,PARENT,FLAGS,F,FOBJ
+ SET 'F,FINDER
+ EQUAL? PARENT,GLOBAL-HERE \?CND1
+ SET 'PARENT,HERE
+?CND1: FIRST? PARENT >FOBJ \TRUE
+?PRG6: CALL2 VISIBLE?,FOBJ
+ ZERO? STACK /?CND8
+ BTST FLAGS,8 /?CND10
+ BTST FLAGS,1 \?PRF16
+ PUSH 1
+ JUMP ?PEN14
+?PRF16: PUSH 0
+?PEN14: CALL MATCH-OBJECT,FOBJ,F,STACK
+ ZERO? STACK /FALSE
+?CND10: BTST FLAGS,4 \?CND8
+ FIRST? FOBJ \?CND8
+ EQUAL? FOBJ,WINNER /?CND8
+ FSET? FOBJ,SEARCHBIT \?PRD24
+ FSET? FOBJ,OPENBIT /?CCL18
+ FSET? FOBJ,TRANSBIT /?CCL18
+?PRD24: FSET? FOBJ,SURFACEBIT \?CND8
+?CCL18: BTST FLAGS,1 \?CCL33
+ PUSH 5
+ JUMP ?CND31
+?CCL33: PUSH 4
+?CND31: CALL FIND-DESCENDANTS,FOBJ,STACK
+ ZERO? STACK /FALSE
+?CND8: NEXT? FOBJ >FOBJ /?PRG6
+ RTRUE
+
+
+ .FUNCT EXCLUDED?,FOBJ,F,EXC,PHRASE,CT,VEC,VV
+ GET F,8 >EXC
+ ZERO? EXC /FALSE
+ GET EXC,3 >PHRASE
+ GET PHRASE,1 >CT
+ ADD PHRASE,6 >VEC
+?PRG6: DLESS? 'CT,0 \?CND8
+ SET 'VV,FALSE-VALUE
+ JUMP ?REP7
+?CND8: GET VEC,0
+ EQUAL? FOBJ,STACK \?CND10
+ SET 'VV,TRUE-VALUE
+?REP7: ZERO? VV \TRUE
+ GET EXC,1 >EXC
+ ZERO? EXC /FALSE
+ GET EXC,3 >PHRASE
+ GET PHRASE,1 >CT
+ ADD PHRASE,6 >VEC
+ JUMP ?PRG6
+?CND10: ADD VEC,4 >VEC
+ JUMP ?PRG6
+
+
+ .FUNCT MATCH-OBJECT,FOBJ,F,INCLUDE?,NOUN,ADJS,APP,TB,RES,?TMP1
+ GET F,9 >RES
+ FSET? FOBJ,INVISIBLE /TRUE
+ GET F,6 >NOUN
+ EQUAL? NOUN,FALSE-VALUE,W?ONE /?PRD6
+ GETPT FOBJ,P?SYNONYM >TB
+ ZERO? TB /TRUE
+ PTSIZE TB
+ DIV STACK,2
+ INTBL? NOUN,TB,STACK \TRUE
+?PRD6: GET F,7 >ADJS
+ ZERO? ADJS /?PRD11
+ CALL CHECK-ADJS,FOBJ,F,ADJS
+ ZERO? STACK /TRUE
+?PRD11: GET F,5 >ADJS
+ ZERO? ADJS /?PRD14
+ CALL CHECK-ADJS,FOBJ,F,ADJS
+ ZERO? STACK /TRUE
+?PRD14: CALL EXCLUDED?,FOBJ,F
+ ZERO? STACK \TRUE
+ GET F,1
+ BTST STACK,1 /?CTR2
+ CALL2 INVALID-OBJECT?,FOBJ
+ ZERO? STACK \TRUE
+?CTR2: ZERO? INCLUDE? /TRUE
+ GET F,5 >ADJS
+ ZERO? ADJS /?CCL24
+ GET ADJS,4 >?TMP1
+ GETPT FOBJ,P?ADJECTIVE
+ PTSIZE STACK
+ DIV STACK,2
+ EQUAL? ?TMP1,STACK \?CCL24
+ PUT RES,1,1
+ PUT RES,2,FALSE-VALUE
+ PUT RES,4,FOBJ
+ EQUAL? FOBJ,HERE \FALSE
+ PUT RES,4,GLOBAL-HERE
+ RFALSE
+?CCL24: GET F,0 >APP
+ ZERO? APP /?CCL31
+ GET F,1
+ BTST STACK,1 /?CCL31
+ GET RES,1
+ ZERO? STACK /?CTR35
+ GET F,2
+ ZERO? STACK /?CCL36
+?CTR35: CALL ADD-OBJECT,FOBJ,F
+ RSTACK
+?CCL36: CALL TEST-OBJECT,FOBJ,APP,F
+ ZERO? STACK /FALSE
+ GET RES,1
+ EQUAL? STACK,1 \?CCL43
+ GET RES,4
+ CALL TEST-OBJECT,STACK,APP,F
+ ZERO? STACK \?CCL46
+ PUT RES,4,FOBJ
+ EQUAL? FOBJ,HERE \TRUE
+ PUT RES,4,GLOBAL-HERE
+ RTRUE
+?CCL46: CALL ADD-OBJECT,FOBJ,F
+ RSTACK
+?CCL43: CALL ADD-OBJECT,FOBJ,F
+ RSTACK
+?CCL31: ZERO? APP \?CCL50
+ GET F,1
+ BTST STACK,1 \?CTR52
+ GET F,2
+ ZERO? STACK /TRUE
+?CTR52: CALL ADD-OBJECT,FOBJ,F
+ RSTACK
+?CCL50: CALL TEST-OBJECT,FOBJ,APP,F
+ ZERO? STACK /TRUE
+ CALL ADD-OBJECT,FOBJ,F
+ RSTACK
+
+
+ .FUNCT TEST-OBJECT,FOBJ,APP,F,N,NN,?TMP1
+ BAND APP,65280
+ ZERO? STACK \?CCL3
+ BTST APP,128 \?CCL6
+ BAND APP,63
+ FSET? FOBJ,STACK /FALSE
+ RTRUE
+?CCL6: FSET? FOBJ,APP /TRUE
+ RFALSE
+?CCL3: GET APP,1
+ BTST STACK,256 \?CND12
+ GET APP,1
+ BAND STACK,63
+ GETP FOBJ,STACK >?TMP1
+ GET APP,2
+ EQUAL? ?TMP1,STACK /TRUE
+ RFALSE
+?CND12: GET APP,0 >N
+?PRG17: GET APP,N >NN
+ BTST NN,128 \?CCL21
+ BAND NN,63
+ FSET? FOBJ,STACK /?CND19
+ RTRUE
+?CCL21: FSET? FOBJ,NN /TRUE
+?CND19: DLESS? 'N,1 \?PRG17
+ RFALSE
+
+
+ .FUNCT ADD-OBJECT,OBJ,F,VEC,NC,DOIT?,SYN,WHICH,?TMP1
+ GET F,9 >VEC
+ SET 'DOIT?,TRUE-VALUE
+ GET F,3 >SYN
+ GET F,4 >WHICH
+ EQUAL? OBJ,HERE \?CND1
+ SET 'OBJ,GLOBAL-HERE
+?CND1: GET F,2
+ ZERO? STACK \?CND3
+ ZERO? SYN /?CND3
+ GET VEC,1
+ EQUAL? 1,STACK \?CND3
+ CALL MULTIPLE-EXCEPTION?,OBJ,SYN,WHICH,F
+ ZERO? STACK /?CCL10
+ SET 'DOIT?,FALSE-VALUE
+ JUMP ?CND3
+?CCL10: GET VEC,4
+ CALL MULTIPLE-EXCEPTION?,STACK,SYN,WHICH,F
+ ZERO? STACK /?CND3
+ PUT VEC,4,OBJ
+ SET 'DOIT?,FALSE-VALUE
+?CND3: ZERO? DOIT? /TRUE
+ GET F,2
+ ZERO? STACK /?PRD17
+ GET F,3
+ ZERO? STACK /?PRD17
+ GET F,3 >?TMP1
+ GET F,4
+ CALL MULTIPLE-EXCEPTION?,OBJ,?TMP1,STACK,F
+ ZERO? STACK \TRUE
+?PRD17: CALL NOT-IN-FIND-RES?,OBJ,VEC >WHICH
+ ZERO? WHICH /TRUE
+ GET VEC,1
+ ADD 1,STACK
+ PUT VEC,1,STACK
+ PUT WHICH,0,OBJ
+ GET F,2
+ EQUAL? STACK,NP-QUANT-A /FALSE
+ RTRUE
+
+
+ .FUNCT NOT-IN-FIND-RES?,OBJ,VEC,NO-CHANGE?,CT,SZ,ANS,NVEC,NEW-OBJECT
+ GET VEC,1 >CT
+ GET VEC,0 >SZ
+?PRG1: ADD VEC,8 >ANS
+ LESS? CT,1 \?CCL5
+ RETURN ANS
+?CCL5: GRTR? CT,SZ \?CCL7
+ SUB CT,SZ >CT
+ JUMP ?CND3
+?CCL7: SET 'SZ,CT
+?CND3: INTBL? OBJ,ANS,SZ /FALSE
+ GET VEC,2 >NVEC
+ ZERO? NVEC /?CCL12
+ SET 'VEC,NVEC
+ SET 'SZ,FIND-RES-MAXOBJ
+ JUMP ?PRG1
+?CCL12: LESS? SZ,FIND-RES-MAXOBJ \?CCL14
+ MUL 2,SZ
+ ADD ANS,STACK
+ RSTACK
+?CCL14: ZERO? NO-CHANGE? \TRUE
+ SET 'SZ,FIND-RES-MAXOBJ
+ CALL DO-PMEM-ALLOC,7,9 >NEW-OBJECT
+ SET 'NVEC,NEW-OBJECT
+ PUT VEC,2,NVEC
+ ADD NVEC,8
+ RSTACK
+
+
+ .FUNCT EVERYWHERE-VERB?,WHICH,SYNTAX,SYN
+ ASSIGNED? 'WHICH /?CND1
+ GET FINDER,4 >WHICH
+?CND1: ASSIGNED? 'SYNTAX /?CND3
+ GET PARSE-RESULT,3 >SYNTAX
+?CND3: EQUAL? WHICH,1 \?CCL7
+ GETB SYNTAX,5 >SYN
+ JUMP ?CND5
+?CCL7: GETB SYNTAX,9 >SYN
+?CND5: BTST SYN,128 \FALSE
+ BTST SYN,64 \TRUE
+ RFALSE
+
+
+ .FUNCT MULTIPLE-EXCEPTION?,OBJ,SYNTAX,WHICH,F,L,VB
+ LOC OBJ >L
+ GET SYNTAX,0 >VB
+ EQUAL? OBJ,FALSE-VALUE,ROOMS \?CCL3
+ INC 'P-NOT-HERE
+ RTRUE
+?CCL3: CALL EVERYWHERE-VERB?,WHICH,SYNTAX
+ ZERO? STACK \?CCL5
+ CALL2 ACCESSIBLE?,OBJ
+ ZERO? STACK /TRUE
+?CCL5: EQUAL? VB,V?TAKE \?CCL9
+ GET F,6
+ ZERO? STACK \?CCL9
+ EQUAL? WHICH,1 \?CCL9
+ FSET? OBJ,TAKEBIT /?CCL15
+ FSET? OBJ,TRYTAKEBIT \TRUE
+?CCL15: EQUAL? L,WINNER /TRUE
+ RFALSE
+?CCL9: EQUAL? VB,V?DROP \FALSE
+ IN? OBJ,WINNER \TRUE
+ RFALSE
+
+
+ .FUNCT CHECK-ADJS,OBJ,F,ADJS,CNT,TMP,OWNER,ID,VEC,CT,ADJ,FL,OADJS,NUM,?TMP1
+ GETP OBJ,P?OWNER >OWNER
+ GETB ADJS,1
+ EQUAL? STACK,2 /?CCL2
+ GET ADJS,2 >TMP
+ ZERO? TMP /?CND1
+?CCL2: SET 'ID,OWNER
+ LESS? 0,ID \?CCL7
+ SET 'ID,OWNER
+ GRTR? ID,LAST-OBJECT /?CCL7
+ EQUAL? OWNER,TMP,OBJ /?CND1
+ EQUAL? OWNER,ROOMS \?CCL14
+ GET OWNER-SR-HERE,4 >ID
+ JUMP ?CND1
+?CCL14: GET OWNER-SR-THERE,1 >TMP
+ ZERO? TMP /FALSE
+ INTBL? OWNER,OWNER-SR-THERE+8,TMP /?CND1
+ RFALSE
+?CCL7: ZERO? OWNER /?CCL19
+ GET OWNER-SR-HERE,1 >CNT
+ ZERO? CNT \?CCL22
+ SET 'ID,PLAYER
+ JUMP ?CND1
+?CCL22: ADD OWNER,2 >TMP
+ SET 'VEC,OWNER-SR-HERE+8
+?PRG24: DLESS? 'CNT,0 /FALSE
+ GET VEC,0 >?TMP1
+ GET OWNER,0
+ INTBL? ?TMP1,TMP,STACK >ID \?CCL30
+ GET ID,0 >ID
+ JUMP ?CND1
+?CCL30: ADD VEC,2 >VEC
+ JUMP ?PRG24
+?CCL19: LESS? 0,TMP \?CCL32
+ GRTR? TMP,LAST-OBJECT /?CCL32
+ CALL HELD?,OBJ,TMP
+ ZERO? STACK \?CND1
+ RFALSE
+?CCL32: GET OWNER-SR-HERE,1 >TMP
+ ZERO? TMP /FALSE
+ LOC OBJ
+ INTBL? STACK,OWNER-SR-HERE+8,TMP >ID \FALSE
+?CND1: EQUAL? ID,0,OBJ /?CND41
+ GET F,9
+ PUT STACK,3,ID
+?CND41: GETB ADJS,1
+ EQUAL? STACK,2 /TRUE
+ ADD ADJS,10 >VEC
+ GET ADJS,4 >CT
+ GETPT OBJ,P?ADJECTIVE >OADJS
+ PTSIZE OADJS
+ DIV STACK,2 >NUM
+?PRG45: DLESS? 'CT,0 /TRUE
+ GET VEC,CT >ADJ
+ SET 'ID,ADJ
+ EQUAL? ADJ,W?NO.WORD /?PRG45
+ INTBL? ID,OADJS,NUM /?PRG45
+ EQUAL? ID,W?CLOSED,W?SHUT \?CCL54
+ FSET? OBJ,OPENBIT \?PRG45
+?CCL54: EQUAL? ID,W?OPEN \FALSE
+ FSET? OBJ,OPENBIT /?PRG45
+ RFALSE
+
+
+ .FUNCT FIND-OBJECTS,SEARCH,PARENT,GLBS,CONT?,N,RES,NEW-OBJECT,LOSING?,FLAG,?PR-FLAG,O,OBJ
+ ASSIGNED? 'SEARCH /?CND1
+ GET FINDER,4
+ EQUAL? 1,STACK \?CCL5
+ GET PARSE-RESULT,3
+ GETB STACK,5 >SEARCH
+ JUMP ?CND1
+?CCL5: GET PARSE-RESULT,3
+ GETB STACK,9 >SEARCH
+?CND1: SET 'CONT?,TRUE-VALUE
+ GET FINDER,9 >RES
+ PUT RES,1,0
+ PUT RES,2,FALSE-VALUE
+ ZERO? PARENT /?CCL8
+ CALL FIND-DESCENDANTS,PARENT,7
+ ZERO? STACK /?CND6
+ GET RES,1
+ ZERO? STACK \?CND6
+?CCL8: ZERO? PARENT /?CND13
+ GET FINDER,5 >GLBS
+ ZERO? GLBS \?CND15
+ CALL DO-PMEM-ALLOC,1,8 >NEW-OBJECT
+ SET 'GLBS,NEW-OBJECT
+ PUT FINDER,5,GLBS
+?CND15: GET GLBS,2
+ ZERO? STACK \?CND13
+ PUT GLBS,2,PARENT
+?CND13: BTST SEARCH,128 \?CND19
+ BTST SEARCH,64 /?CND19
+ FIRST? GENERIC-OBJECTS \?CND19
+ FIRST? GENERIC-OBJECTS >NEW-OBJECT /?PRG25
+?PRG25: CALL MATCH-OBJECT,NEW-OBJECT,FINDER,TRUE-VALUE
+ ZERO? STACK /?REP26
+ NEXT? NEW-OBJECT >NEW-OBJECT /?PRG25
+?REP26: GET RES,1 >CONT?
+ ZERO? CONT? /?CND19
+ EQUAL? CONT?,1 /TRUE
+ RFALSE
+?CND19: SET 'LOSING?,FALSE-VALUE
+?PRG35: ZERO? LOSING? \?PRD40
+ BAND SEARCH,12
+ ZERO? STACK \?CCL38
+?PRD40: ZERO? LOSING? /?CND37
+?CCL38: ZERO? LOSING? \?CTR44
+ BTST SEARCH,8 \?CCL45
+?CTR44: SET '?PR-FLAG,6
+ JUMP ?CND43
+?CCL45: SET '?PR-FLAG,2
+?CND43: ZERO? LOSING? \?CTR49
+ BAND SEARCH,12
+ ZERO? STACK /?CCL50
+?CTR49: BOR 1,?PR-FLAG >FLAG
+ JUMP ?CND48
+?CCL50: BAND ?PR-FLAG,-2 >FLAG
+?CND48: ZERO? LOSING? \?CCL55
+ BTST SEARCH,4 /?CCL55
+ BOR 8,FLAG
+ JUMP ?CND53
+?CCL55: BAND FLAG,-9
+?CND53: CALL FIND-DESCENDANTS,WINNER,STACK >CONT?
+?CND37: ZERO? LOSING? \?CCL59
+ BAND SEARCH,3
+ ZERO? STACK /?CND58
+?CCL59: ZERO? LOSING? \?CTR63
+ BAND SEARCH,3
+ ZERO? STACK /?CCL64
+?CTR63: SET '?PR-FLAG,3
+ JUMP ?CND62
+?CCL64: SET '?PR-FLAG,2
+?CND62: ZERO? LOSING? \?CTR69
+ BTST SEARCH,2 \?CCL70
+?CTR69: BOR 4,?PR-FLAG >FLAG
+ JUMP ?CND68
+?CCL70: BAND ?PR-FLAG,-5 >FLAG
+?CND68: ZERO? LOSING? \?CCL75
+ BTST SEARCH,1 /?CCL75
+ BOR 8,FLAG
+ JUMP ?CND73
+?CCL75: BAND FLAG,-9
+?CND73: CALL FIND-DESCENDANTS,HERE,STACK >CONT?
+?CND58: GET RES,1
+ ZERO? STACK \?CND6
+ BTST SEARCH,15 /?CND78
+ ZERO? LOSING? \?CND78
+ GET TLEXV,0 >GLBS
+ ZERO? GLBS /?CCL86
+ GETB GLBS,8
+ BTST STACK,128 /?CCL93
+ GETB GLBS,8
+ JUMP ?CND91
+?CCL93: GETB GLBS,8
+ BAND STACK,127
+ SHIFT STACK,7
+?CND91: ZERO? STACK \?CTR85
+ GET GLBS,3
+ ZERO? STACK /?CCL86
+?CTR85: SET 'LOSING?,TRUE-VALUE
+ JUMP ?PRG35
+?CCL86: BTST SEARCH,64 \?CND78
+ BTST SEARCH,128 \FALSE
+?CND78: GETPT HERE,P?GLOBAL >GLBS
+ ZERO? GLBS /?CND97
+ PTSIZE GLBS
+ DIV STACK,2 >N
+?PRG100: DLESS? 'N,0 /?CND97
+ GET GLBS,N >O
+ CALL MATCH-OBJECT,O,FINDER,TRUE-VALUE >CONT?
+ ZERO? CONT? /?CND97
+ FIRST? O \?PRG100
+ CALL SEARCH-IN-LG?,O
+ ZERO? STACK /?PRG100
+ BTST SEARCH,2 \?PRG100
+ CALL FIND-DESCENDANTS,O,FD-INCLUDE? >CONT?
+ ZERO? CONT? \?PRG100
+?CND97: ZERO? CONT? /?CND114
+ CALL1 EXCLUDE-HERE-OBJECT?
+ ZERO? STACK \?CND114
+ CALL MATCH-OBJECT,HERE,FINDER,TRUE-VALUE >CONT?
+?CND114: ZERO? CONT? /?CND118
+ GETP HERE,P?THINGS
+ ZERO? STACK /?CND118
+ CALL TEST-THINGS,HERE,FINDER >CONT?
+?CND118: GET RES,1
+ ZERO? STACK /?CND122
+ SET 'CONT?,FALSE-VALUE
+?CND122: ZERO? CONT? /?CND124
+ BTST SEARCH,2 \?CCL128
+ PUSH 5
+ JUMP ?CND126
+?CCL128: PUSH 1
+?CND126: CALL FIND-DESCENDANTS,GLOBAL-OBJECTS,STACK >CONT?
+?CND124: ZERO? CONT? /?CND129
+ GET RES,1
+ ZERO? STACK \?CND129
+ GETP HERE,P?ADJACENT >GLBS
+ ZERO? GLBS /?CND129
+ GETB GLBS,0 >N
+ BAND SEARCH,-193 >O
+?PRG134: GETB GLBS,N
+ ZERO? STACK /?CCL138
+ DEC 'N
+ GETB GLBS,N
+ ICALL FIND-OBJECTS,O,STACK
+ JUMP ?CND136
+?CCL138: DEC 'N
+?CND136: DLESS? 'N,1 \?PRG134
+ GET RES,1
+ ZERO? STACK /?CND129
+ SET 'CONT?,FALSE-VALUE
+?CND129: ZERO? CONT? /?CND6
+ GET RES,1
+ ZERO? STACK \?CND6
+ CALL MOBY-FIND?,SEARCH
+ ZERO? STACK /?CND6
+ SET 'OBJ,1
+?PRG148: FSET? OBJ,INVISIBLE /?CND150
+ CALL MATCH-OBJECT,OBJ,FINDER,TRUE-VALUE
+ ZERO? STACK /?CND6
+?CND150: IGRTR? 'OBJ,LAST-OBJECT \?PRG148
+?CND6: GET RES,1
+ EQUAL? STACK,1 /TRUE
+ RFALSE
+
+ .ENDSEG
+
+ .ENDI
diff --git a/find.zil b/find.zil
new file mode 100644
index 0000000..665629c
--- /dev/null
+++ b/find.zil
@@ -0,0 +1,555 @@
+"FIND file for NEW PARSER
+Copyright (C) 1988 Infocom, Inc. All rights reserved."
+
+<ZZSECTION "FIND">
+
+<INCLUDE "BASEDEFS" "PDEFS" "PBITDEFS">
+
+<USE "NEWSTRUC" "PARSER" "PMEM">
+
+<FILE-FLAGS MDL-ZIL? CLEAN-STACK? ;ZAP-TO-SOURCE-DIRECTORY?>
+
+<BEGIN-SEGMENT 0>
+
+<PUT-DECL BOOLEAN '<OR ATOM FALSE>>
+
+<DEFMAC FD-FLAG (WHICH 'VAL "OPT" 'NEW)
+ <COND (<ASSIGNED? NEW>
+ <COND (<OR <TYPE? .NEW ATOM FALSE>
+ <AND <TYPE? .NEW FORM>
+ <EMPTY? .NEW>>>
+ <COND (<TYPE? .NEW ATOM>
+ ;"Just turning flag on"
+ <FORM ORB ,.WHICH .VAL>)
+ (T
+ <FORM ANDB .VAL <XORB ,.WHICH -1>>)>)
+ (<TYPE? .VAL FIX LVAL GVAL>
+ <FORM COND
+ (.NEW
+ <FORM ORB .VAL ,.WHICH>)
+ (T
+ <FORM ANDB .VAL <XORB ,.WHICH -1>>)>)
+ (T
+ <FORM BIND ((FLAG .VAL))
+ <FORM COND
+ (.NEW
+ <FORM ORB ,.WHICH '.FLAG>)
+ (T
+ <FORM ANDB '.FLAG <XORB ,.WHICH -1>>)>>)>)
+ (T
+ <FORM NOT <FORM 0? <FORM ANDB .VAL ,.WHICH>>>)>>
+
+<MSETG FIND-FLAGS-GWIM 1>
+<DEFMAC FIND-GWIM? ('F)
+ <FORM NOT <FORM 0? <FORM ANDB <FORM FIND-FLAGS .F> ,FIND-FLAGS-GWIM>>>>
+
+<CONSTANT FINDER <MAKE-FINDER>>
+<GLOBAL P-NOT-HERE:NUMBER ;BYTE 0>
+
+"FIND-DESCENDANTS, MATCH-OBJECT, and ADD-OBJECT all return false when the
+ search should be stopped prematurely because some object was an exact
+ match. If there's a big red book and a big ugly red book, BIG RED BOOK
+ will get the former, since it's the only way to do so."
+
+<DEFINE FIND-DESCENDANTS FD
+ (PARENT:OBJECT FLAGS:FIX ;"INCLUDE, SEARCH, NEST, NOTOP"
+ "AUX" (F ,FINDER) FOBJ:<OR FALSE OBJECT>)
+ <COND (<EQUAL? .PARENT ,GLOBAL-HERE>
+ <SET PARENT ,HERE>)>
+ <COND (<SET FOBJ <FIRST? .PARENT>>
+ ;"This guy contains something"
+ <REPEAT ()
+ ;"See if the current object matches: if so, add it to the list"
+ <COND
+ (<VISIBLE? .FOBJ>
+ <COND (<AND <NOT <FD-FLAG FD-NOTOP? .FLAGS> ;<BTST .FLAGS 8>>
+ <NOT <MATCH-OBJECT .FOBJ .F
+ <FD-FLAG FD-INCLUDE? .FLAGS>
+ ;<BTST .FLAGS 1>>>>
+ <RETURN <> .FD>)>
+ <COND (<AND <FD-FLAG FD-NEST? .FLAGS> ;<BTST .FLAGS 4>
+ <FIRST? .FOBJ>
+ <N==? .FOBJ ,WINNER>
+ <OR ;,P-MOBY-FLAG
+ <AND <FSET? .FOBJ ,SEARCHBIT>
+ <OR <FSET? .FOBJ ,OPENBIT>
+ <FSET? .FOBJ ,TRANSBIT>>>
+ <FSET? .FOBJ ,SURFACEBIT>>>
+ ;"Check its contents"
+ <COND (<NOT <FIND-DESCENDANTS .FOBJ
+ <FD-FLAG FD-INCLUDE? ,FD-NEST?
+ <FD-FLAG FD-INCLUDE? .FLAGS>>
+ ;<COND (<BTST .FLAGS 1> 5) (T 4)>>>
+ <RETURN <> .FD>)>)>)>
+ ;"Check next sibling"
+ <COND (<NOT <SET FOBJ <NEXT? .FOBJ>>>
+ <RETURN T .FD>)>>)
+ (T)>>
+
+<DEFINE EXCLUDED? EX (FOBJ:OBJECT F:FINDER
+ "AUX" (EXC:<OR FALSE PMEM> <FIND-EXCEPTIONS .F>))
+ <COND (.EXC
+ <REPEAT ((PHRASE:PMEM <NPP-NOUN-PHRASE .EXC>)
+ (CT:FIX <NOUN-PHRASE-COUNT .PHRASE>)
+ (VEC <REST-TO-SLOT .PHRASE NOUN-PHRASE-OBJ1>) VV)
+ <REPEAT ()
+ <COND (<L? <SET CT <- .CT 1>> 0>
+ <SET VV <>>
+ <RETURN>)>
+ <COND (<==? .FOBJ <ZGET .VEC 0>>
+ <SET VV T>
+ <RETURN>)>
+ <SET VEC <ZREST .VEC 4 ;2>>>
+ <COND (.VV
+ <RETURN T .EX>)
+ (<SET EXC <NPP-NEXT .EXC>>
+ <SET PHRASE <NPP-NOUN-PHRASE .EXC>>
+ <SET CT <NOUN-PHRASE-COUNT .PHRASE>>
+ <SET VEC <REST-TO-SLOT .PHRASE NOUN-PHRASE-OBJ1>>)
+ (T
+ <RETURN <> .EX>)>>)>>
+
+<DEFINE MATCH-OBJECT (FOBJ:OBJECT F:FINDER INCLUDE?:BOOLEAN
+ "AUX" NOUN ADJS APP TB (RES <FIND-RES .F>))
+ <COND (<AND <NOT <FSET? .FOBJ ,INVISIBLE>>
+ <OR <EQUAL? <SET NOUN <FIND-NOUN .F>> <> ,W?ONE>
+ <AND <SET TB <GETPT .FOBJ ,P?SYNONYM>>
+ <ZMEMQ .NOUN .TB </ <PTSIZE .TB>:FIX 2>>>>
+ <OR <NOT <SET ADJS <FIND-OF .F>>>
+ <CHECK-ADJS .FOBJ .F .ADJS>>
+ <OR <NOT <SET ADJS <FIND-ADJS .F>>>
+ <CHECK-ADJS .FOBJ .F .ADJS>>
+ <NOT <EXCLUDED? .FOBJ .F>>
+ <OR <FIND-GWIM? .F>
+ <NOT <INVALID-OBJECT? .FOBJ>>>>
+ ;"This object matches the words used..."
+ <COND (<NOT .INCLUDE?> ;"location didn't match the syntax bits"
+ T)
+ (<AND <T? <SET ADJS <FIND-ADJS .F>>>
+ <EQUAL? <ADJS-COUNT .ADJS>
+ <COND (T ;<CHECK-EXTENDED?>
+ </ <PTSIZE <GETPT .FOBJ ,P?ADJECTIVE>> 2>)
+ ;(T <- <PTSIZE <GETPT .FOBJ ,P?ADJECTIVE>> 1>)>>>
+ ;"the only way to do so."
+ <FIND-RES-COUNT .RES 1>
+ <FIND-RES-NEXT .RES <>>
+ <FIND-RES-OBJ1 .RES .FOBJ>
+ <COND (<EQUAL? .FOBJ ,HERE>
+ <FIND-RES-OBJ1 .RES ,GLOBAL-HERE>)>
+ <>)
+ (<AND <T? <SET APP <FIND-APPLIC .F>>>
+ <NOT <FIND-GWIM? .F>>>
+ ;"We're not GWIMming, so apply the test only if there's an
+ ambiguity"
+ <COND (<OR <0? <FIND-RES-COUNT .RES>>
+ <FIND-QUANT .F>>
+ ;"Don't have anything yet"
+ <ADD-OBJECT .FOBJ .F>)
+ (<TEST-OBJECT .FOBJ .APP .F>
+ ;"We already have something, so first find out if
+ this one's OK"
+ <COND (<1? <FIND-RES-COUNT .RES>>
+ ;"There's only one other object"
+ <COND (<NOT <TEST-OBJECT
+ <FIND-RES-OBJ1 .RES>
+ .APP .F>>
+ ;"The other object doesn't match, so just
+ replace it"
+ <FIND-RES-OBJ1 .RES .FOBJ>
+ <COND (<EQUAL? .FOBJ ,HERE>
+ <FIND-RES-OBJ1 .RES ,GLOBAL-HERE>)>
+ T)
+ (T
+ ;"The other object also matches, so
+ we're stuck"
+ <ADD-OBJECT .FOBJ .F>)>)
+ (T
+ ;"We already have more than one object, so
+ we're losing"
+ <ADD-OBJECT .FOBJ .F>)>)>)
+ (<F? .APP>
+ <COND (<OR <NOT <FIND-GWIM? .F>>
+ <FIND-QUANT .F>> ;"DETERMINE-OBJ w/ PICK"
+ <ADD-OBJECT .FOBJ .F>)
+ (T)>)
+ (<TEST-OBJECT .FOBJ .APP .F>
+ <ADD-OBJECT .FOBJ .F>)
+ (T)>)
+ (T)>>
+
+<MSETG SYN-FIND-PROP *400*> ;"If set, look for this property"
+
+<DEFINE TEST-OBJECT TO (FOBJ:OBJECT APP:<OR FIX TABLE> F:FINDER)
+ <COND (<NOT <TABLE? .APP>>
+ <COND (<NOT <0? <ANDB .APP ,SYN-FIND-NEGATE>>>
+ <NOT <FSET? .FOBJ <ANDB .APP *77*>>>)
+ (T
+ <FSET? .FOBJ .APP>)>)
+ (T
+ <COND (<NOT <0? <ANDB <ZGET .APP 1> ,SYN-FIND-PROP>>>
+ <COND (<EQUAL? <GETP .FOBJ <ANDB <ZGET .APP 1> *77*>>
+ <ZGET .APP 2>>
+ <RETURN T .TO>)
+ (T <RETURN <> .TO>)>)>
+ <REPEAT ((N:FIX <ZGET .APP 0>) NN)
+ <SET NN <ZGET .APP .N>>
+ <COND (<NOT <0? <ANDB .NN ,SYN-FIND-NEGATE>>>
+ <COND (<NOT <FSET? .FOBJ <ANDB .NN *77*>>>
+ <RETURN T .TO>)>)
+ (<FSET? .FOBJ .NN>
+ <RETURN T .TO>)>
+ <COND (<L? <SET N <- .N 1>> 1>
+ <RETURN <> .TO>)>>)>>
+
+"Object matches all other tests. Here do checks with quantities
+ (all, one, etc.), then add if OK."
+<DEFINE ADD-OBJECT (OBJ:OBJECT F:FINDER "AUX" (VEC <FIND-RES .F>) NC
+ (DOIT? T) (SYN <FIND-SYNTAX .F>) (WHICH <FIND-WHICH .F>))
+ <COND (<EQUAL? .OBJ ,HERE>
+ <SET OBJ ,GLOBAL-HERE>)> ;"per PDL 29-Apr-88"
+ <COND (<AND <NOT <FIND-QUANT .F>>
+ .SYN
+ <==? 1 <FIND-RES-COUNT .VEC>:FIX>>
+ <COND (<MULTIPLE-EXCEPTION? .OBJ .SYN .WHICH .F>
+ <SET DOIT? <>>)
+ (<MULTIPLE-EXCEPTION? <FIND-RES-OBJ1 .VEC> .SYN .WHICH .F>
+ <FIND-RES-OBJ1 .VEC .OBJ>
+ <SET DOIT? <>>)>)>
+ <COND (<AND .DOIT?
+ <OR <NOT <FIND-QUANT .F>>
+ <NOT <FIND-SYNTAX .F>>
+ <NOT <MULTIPLE-EXCEPTION? .OBJ ;"wrong theory of ALL?"
+ <FIND-SYNTAX .F>
+ <FIND-WHICH .F>
+ .F>>>
+ ;"In case an object gets found twice..."
+ <SET WHICH <NOT-IN-FIND-RES? .OBJ .VEC>>>
+ <FIND-RES-COUNT .VEC ;<SET NC > <+ 1 <FIND-RES-COUNT .VEC>>>
+ <COND ;(<AND <IN? <SET NC <META-LOC .OBJ>> ,ROOMS>
+ <NOT <EQUAL? .NC <META-LOC ,WINNER>>>>
+ <ZPUT .WHICH 0 <- 0 .OBJ>>) ;"adjacent room"
+ (T
+ <ZPUT .WHICH 0 .OBJ>)>
+ ;<COND (<L=? .NC <FIND-RES-SIZE .VEC>>
+ <ZPUT <REST-TO-SLOT .VEC FIND-RES-OBJ1>
+ <- .NC 1>
+ .OBJ>)>
+ <N==? <FIND-QUANT .F> ,NP-QUANT-A>)
+ (T)>>
+
+<DEFINE NOT-IN-FIND-RES? ACT (OBJ VEC "OPT" (NO-CHANGE? <>))
+ <REPEAT ((CT <FIND-RES-COUNT .VEC>)
+ (SZ <FIND-RES-SIZE .VEC>) ANS NVEC)
+ <SET ANS <REST-TO-SLOT .VEC FIND-RES-OBJ1>>
+ <COND (<L? .CT 1>
+ <RETURN .ANS .ACT>)
+ (<G? .CT .SZ>
+ <SET CT <- .CT .SZ>>)
+ (T <SET SZ .CT>)>
+ <COND (<INTBL? .OBJ .ANS .SZ>
+ <RETURN <> .ACT>)
+ (<T? <SET NVEC <FIND-RES-NEXT .VEC>>>
+ <SET VEC .NVEC>
+ <SET SZ ,FIND-RES-MAXOBJ ;<OBJLIST-SIZE .VEC>>)
+ (<L? .SZ ,FIND-RES-MAXOBJ ;<FIND-RES-SIZE .VEC>>
+ <RETURN <ZREST .ANS <* 2 .SZ>> .ACT>)
+ (<T? .NO-CHANGE?>
+ <RETURN T .ACT>)
+ (T
+ <SET SZ ,FIND-RES-MAXOBJ ;<FIND-RES-SIZE .VEC>>
+ <SET NVEC <PMEM-ALLOC OBJLIST
+ ;"SIZE .SZ"
+ LENGTH <- ,FIND-RES-LENGTH 1>>>
+ <FIND-RES-NEXT .VEC .NVEC>
+ <RETURN <REST-TO-SLOT .NVEC FIND-RES-OBJ1> .ACT>)>>>
+
+"EVERYWHERE-VERB? -- separately defined so game can call it"
+
+<DEFINE EVERYWHERE-VERB? ("OPT" (WHICH <FIND-WHICH ,FINDER>)
+ (SYNTAX <PARSE-SYNTAX ,PARSE-RESULT>)
+ "AUX" SYN)
+ <COND (<==? .WHICH 1>
+ <SET SYN <SYNTAX-SEARCH .SYNTAX 1>>)
+ (T
+ <SET SYN <SYNTAX-SEARCH .SYNTAX 2>>)>
+ <COND (<AND <ANDB ,SEARCH-MOBY .SYN>
+ <NOT <ANDB ,SEARCH-MUST-HAVE .SYN>>>
+ T)>>
+
+"MULTIPLE-EXCEPTION? -- return true if an object found by ALL should not
+be include when the crunch comes."
+
+<DEFINE MULTIPLE-EXCEPTION? (OBJ:OBJECT SYNTAX:VERB-SYNTAX WHICH:FIX F:FINDER
+ "AUX" (L <LOC .OBJ>) (VB <SYNTAX-ID .SYNTAX>))
+ <COND (<EQUAL? .OBJ <> ,ROOMS ;,NOT-HERE-OBJECT>
+ <SETG P-NOT-HERE <+ 1 ,P-NOT-HERE>>
+ T)
+ (<AND <0? <EVERYWHERE-VERB? .WHICH .SYNTAX>>
+ <NOT <ACCESSIBLE? .OBJ>>>
+ T)
+ (<AND <==? .VB ,V?TAKE>
+ <ZERO? <FIND-NOUN .F>>
+ <1? .WHICH>>
+ <COND (<AND <NOT <FSET? .OBJ ,TAKEBIT>>
+ <NOT <FSET? .OBJ ,TRYTAKEBIT>>>
+ T)
+ (<EQUAL? .L ,WINNER>
+ ;<AND <NOT <EQUAL? .L ,WINNER <LOC ,WINNER> ,HERE>>
+ <NOT <FSET? .L ,SURFACEBIT>>
+ <NOT <FSET? .L ,SEARCHBIT>>>
+ T)>)
+ (<==? .VB ,V?DROP>
+ <COND (<NOT <IN? .OBJ ,WINNER>>
+ T)>)
+ ;(<AND ,PRSI
+ <==? ,PRSO ,PRSI>>
+ ;"VERB ALL and prso = prsi"
+ <RTRUE>)
+ ;(<AND <==? .VB ,V?PUT>
+ <NOT <IN? .OBJ ,WINNER>>
+ <HELD? ,PRSO ,PRSI>>
+ ;"PUT ALL IN X and object already in x"
+ <RTRUE>)>>
+
+<ADD-WORD OPEN ADJ>
+<ADD-WORD CLOSED ADJ>
+<ADD-WORD SHUT ADJ>
+
+<DEFINE CHECK-ADJS CA (OBJ:OBJECT F ADJS:PMEM
+ "AUX" CNT (TMP <>) OWNER (ID <>) VEC)
+ <SET OWNER <GETP .OBJ ,P?OWNER>>
+ <COND (<OR <PMEM-TYPE? .ADJS NP> ;"it's NP-OF"
+ <SET TMP <ADJS-POSS .ADJS>>>
+ <COND (<OBJECT? <SET ID .OWNER>>
+ <COND (<EQUAL? .OWNER .TMP .OBJ>
+ T)
+ (<EQUAL? .OWNER ,ROOMS ;"any">
+ <SET ID <FIND-RES-OBJ1 ,OWNER-SR-HERE>> ;"real owner")
+ (<ZERO? <SET TMP <FIND-RES-COUNT ,OWNER-SR-THERE>>>
+ <RETURN <> .CA>)
+ (<NOT <INTBL? .OWNER
+ <REST-TO-SLOT ,OWNER-SR-THERE FIND-RES-OBJ1>
+ .TMP>>
+ <RETURN <> .CA>)>)
+ (<T? .OWNER> ;"table for multiple owners (body parts)"
+ ;<SET ID <>>
+ <COND (<AND ;<ZERO? .ID>
+ <ZERO? <SET CNT <FIND-RES-COUNT ,OWNER-SR-HERE>>>
+ ;<SET ID <INTBL? ,PLAYER .TMP <ZGET .OWNER 0>>>>
+ <SET ID ,PLAYER> ;"default owner of body part"
+ ;<SET ID <ZGET .ID 0>>)
+ (T
+ <SET TMP <ZREST .OWNER 2>>
+ <SET VEC <REST-TO-SLOT ,OWNER-SR-HERE FIND-RES-OBJ1>>
+ <REPEAT ()
+ <COND (<DLESS? CNT 0>
+ <RETURN <> .CA>)
+ (<SET ID
+ <INTBL? <ZGET .VEC 0> .TMP <ZGET .OWNER 0>>>
+ <SET ID <ZGET .ID 0>>
+ <RETURN>)
+ (T <SET VEC <ZREST .VEC 2>>)>>)>)
+ (<OBJECT? .TMP> ;"possession"
+ <COND (<NOT <HELD? .OBJ .TMP>>
+ <RETURN <> .CA>)>)
+ (T ;"possession"
+ <COND (<ZERO? <SET TMP <FIND-RES-COUNT ,OWNER-SR-HERE>>>
+ <RETURN <> .CA>)
+ (<NOT <SET ID <INTBL? <LOC .OBJ>
+ <REST-TO-SLOT ,OWNER-SR-HERE FIND-RES-OBJ1>
+ .TMP>>>
+ <RETURN <> .CA>)
+ ;(T <SET ID <ZGET .ID 0>>)>)>)>
+ <COND (<NOT <EQUAL? .ID 0 .OBJ>> ;<T? .ID>
+ <FIND-RES-OWNER <FIND-RES .F> .ID>)>
+ <COND (<NOT <PMEM-TYPE? .ADJS NP>>
+ <SET VEC <REST-TO-SLOT .ADJS ADJS-COUNT 1>>
+ <REPEAT ((CT <ADJS-COUNT .ADJS>) ADJ FL
+ (OADJS <GETPT .OBJ ,P?ADJECTIVE>)
+ (NUM </ <PTSIZE .OADJS>:FIX 2>))
+ <COND (<L? <SET CT <- .CT 1>> 0>
+ <RETURN>)>
+ <COND
+ (T ;<CHECK-EXTENDED?>
+ <SET ADJ <ZGET .VEC .CT>>
+ <SET ID .ADJ>)
+ ;(T
+ <COND (<0? <SET ID <WORD-ADJ-ID <SET ADJ <ZGET .VEC .CT>>>>>
+ <COND (<NOT <IF-MUDDLE <COND (<GASSIGNED? SPECIAL-ADJ-CHECK>
+ <SPECIAL-ADJ-CHECK .ADJ .OBJ>)>
+ <SPECIAL-ADJ-CHECK .ADJ .OBJ>>>
+ <RETURN <> .CA>)>)>)>
+ <COND (<EQUAL? .ADJ ,W?NO.WORD>
+ <AGAIN>)
+ (<ZMEMQ .ID .OADJS .NUM>
+ ;<COND (T ;<CHECK-EXTENDED?>
+ )
+ ;(T <ZMEMQB .ID .OADJS <- <PTSIZE .OADJS>:FIX 1>>)>)
+ (<AND <EQUAL? .ID ,W?CLOSED ,W?SHUT>
+ <NOT <FSET? .OBJ ,OPENBIT>>>)
+ (<AND <EQUAL? .ID ,W?OPEN>
+ <FSET? .OBJ ,OPENBIT>>)
+ ;(<VERSION? (ZIP <>)
+ (T
+ <IF-MUDDLE <AND <GASSIGNED? SPECIAL-ADJ-CHECK>
+ <SPECIAL-ADJ-CHECK .ADJ .OBJ>>
+ <SPECIAL-ADJ-CHECK .ADJ .OBJ>>)>)
+ (T
+ <RETURN <> .CA>)>>)>
+ T>
+
+<OBJECT GENERIC-OBJECTS
+ (ADJACENT 0) ;"to establish property">
+
+<DEFINE FIND-OBJECTS ("OPT" (SEARCH:FIX
+ <COND (<==? 1 <FIND-WHICH ,FINDER>>
+ <SYNTAX-SEARCH <PARSE-SYNTAX ,PARSE-RESULT>
+ 1>)
+ (T
+ <SYNTAX-SEARCH <PARSE-SYNTAX ,PARSE-RESULT>
+ 2>)>)
+ (PARENT:<OR OBJECT FALSE> <>)
+ "AUX" GLBS (CONT? T) N:FIX (RES <FIND-RES ,FINDER>))
+ ;<MAKE-FIND-RES 'FIND-RES .RES 'FIND-RES-COUNT 0>
+ <FIND-RES-COUNT .RES 0>
+ <FIND-RES-NEXT .RES <>>
+ ;"Initialize world"
+ <COND (<AND .PARENT
+ ;<NOT <IN? .PARENT ,GLOBAL-OBJECTS>>
+ <OR <NOT <FIND-DESCENDANTS .PARENT
+ <ORB ,FD-INCLUDE? ,FD-SEARCH? ,FD-NEST?>;7>>
+ <NOT <0? <FIND-RES-COUNT .RES>:FIX>>>>
+ ;"In case we have `the foo in the bar' or `a picture on the wall'"
+ ;<SET CONT? <>>
+ T)
+ (T
+ <COND (.PARENT
+ <COND (<NOT <SET GLBS <FIND-ADJS ,FINDER>>>
+ <FIND-ADJS ,FINDER
+ <SET GLBS <PMEM-ALLOC ADJS>>>)>
+ <COND (<NOT <ADJS-POSS .GLBS>>
+ <ADJS-POSS .GLBS .PARENT>)>)>
+ <COND (<AND <T? <ANDB .SEARCH ,SEARCH-MOBY ;128>>
+ <F? <ANDB .SEARCH ,SEARCH-MUST-HAVE>>
+ <FIRST? ,GENERIC-OBJECTS>
+ ;<NOT <FIND-DESCENDANTS ,GENERIC-OBJECTS .SEARCH>>>
+ <REPEAT ((OBJ <FIRST? ,GENERIC-OBJECTS>))
+ <COND (<NOT <MATCH-OBJECT .OBJ ,FINDER T>>
+ <RETURN>)
+ (<NOT <SET OBJ <NEXT? .OBJ>>>
+ <RETURN>)>>
+ <COND (<NOT <0? <SET CONT? <FIND-RES-COUNT .RES>>:FIX>>
+ <RETURN <1? .CONT?:FIX>>)>)>
+ <PROG ((LOSING? <>))
+ <COND
+ (<OR <AND <NOT .LOSING?> ;"redundant?"
+ <NOT <0? <ANDB .SEARCH ,SEARCH-CARRIED ;12>>>>
+ .LOSING?>
+ <SET CONT?
+ <FIND-DESCENDANTS ,WINNER
+ <FD-FLAG FD-NOTOP?
+ <FD-FLAG FD-INCLUDE?
+ <FD-FLAG FD-NEST? ,FD-SEARCH?
+ <OR .LOSING? ;"search pockets?"
+ <NOT <0? <ANDB .SEARCH ,SEARCH-POCKETS ;8>>>>>
+ <OR .LOSING?
+ <NOT <0? <ANDB .SEARCH ,SEARCH-CARRIED ;12>>>>>
+ <AND <NOT .LOSING?>
+ <0? <ANDB .SEARCH ,SEARCH-HELD ;4>>>>>>)>
+ <COND
+ (<OR .LOSING?
+ <NOT <0? <ANDB .SEARCH ,SEARCH-IN-ROOM ;3>>>>
+ <SET CONT?
+ <FIND-DESCENDANTS ,HERE
+ <FD-FLAG FD-NOTOP?
+ <FD-FLAG FD-NEST?
+ <FD-FLAG FD-INCLUDE? ,FD-SEARCH?
+ <AND ;,LIT
+ <OR .LOSING?
+ <NOT <0? <ANDB .SEARCH ,SEARCH-IN-ROOM ;3>>>>>>
+ <OR .LOSING?
+ <NOT <0? <ANDB .SEARCH ,SEARCH-OFF-GROUND ;2>>>>>
+ <AND <NOT .LOSING?>
+ <0? <ANDB .SEARCH ,SEARCH-ON-GROUND ;1>>>>>>)>
+ <COND (<NOT <0? <FIND-RES-COUNT .RES>>>
+ <RETURN>)
+ (<AND <NOT <BTST .SEARCH ,SEARCH-ALL>>
+ <NOT .LOSING?>>
+ <COND (<AND <SET GLBS <LEXV-WORD ,TLEXV>>
+ <OR <T? <WORD-CLASSIFICATION-NUMBER .GLBS>>
+ <T? <WORD-SEMANTIC-STUFF .GLBS>>>>
+ <SET LOSING? T> ;"not a sample command"
+ <AGAIN>)
+ (<AND <BAND ,SEARCH-MUST-HAVE .SEARCH>
+ <NOT <BAND ,SEARCH-MOBY .SEARCH>>>
+ <RFALSE>)>)>
+ <COND (<SET GLBS <GETPT ,HERE ,P?GLOBAL>>
+ <COND (T ;<CHECK-EXTENDED?>
+ <SET N </ <PTSIZE .GLBS>:FIX 2>>)
+ ;(T <SET N <- <PTSIZE .GLBS>:FIX 1>>)>
+ <REPEAT (O:OBJECT)
+ <COND (<L? <SET N <- .N 1>> 0>
+ <RETURN>)
+ (<NOT <SET CONT?
+ <MATCH-OBJECT
+ <COND (T ;<CHECK-EXTENDED?>
+ <SET O <ZGET .GLBS .N>>)
+ ;(T <SET O <GETB .GLBS .N>>)>
+ ,FINDER T>>>
+ <RETURN>)
+ (<AND <FIRST? .O>
+ <ZAPPLY ,SEARCH-IN-LG? .O>
+ <NOT <0? <ANDB .SEARCH ,SEARCH-OFF-GROUND>>>>
+ <COND
+ (<NOT
+ <SET CONT?
+ <FIND-DESCENDANTS .O ,FD-INCLUDE? ;1>>>
+ <RETURN>)>)>>)>
+ <COND (<AND .CONT?
+ <NOT <EXCLUDE-HERE-OBJECT?>>>
+ <SET CONT? <MATCH-OBJECT ,HERE ,FINDER T>>)>
+ <COND (<AND .CONT? <GETP ,HERE ,P?THINGS>>
+ <SET CONT? <ZAPPLY ,TEST-THINGS ,HERE ,FINDER>>)>
+ <COND (<NOT <0? <FIND-RES-COUNT .RES>>>
+ <SET CONT? <>>)>
+ <COND (.CONT?
+ <SET CONT?
+ <FIND-DESCENDANTS ,GLOBAL-OBJECTS
+ <FD-FLAG FD-NEST? ,FD-INCLUDE?
+ <NOT <0? <ANDB .SEARCH ,SEARCH-OFF-GROUND ;2>>>>
+ ;<COND (<BTST .SEARCH 2> 5) (T 1)>>>)>
+ <COND (<AND .CONT?
+ <0? <FIND-RES-COUNT .RES>:FIX>
+ ;<BTST .SEARCH ,SEARCH-ADJACENT>
+ <SET GLBS <GETP ,HERE ,P?ADJACENT>>>
+ <SET N <GETB .GLBS 0>>
+ ;<SET LOSING? ,HERE>
+ <REPEAT ((SCH <ANDB .SEARCH <XORB -1 ,SEARCH-ADJACENT>>))
+ <COND (<T? <GETB .GLBS .N>> ;"room visible now?"
+ ;<SETG HERE <GETB .GLBS <SET N <- .N 1>>>>
+ <FIND-OBJECTS .SCH <GETB .GLBS <SET N <- .N 1>>>>)
+ (T
+ <SET N <- .N 1>>)>
+ <COND (<L? <SET N <- .N 1>> 1>
+ <RETURN>)>>
+ ;<SETG HERE .LOSING?>
+ <COND (<NOT <0? <FIND-RES-COUNT .RES>:FIX>>
+ <SET CONT? <>>)>)>
+ <COND
+ (<AND .CONT?
+ <0? <FIND-RES-COUNT .RES>:FIX>
+ <ZAPPLY ,MOBY-FIND? .SEARCH>>
+ <REPEAT ((OBJ 1))
+ <COND (<AND <NOT <FSET? .OBJ ,INVISIBLE>>
+ ;<NOT <IN? .OBJ ,ROOMS>>>
+ <COND (<NOT <MATCH-OBJECT .OBJ ,FINDER T>>
+ <RETURN>)>)>
+ <COND (<G? <SET OBJ <+ .OBJ 1>> ,LAST-OBJECT>
+ <RETURN>)>>)>>)>
+ ;<COND (<AND <L? 1 <FIND-RES-COUNT .RES>:FIX>
+ <FIND-OF ,FINDER>>
+ <MATCH-OF-OBJECTS .RES>)>
+ <1? <FIND-RES-COUNT .RES>:FIX>>
+
+<END-SEGMENT>
+<END-DEFINITIONS>
diff --git a/globals.zabstr b/globals.zabstr
new file mode 100644
index 0000000..2837a59
--- /dev/null
+++ b/globals.zabstr
@@ -0,0 +1,271 @@
+
+<INCLUDE "BASEDEFS" "FIND" "PDEFS">
+<ADJ-SYNONYM LARGE HUGE BIG GIANT GIGANTIC TREMENDOUS MIGHTY MASSIVE ENORMOUS>
+<ADJ-SYNONYM SMALL SMALLER TINY TINIER LITTLE PETITE TEENSY WEENSY>
+<GLOBAL LIT T>
+<GLOBAL MOVES 0>
+<GLOBAL SCORE 0>
+<GLOBAL HERE:OBJECT BANQUET-HALL>
+<OBJECT GLOBAL-OBJECTS (DESC "it") (FLAGS INVISIBLE TOUCHBIT SURFACEBIT
+TRYTAKEBIT OPENBIT SEARCHBIT TRANSBIT WEARBIT ONBIT LIGHTBIT RLANDBIT WORNBIT
+INTEGRALBIT VEHBIT OUTSIDEBIT CONTBIT VOWELBIT LOCKEDBIT NDESCBIT DOORBIT
+ACTORBIT PARTBIT INBIT FEMALEBIT KLUDGEBIT DROPBIT BURNBIT ORBBIT FLAMEBIT
+NALLBIT KEYBIT UNDERGROUNDBIT REDESCBIT)>
+<OBJECT LOCAL-GLOBALS (LOC GLOBAL-OBJECTS) (DESC "it")>
+<OBJECT ROOMS (DESC "it")>
+<OBJECT INTNUM (LOC GLOBAL-OBJECTS) (DESC "number") (SYNONYM NUMBER NUMBERS
+INT.NUM) (ADJECTIVE INT.NUM INT.TIM) (ACTION INTNUM-F)>
+<BEGIN-SEGMENT 0>
+<DEFINE-ROUTINE INTNUM-F>
+<END-SEGMENT>
+<OBJECT IT (LOC GLOBAL-OBJECTS) (SYNONYM IT) (DESC "it") (FLAGS VOWELBIT
+NARTICLEBIT TOUCHBIT)>
+<OBJECT HIM (LOC GLOBAL-OBJECTS) (SYNONYM HIM HIMSELF) (DESC "him") (FLAGS
+NARTICLEBIT TOUCHBIT)>
+<OBJECT HER (LOC GLOBAL-OBJECTS) (SYNONYM HER HERSELF) (DESC "her") (FLAGS
+NARTICLEBIT TOUCHBIT)>
+<OBJECT LEFT-RIGHT (LOC GLOBAL-OBJECTS) (DESC "that way") (SYNONYM LEFT RIGHT)
+(FLAGS NARTICLEBIT) (ACTION LEFT-RIGHT-F)>
+<BEGIN-SEGMENT 0>
+<DEFINE-ROUTINE LEFT-RIGHT-F>
+<END-SEGMENT>
+<BEGIN-SEGMENT CASTLE>
+<OBJECT GRUE (LOC GLOBAL-OBJECTS) (SYNONYM GRUE GRUES) (ADJECTIVE LURKING
+SINISTER HUNGRY SILENT) (DESC "lurking grue") (RESEARCH
+"\"The grue was once a sinister, lurking presence in the dark places of the
+earth. Its favorite diet was adventurers, but its insatiable appetite was
+tempered by its fear of light. No grue was ever seen by the light of day,
+and few ever survived its fearsome jaws to tell the tale.\"|
+ The encyclopedia goes on to say, \"Grues were eradicated from the face of
+the world during the time of Entharion, many by his own hand and his legendary
+blade Grueslayer. Although it has now been many a century since the last grue
+sighting, old hags still delight in scaring children by telling them that
+grues still lurk in the bottomless pits of the Empire, and will one day lurk
+forth again.\"") (ACTION GRUE-F)>
+<END-SEGMENT>
+<BEGIN-SEGMENT 0>
+<DEFINE-ROUTINE GRUE-F>
+<OBJECT SAILOR (LOC GLOBAL-OBJECTS) (DESC "sailor") (SYNONYM SAILOR) (ACTION
+SAILOR-F)>
+<DEFINE-ROUTINE SAILOR-F>
+<OBJECT GLOBAL-SLEEP (LOC GLOBAL-OBJECTS) (DESC "sleep") (SYNONYM SLEEP NAP
+SNOOZE) (FLAGS NARTICLEBIT) (ACTION GLOBAL-SLEEP-F)>
+<DEFINE-ROUTINE GLOBAL-SLEEP-F>
+<OBJECT LULLABY (LOC GLOBAL-OBJECTS) (DESC "lullaby") (SYNONYM LULLABY LULLABYE
+SONG) (ACTION LULLABY-F)>
+<DEFINE-ROUTINE LULLABY-F>
+<OBJECT GROUND (LOC GLOBAL-OBJECTS) (SYNONYM FLOOR GROUND SAND) (SDESC "ground"
+) (ACTION GROUND-F)>
+<DEFINE-ROUTINE GROUND-F>
+<DEFINE-ROUTINE SET-GROUND-DESC>
+<OBJECT GLOBAL-HOLE (LOC GLOBAL-OBJECTS) (DESC "hole") (SYNONYM HOLE) (ACTION
+GLOBAL-HOLE-F)>
+<DEFINE-ROUTINE GLOBAL-HOLE-F>
+<OBJECT WALL (LOC GLOBAL-OBJECTS) (DESC "wall") (SYNONYM WALL WALLS) (ADJECTIVE
+NORTH NE EAST SE SOUTH SW WEST NW REAR FAR) (FLAGS NDESCBIT TOUCHBIT) (ACTION
+WALL-F)>
+<DEFINE-ROUTINE WALL-F>
+<DEFINE-ROUTINE PASSAGE-THERE>
+<DEFINE-ROUTINE REPELLED>
+<OBJECT GLOBAL-PASSAGE (LOC GLOBAL-OBJECTS) (DESC "passage") (SYNONYM PASSAGE
+PASSAGEWAY TUNNEL) (ADJECTIVE GLOOMY DARK SECRET HIDDEN WIDE NARROW LOW STEEP
+SLOPING DUSTY UNEVEN WINDING FORBIDDING GRAVELLY HALF-BURIED HIGHWAY POORLY-DUG
+) (ACTION GLOBAL-PASSAGE-F)>
+<DEFINE-ROUTINE GLOBAL-PASSAGE-F>
+<OBJECT CEILING (LOC GLOBAL-OBJECTS) (FLAGS NDESCBIT TOUCHBIT) (DESC "ceiling")
+(SYNONYM CEILING ROOF) (ADJECTIVE LOW HIGH) (ACTION CEILING-F)>
+<DEFINE-ROUTINE CEILING-F>
+<OBJECT SLIME (LOC LOCAL-GLOBALS) (DESC "slime") (SYNONYM SLIME) (ADJECTIVE
+THICK BLACK) (FLAGS NARTICLEBIT) (ACTION SLIME-F)>
+<DEFINE-ROUTINE SLIME-F>
+<OBJECT WATER (LOC GLOBAL-OBJECTS) (DESC "water") (SYNONYM WATER WATERS GLOOP
+GLOOPS) (ADJECTIVE ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE INT.NUM) (FLAGS
+NARTICLEBIT) (GENERIC G-VIAL-WATER-F) (OWNER <>) (ACTION WATER-F)>
+<DEFINE-ROUTINE WATER-F>
+<DEFINE-ROUTINE FIND-WATER>
+<OBJECT SMALL-VIAL-WATER (DESC "water in the small vial") (SYNONYM WATER GLOOP
+GLOOPS) (ADJECTIVE ONE TWO THREE FOUR INT.NUM) (FLAGS NARTICLEBIT) (GENERIC
+G-VIAL-WATER-F) (ACTION VIAL-WATER-F)>
+<OBJECT LARGE-VIAL-WATER (DESC "water in the large vial") (SYNONYM WATER GLOOP
+GLOOPS) (ADJECTIVE ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE INT.NUM) (FLAGS
+NARTICLEBIT) (GENERIC G-VIAL-WATER-F) (ACTION VIAL-WATER-F)>
+<DEFINE-ROUTINE VIAL-WATER-F>
+<DEFINE-ROUTINE G-VIAL-WATER-F>
+<CONSTANT BODY-PART-OWNERS <TABLE (PURE LENGTH) PROTAGONIST DIMWIT JESTER
+EXECUTIONER SICKLY-WITCH PRICKLY-WITCH>>
+<OBJECT HANDS (LOC GLOBAL-OBJECTS) (SYNONYM HANDS HAND PALM FINGER FINGERS) (
+ADJECTIVE BARE YOUR) (DESC "hands") (OWNER BODY-PART-OWNERS) (FLAGS NDESCBIT
+PLURALBIT TOUCHBIT PARTBIT) (ACTION HANDS-F)>
+<DEFINE-ROUTINE HANDS-F>
+<DEFINE-ROUTINE OPEN-SECRET-PASSAGE?>
+<OBJECT FEET (LOC GLOBAL-OBJECTS) (SYNONYM FEET FOOT TOE TOES) (ADJECTIVE YOUR)
+(DESC "feet") (OWNER BODY-PART-OWNERS) (FLAGS NDESCBIT PLURALBIT TOUCHBIT
+PARTBIT) (ACTION FEET-F)>
+<DEFINE-ROUTINE FEET-F>
+<OBJECT HEAD (LOC GLOBAL-OBJECTS) (DESC "head") (SYNONYM HEAD) (OWNER
+BODY-PART-OWNERS) (FLAGS PARTBIT)>
+<OBJECT EYES (LOC GLOBAL-OBJECTS) (DESC "eyes") (SYNONYM EYE EYES) (ADJECTIVE
+MY MINE ORACLE\'S AMULET\'S FIRST SECOND THIRD FOURTH ONE TWO THREE FOUR) (
+OWNER BODY-PART-OWNERS) (FLAGS PLURALBIT PARTBIT) (ACTION EYES-F)>
+<DEFINE-ROUTINE EYES-F>
+<OBJECT NOSE (LOC GLOBAL-OBJECTS) (DESC "nose") (SYNONYM NOSE NOSTRIL) (
+ADJECTIVE YOUR) (OWNER BODY-PART-OWNERS) (FLAGS PARTBIT) (ACTION NOSE-F)>
+<DEFINE-ROUTINE NOSE-F>
+<OBJECT MOUTH (LOC GLOBAL-OBJECTS) (DESC "mouth") (SYNONYM MOUTH) (ADJECTIVE
+YOUR) (OWNER BODY-PART-OWNERS) (FLAGS PARTBIT) (ACTION MOUTH-F)>
+<DEFINE-ROUTINE MOUTH-F>
+<OBJECT PROTAGONIST (LOC BANQUET-HALL) (DESC "self") (SIZE 1) (FLAGS NDESCBIT
+TRANSBIT SEARCHBIT)>
+<END-SEGMENT>
+<BEGIN-SEGMENT CASTLE>
+<OBJECT ME (LOC GLOBAL-OBJECTS) (SYNONYM ME MYSELF SELF) (DESC "yourself") (
+FLAGS TOUCHBIT NARTICLEBIT) (RESEARCH
+"Son of a gun! There's no entry about you! This is one worthless
+encyclopedia, huh? Why, you're about as famous as they come! At
+least a third of the people in your village have heard of you, for
+instance...") (ACTION ME-F)>
+<END-SEGMENT>
+<BEGIN-SEGMENT 0>
+<DEFINE-ROUTINE ME-F>
+<OBJECT GLOBAL-HERE (LOC GLOBAL-OBJECTS) (DESC "room") (SYNONYM ROOM PLACE
+LOCATION!-PDEFS!-PACKAGE HALL AREA THERE HERE) (ACTION GLOBAL-HERE-F)>
+<DEFINE-ROUTINE GLOBAL-HERE-F>
+<OBJECT GLOBAL-BLDG (LOC LOCAL-GLOBALS) (DESC "building") (SYNONYM BUILDING
+CLUSTER) (ADJECTIVE NEW SMALL STONE IMPRESSIVE) (ACTION GLOBAL-BLDG-F)>
+<DEFINE-ROUTINE GLOBAL-BLDG-F>
+<OBJECT ARCH (LOC LOCAL-GLOBALS) (DESC "arch") (SYNONYM ARCH ARCHWAY) (
+ADJECTIVE STONE CRUMBLING) (FLAGS VOWELBIT) (ACTION ARCH-F)>
+<DEFINE-ROUTINE ARCH-F>
+<OBJECT WINDOW (LOC LOCAL-GLOBALS) (DESC "window") (SYNONYM WINDOW WINDOWS
+GLASS PANE PANES) (ADJECTIVE NARROW WIDER SLITTED GLASS BROKEN WINDOW) (FLAGS
+NDESCBIT) (ACTION WINDOW-F)>
+<DEFINE-ROUTINE WINDOW-F>
+<OBJECT LOCK-OBJECT (LOC LOCAL-GLOBALS) (DESC "lock") (SYNONYM LOCK KEYHOLE
+HOLE) (ADJECTIVE LARGE BASIC COMBINATION KEY) (ACTION LOCK-OBJECT-F)>
+<DEFINE-ROUTINE LOCK-OBJECT-F>
+<OBJECT SIGN (LOC LOCAL-GLOBALS) (DESC "sign") (SYNONYM SIGN) (ADJECTIVE LARGE
+EYE-CATCHING) (FLAGS READBIT) (ACTION SIGN-F)>
+<DEFINE-ROUTINE SIGN-F>
+<OBJECT STAIRS (LOC LOCAL-GLOBALS) (DESC "stair") (SYNONYM FLIGHT STAIR STAIRS
+STAIRWAY STEP STEPS STAIRCASE GANGWAY) (ADJECTIVE STEEP OMINOUS DARK WIDE STONE
+CIRCULAR WINDING SPIRAL COBWEBBY CRUDE FORBIDDING DECREPIT) (ACTION STAIRS-F)>
+<DEFINE-ROUTINE STAIRS-F>
+<OBJECT FIXED-LADDER (LOC LOCAL-GLOBALS) (DESC "ladder") (SYNONYM LADDER) (
+ADJECTIVE RICKETY) (ACTION FIXED-LADDER-F)>
+<DEFINE-ROUTINE FIXED-LADDER-F>
+<OBJECT BONES (LOC LOCAL-GLOBALS) (OWNER BONES) (DESC "pile of old bones") (
+SYNONYM BONE BONES PILE CREATURE ADVENTURER SKELETON SKELETONS) (ADJECTIVE
+ADVENTURER CREATURE OLD) (FLAGS NDESCBIT) (ACTION BONES-F)>
+<DEFINE-ROUTINE BONES-F>
+<DEFINE-ROUTINE CLEAR-BORDER>
+<DEFINE-ROUTINE ADJUST-TEXT-WINDOW>
+<DEFINE-ROUTINE SPLIT-BY-PICTURE>
+<DEFINE-ROUTINE INIT-SL-WITH-SPLIT>
+<REPLACE-DEFINITION STATUS-LINE <ROUTINE INIT-STATUS-LINE>>
+<DEFINE-ROUTINE SET-BORDER>
+<DEFINE-ROUTINE PRINT-SPACES>
+<CONSTANT SLINE <ITABLE NONE 41>>
+<GLOBAL OLD-HERE <>>
+<GLOBAL OLD-REGION <>>
+<GLOBAL SL-SCORE -1>
+<GLOBAL WIDTH 0>
+<GLOBAL COMPASS-CHANGED T>
+<CONSTANT TITLE-SCREEN-PICTURE 1>
+<GLOBAL ACTIVE-MOUSE <>>
+<GLOBAL CURRENT-SPLIT <>>
+<DEFINE-ROUTINE UPDATE-STATUS-LINE>
+<CONSTANT COMPASS-PICSET-TBL <TABLE N-HL NE-HL E-HL SE-HL S-HL SW-HL W-HL NW-HL
+N-UNHL NE-UNHL E-UNHL SE-UNHL S-UNHL SW-UNHL W-UNHL NW-UNHL U-BOX D-BOX
+BOX-COVER 0>>
+<DEFINE-ROUTINE DRAW-COMPASS-ROSE>
+<DEFINE-ROUTINE SHOW-DIRECTION?>
+<DEFINE-ROUTINE COMPASS-CLICK>
+<DEFINE-ROUTINE MAC-CLICK>
+<CONSTANT TANGENT-VALUE 41>
+<DEFINE-ROUTINE MAC-II-CLICK>
+<DEFINE-ROUTINE SAY-HERE>
+<DEFINE-ROUTINE CENTER-1>
+<DEFINE-ROUTINE CENTER-2>
+<DEFINE-ROUTINE CENTER-3>
+<DEFINE-ROUTINE TOUCHING?>
+<DEFINE-ROUTINE HANDLE>
+<DEFINE-ROUTINE CANT-SEE>
+<DEFINE-ROUTINE PRSO-PRINT>
+<DEFINE-ROUTINE PRSI-PRINT>
+<DEFINE-ROUTINE CANT-VERB-A-PRSO>
+<DEFINE-ROUTINE TELL-HIT-HEAD>
+<DEFINE-ROUTINE OPEN-CLOSED>
+<DEFINE-ROUTINE CANT-REACH>
+<DEFINE-ROUTINE DO-FIRST>
+<DEFINE-ROUTINE NOT-IN>
+<DEFINE-ROUTINE PART-OF>
+<DEFINE-ROUTINE RECOGNIZE>
+<DEFINE-ROUTINE PRONOUN>
+<DEFINE-ROUTINE HIT-ANY-KEY>
+<DEFINE-ROUTINE LOCKED-UNLOCKED>
+<DEFINE-ROUTINE CANT-TURN>
+<DEFINE-ROUTINE YOU-MUST-TELL-ME>
+<DEFINE-ROUTINE GRUE-PIT-WARNING>
+<DEFINE-ROUTINE DARK-DEATH>
+<CONSTANT TOO-DARK "It's too dark to see a thing.">
+<CONSTANT YNH "You're not holding">
+<CONSTANT THERES-NOTHING "There's nothing ">
+<CONSTANT YOU-SEE "You can see">
+<CONSTANT IT-SEEMS-THAT "It seems that">
+<CONSTANT YOU-CANT-SEE-ANY "[You can't see any ">
+<CONSTANT YOU-CANT "You can't ">
+<CONSTANT YOULL-HAVE-TO "You'll have to ">
+<CONSTANT LOOK-AROUND "Look around you.|">
+<CONSTANT CANT-FROM-HERE "You can't do that from here.|">
+<CONSTANT HOLDING-IT "You're holding it!|">
+<CONSTANT PERIOD-CR ".|">
+<CONSTANT ELLIPSIS "...||">
+<CONSTANT FAILED "Failed.|">
+<CONSTANT OK "Okay.|">
+<CONSTANT HUH "Huh?|">
+<CONSTANT NOTHING-HAPPENS "Nothing happens.|">
+<CONSTANT ALREADY-IS "It already is!|">
+<CONSTANT NOTHING-NEW "This reveals nothing new.|">
+<CONSTANT ONLY-BLACKNESS "You see only blackness.|">
+<CONSTANT NO-VERB "[There was no verb in that sentence!]|">
+<CONSTANT WEARING-IT "You're wearing it!|">
+<CONSTANT YACHT-MOORED "; the royal yacht is moored at the dock">
+<CONSTANT WHICH-WATER
+"[You'll have to specify which water you mean by referring to the vial
+that contains it.]|">
+<CONSTANT MEGABOZ-CEILING-DESC
+"In the center of the ceiling, a small trap door is visible.">
+<CONSTANT CELL-WALL-DESC "Thick cobwebs obscure the rear wall.">
+<CONSTANT POORLY-CONFIGURED
+"You nearly make it, but the branches are just too poorly configured for
+climbing.|">
+<CONSTANT CANNOT-TRAVEL "\"I regret that I cannot travel that way.\"|">
+<CONSTANT ANSWER-MY-RIDDLE "\"You'll have to answer my riddle first!\"|">
+<CONSTANT SOME-LIGHT "You can see some light through the crack.|">
+<CONSTANT TYPE-A-NUMBER "Please type a number between 1 and ">
+<CONSTANT DROWN " Since you have no diving gear, and you are not amphibious, you drown
+in a swift but still unpleasant fashion.">
+<CONSTANT FUDGE "A faint smell of fudge hangs in the air.">
+<CONSTANT TALK-TO-BROGMOID
+"The brogmoid could no more hear your shouting than you could hear the
+shouting of a bacterium.|">
+<CONSTANT ALREADY-AT "You're already at the ">
+<CONSTANT WITCH-REMOVES-J
+" Immediately, the witches begin beating at the jester with brushes and
+broomsticks. \"Scat, you filthy jester, scat!\" He vanishes hastily.|">
+<CONSTANT BY-THAT-NAME "There's no one here by that name.|">
+<CONSTANT NOTHING-IN-REACH "You reach in as far as you can, but feel nothing.|"
+>
+<CONSTANT WONT-BUDGE "It won't budge.|">
+<CONSTANT COOK-DESC
+"garbed in a white apron and wearing a puffy white chef's hat.">
+<CONSTANT BOOKKEEPER-DESC
+"is hunched over one of the desks, wearing suspenders, a bow tie, thick
+eyeglasses, and a green visor.">
+<CONSTANT ERE-YOU-PASS
+"\"'Ere you pass to the west, you must first pass this test! Show me an object
+which no one has ever seen before and which no one will ever see again!\"|">
+<CONSTANT CARPENTERS
+"Not a chance -- unless you have a team of carpenters in your pocket.|">
+<CONSTANT DEEPLY-ROOTED "The spenseweed is deeply rooted.|">
+<END-SEGMENT> \ No newline at end of file
diff --git a/globals.zap b/globals.zap
new file mode 100644
index 0000000..1062679
--- /dev/null
+++ b/globals.zap
@@ -0,0 +1,2131 @@
+
+ .SEGMENT "0"
+
+
+ .FUNCT INTNUM-F,X
+ EQUAL? HERE,CONSTRUCTION \FALSE
+ CALL NOUN-USED?,INTNUM,W?NUMBER
+ ZERO? STACK /FALSE
+ PRINTI "The number engraved on the wall is """
+ PRINTN CONSTRUCTION-LOC
+ PRINTR "."""
+
+ .ENDSEG
+
+ .SEGMENT "0"
+
+
+ .FUNCT LEFT-RIGHT-F
+ EQUAL? PRSA,V?CHASTISE \?CCL3
+ PRINTR "You see nothing unusual."
+?CCL3: EQUAL? PRSA,V?ENTER,V?WALK-TO,V?WALK \?CCL5
+ EQUAL? HERE,WEIRD \?CCL8
+ CALL NOUN-USED?,LEFT-RIGHT,W?LEFT
+ ZERO? STACK /?CCL8
+ EQUAL? TOWER-BEATEN,PYRAMID-L \?CCL8
+ CALL2 DO-WALK,P?WEST
+ RSTACK
+?CCL8: EQUAL? HERE,WEIRD \?CCL13
+ CALL NOUN-USED?,LEFT-RIGHT,W?RIGHT
+ ZERO? STACK /?CCL13
+ EQUAL? TOWER-BEATEN,PYRAMID-R \?CCL13
+ CALL2 DO-WALK,P?EAST
+ RSTACK
+?CCL13: EQUAL? HERE,TESTING-ROOM \?CCL18
+ CALL NOUN-USED?,LEFT-RIGHT,W?RIGHT
+ ZERO? STACK /?CCL21
+ PUSH RIGHT-BOOTH
+ JUMP ?CND19
+?CCL21: PUSH LEFT-BOOTH
+?CND19: CALL PERFORM,V?ENTER,STACK
+ RSTACK
+?CCL18: CALL1 V-WALK-AROUND
+ RSTACK
+?CCL5: EQUAL? PRSA,V?SET \FALSE
+ PRINTR "You turn ninety degrees, with little effect."
+
+ .ENDSEG
+
+ .SEGMENT "0"
+
+
+ .FUNCT GRUE-F
+ EQUAL? PRSA,V?FIND,V?EXAMINE \FALSE
+ FSET? LANTERN,TRYTAKEBIT \?CCL6
+ PRINTR "Don't be silly! There haven't been grues around for centuries!"
+?CCL6: PRINTI "There is no grue here, but I'm sure there is at least one lurking in the darkness nearby."
+ CALL FIND-IN,PROTAGONIST,ONBIT
+ ZERO? STACK /FALSE
+ FSET? HERE,ONBIT /FALSE
+ PRINTR " I wouldn't let my light go out if I were you!"
+
+
+ .FUNCT SAILOR-F,ARG
+ EQUAL? ARG,M-WINNER \?CCL3
+ EQUAL? PRSA,V?HELLO \?CCL6
+ PRINTR "Nothing happens here."
+?CCL6: CALL2 CANT-SEE,SAILOR
+ RSTACK
+?CCL3: EQUAL? PRSA,V?WAIT-FOR \?CCL8
+ PRINTR "You are liable to be waiting for several sequels."
+?CCL8: CALL2 HANDLE,SAILOR
+ ZERO? STACK /FALSE
+ EQUAL? PRSA,V?HELLO,V?TELL /FALSE
+ CALL2 CANT-SEE,SAILOR
+ RSTACK
+
+
+ .FUNCT GLOBAL-SLEEP-F
+ EQUAL? PRSA,V?TAKE,V?WALK-TO \?CCL3
+ CALL1 V-SLEEP
+ RSTACK
+?CCL3: EQUAL? PRSA,V?PUT-TO \FALSE
+ EQUAL? PRSI,GLOBAL-SLEEP \FALSE
+ EQUAL? PRSO,BEDBUG \?CCL10
+ PRINTI "You sing a brief lullaby. "
+ CALL2 REMOVE-BEDBUG,STR?194
+ RSTACK
+?CCL10: PRINTR "You're not a hypnotist."
+
+
+ .FUNCT LULLABY-F,ACTOR
+ EQUAL? PRSA,V?SING \?CCL3
+ ZERO? PRSI \?CND4
+ IN? BEDBUG,HERE \?CCL8
+ SET 'PRSI,BEDBUG
+ JUMP ?CND4
+?CCL8: CALL FIND-IN,HERE,ACTORBIT >ACTOR
+ ZERO? ACTOR /?CCL10
+ SET 'PRSI,ACTOR
+?CND4: EQUAL? PRSI,BEDBUG \?CCL13
+ ICALL PERFORM,V?PUT-TO,BEDBUG,GLOBAL-SLEEP
+ RTRUE
+?CCL10: PRINTR "[If you put me to sleep, you'd have a heck of a time communicating with the game! By the way, don't expect any offers from the Borphee Opera Company.]"
+?CCL13: FSET? PRSI,ACTORBIT \?CCL15
+ PRINTI "Despite your best rendition,"
+ ICALL1 TPRINT-PRSI
+ PRINTR " remains awake."
+?CCL15: PRINTI "Amazingly,"
+ ICALL1 TPRINT-PRSI
+ PRINTR " is now motionless! You must have put it right to sleep! Incredible! What a talent!"
+?CCL3: EQUAL? PRSA,V?PLAY \FALSE
+ IN? BEDBUG,HERE \?CCL20
+ CALL NOUN-USED?,LULLABY,W?LULLABY,W?LULLABYE
+ ZERO? STACK /?CCL20
+ ICALL PERFORM,V?PUT-TO,BEDBUG,GLOBAL-SLEEP
+ RTRUE
+?CCL20: CALL ULTIMATELY-IN?,VIOLIN,PROTAGONIST
+ ZERO? STACK /?CCL24
+ PRINTI "[with"
+ ICALL2 TPRINT,VIOLIN
+ PRINTC 93
+ CRLF
+ CALL2 PERFORM-PRSA,VIOLIN
+ RSTACK
+?CCL24: IN? HARMONICA,PROTAGONIST \?CCL26
+ PRINTI "[with"
+ ICALL2 TPRINT,HARMONICA
+ PRINTC 93
+ CRLF
+ CALL2 PERFORM-PRSA,HARMONICA
+ RSTACK
+?CCL26: PRINTR "You have no instrument to play it on."
+
+
+ .FUNCT GROUND-F
+ ICALL1 SET-GROUND-DESC
+ EQUAL? PRSA,V?EXAMINE \?CCL3
+ EQUAL? HERE,OUBLIETTE \?CCL6
+ PRINTR "Mud. Squishy mud."
+?CCL6: EQUAL? HERE,PITS \?CCL8
+ ICALL PERFORM,V?EXAMINE,PITS-OBJECT
+ RTRUE
+?CCL8: EQUAL? HERE,TIGHT-SQUEEZE \FALSE
+ PRINTR "You see a man-sized opening through which cool air seems to flow."
+?CCL3: EQUAL? PRSA,V?LOOK-UNDER \?CCL12
+ CALL1 IMPOSSIBLES
+ RSTACK
+?CCL12: EQUAL? PRSA,V?CLIMB,V?CLIMB-ON,V?CLIMB-UP /?CTR13
+ EQUAL? PRSA,V?ENTER \?CCL14
+?CTR13: CALL1 WASTES
+ RSTACK
+?CCL14: EQUAL? PRSA,V?LEAVE \FALSE
+ CALL2 DO-WALK,P?UP
+ RSTACK
+
+
+ .FUNCT SET-GROUND-DESC
+ FSET? HERE,OUTSIDEBIT \?CCL3
+ PUTP GROUND,P?SDESC,STR?195
+ RTRUE
+?CCL3: FSET? HERE,DESERTBIT \?CCL5
+ PUTP GROUND,P?SDESC,STR?196
+ RTRUE
+?CCL5: PUTP GROUND,P?SDESC,STR?197
+ RTRUE
+
+
+ .FUNCT GLOBAL-HOLE-F
+ EQUAL? PRSA,V?DIG \?CCL3
+ EQUAL? PRSO,GLOBAL-HOLE \?CCL3
+ ZERO? PRSI /?CCL8
+ EQUAL? PRSI,SHOVEL \?CCL11
+ CALL PERFORM-PRSA,GROUND,SHOVEL
+ RSTACK
+?CCL11: CALL2 ULTIMATELY-IN?,SHOVEL
+ ZERO? STACK /?CCL13
+ PRINTI "[with the shovel]"
+ CRLF
+ CALL PERFORM-PRSA,PRSI,SHOVEL
+ RSTACK
+?CCL13: PRINTI "[with your hands]"
+ CRLF
+ CALL PERFORM-PRSA,PRSI,HANDS
+ RSTACK
+?CCL8: CALL2 ULTIMATELY-IN?,SHOVEL
+ ZERO? STACK /?CCL15
+ PRINTI "[with the shovel]"
+ CRLF
+ CALL PERFORM-PRSA,GROUND,SHOVEL
+ RSTACK
+?CCL15: PRINTI "[with your hands]"
+ CRLF
+ CALL PERFORM-PRSA,GROUND,HANDS
+ RSTACK
+?CCL3: CALL2 HANDLE,GLOBAL-HOLE
+ ZERO? STACK /FALSE
+ CALL2 CANT-SEE,GLOBAL-HOLE
+ RSTACK
+
+
+ .FUNCT WALL-F,CNT
+ EQUAL? PRSA,V?EXAMINE,V?READ \?CCL3
+ EQUAL? HERE,CHURCH \?CCL6
+ ICALL PERFORM,V?READ,TENET
+ RTRUE
+?CCL6: EQUAL? HERE,CELL \FALSE
+ IN? COBWEBS,CELL \FALSE
+ PRINT CELL-WALL-DESC
+ CRLF
+ RTRUE
+?CCL3: EQUAL? PRSA,V?CLEAN \?CCL12
+ EQUAL? HERE,CELL \?CCL12
+ CALL ADJ-USED?,WALL,W?REAR
+ ZERO? STACK /?CCL12
+ IN? COBWEBS,CELL \?CCL12
+ ICALL PERFORM,V?CLEAN,COBWEBS
+ RTRUE
+?CCL12: EQUAL? PRSA,V?THROW-OVER \?CCL18
+ EQUAL? HERE,PERIMETER-WALL \?CCL21
+ PRINTR "Babe Flathead himself couldn't toss something over this towering wall!"
+?CCL21: PRINTR "The wall joins the ceiling!"
+?CCL18: EQUAL? PRSA,V?PUT-ON,V?PUT \FALSE
+ EQUAL? PRSO,NW-SE-PASSAGE,N-S-PASSAGE \FALSE
+ CALL ADJ-USED?,WALL,FALSE-VALUE
+ ZERO? STACK /?CCL28
+ SET 'P-WON,FALSE-VALUE
+ PRINTR "[You didn't specify which wall you meant: EAST WALL for example.]"
+?CCL28: EQUAL? PRSO,N-S-PASSAGE \?PRD32
+ CALL ADJ-USED?,WALL,W?NORTH,W?N
+ ZERO? STACK \?PRD32
+ CALL ADJ-USED?,WALL,W?SOUTH,W?S
+ ZERO? STACK /?CTR29
+?PRD32: EQUAL? PRSO,NW-SE-PASSAGE \?CCL30
+ CALL ADJ-USED?,WALL,W?NORTHWEST,W?NW
+ ZERO? STACK \?CCL30
+ CALL ADJ-USED?,WALL,W?SOUTHEAST,W?SE
+ ZERO? STACK \?CCL30
+?CTR29: PRINT YOU-CANT
+ PRINTI "install the passage on that wall--it's"
+ CALL2 ARPRINT,PRSO
+ RSTACK
+?CCL30: CALL1 PASSAGE-THERE
+ ZERO? STACK \TRUE
+ EQUAL? HERE,GONDOLA,HOLD /?CTR41
+ LOC PROTAGONIST
+ EQUAL? STACK,YACHT,DB \?CCL42
+?CTR41: PRINTR "A built-in safety feature prevents the passage from being installed in a vehicle."
+?CCL42: MOVE PRSO,HERE
+ FCLEAR PRSO,TAKEBIT
+ SET 'COMPASS-CHANGED,TRUE-VALUE
+ PUTP PRSO,P?OWNER,WALL
+ PRINTI "There's now a passage leading "
+ EQUAL? PRSO,N-S-PASSAGE \?CCL47
+ EQUAL? HERE,CONSTRUCTION \?CND48
+ SET 'N-S-PASSAGE-LOC,CONSTRUCTION-LOC
+?CND48: CALL ADJ-USED?,WALL,W?NORTH,W?N
+ ZERO? STACK /?CCL52
+ SET 'N-S-PASSAGE-DIR,P?NORTH
+ EQUAL? HERE,CONSTRUCTION \?CND53
+ LESS? CONSTRUCTION-LOC,8 /?CND53
+ ADD CONSTRUCTION-LOC,100
+ PUT NORTH-EXITS,0,STACK
+?PRG57: GET STORAGE-TABLE,CNT
+ ZERO? STACK \?CCL61
+ SUB CONSTRUCTION-LOC,8
+ ADD STACK,CONSTRUCTION-OFFSET
+ PUT STORAGE-TABLE,CNT,STACK
+ ADD CNT,1
+ PUT STORAGE-TABLE,STACK,N-S-PASSAGE
+?CND53: PRINTI "nor"
+ JUMP ?CND50
+?CCL61: ADD CNT,2 >CNT
+ JUMP ?PRG57
+?CCL52: SET 'N-S-PASSAGE-DIR,P?SOUTH
+ EQUAL? HERE,CONSTRUCTION \?CND62
+ GRTR? CONSTRUCTION-LOC,55 /?CND62
+ ADD CONSTRUCTION-LOC,108
+ PUT NORTH-EXITS,0,STACK
+?PRG66: GET STORAGE-TABLE,CNT
+ ZERO? STACK \?CCL70
+ ADD CONSTRUCTION-LOC,8
+ ADD STACK,CONSTRUCTION-OFFSET
+ PUT STORAGE-TABLE,CNT,STACK
+ ADD CNT,1
+ PUT STORAGE-TABLE,STACK,N-S-PASSAGE
+?CND62: PRINTI "sou"
+?CND50: PRINTR "th from the room."
+?CCL70: ADD CNT,2 >CNT
+ JUMP ?PRG66
+?CCL47: EQUAL? HERE,CONSTRUCTION \?CND71
+ SET 'NW-SE-PASSAGE-LOC,CONSTRUCTION-LOC
+?CND71: CALL ADJ-USED?,WALL,W?NORTHWEST,W?NW
+ ZERO? STACK /?CCL75
+ SET 'NW-SE-PASSAGE-DIR,P?NW
+ EQUAL? HERE,CONSTRUCTION \?CND76
+ MOD CONSTRUCTION-LOC,8
+ ZERO? STACK /?CND76
+ LESS? CONSTRUCTION-LOC,8 /?CND76
+ ADD CONSTRUCTION-LOC,91
+ PUT SE-EXITS,0,STACK
+?PRG82: GET STORAGE-TABLE,CNT
+ ZERO? STACK \?CCL86
+ SUB CONSTRUCTION-LOC,9
+ ADD STACK,CONSTRUCTION-OFFSET
+ PUT STORAGE-TABLE,CNT,STACK
+ ADD CNT,1
+ PUT STORAGE-TABLE,STACK,NW-SE-PASSAGE
+?CND76: PRINTI "northwe"
+ JUMP ?CND73
+?CCL86: ADD CNT,2 >CNT
+ JUMP ?PRG82
+?CCL75: SET 'NW-SE-PASSAGE-DIR,P?SE
+ EQUAL? HERE,CONSTRUCTION \?CND87
+ MOD CONSTRUCTION-LOC,8
+ EQUAL? STACK,7 /?CND87
+ GRTR? CONSTRUCTION-LOC,55 /?CND87
+ ADD CONSTRUCTION-LOC,100
+ PUT SE-EXITS,0,STACK
+?PRG93: GET STORAGE-TABLE,CNT
+ ZERO? STACK \?CCL97
+ ADD CONSTRUCTION-LOC,9
+ ADD STACK,CONSTRUCTION-OFFSET
+ PUT STORAGE-TABLE,CNT,STACK
+ ADD CNT,1
+ PUT STORAGE-TABLE,STACK,NW-SE-PASSAGE
+?CND87: PRINTI "southea"
+?CND73: PRINTR "st from the room."
+?CCL97: ADD CNT,2 >CNT
+ JUMP ?PRG93
+
+
+ .FUNCT PASSAGE-THERE,PASSAGE?
+ CALL ADJ-USED?,WALL,W?NORTH,W?N
+ ZERO? STACK /?CCL3
+ EQUAL? HERE,PEG-ROOM \?CCL6
+ ZERO? PEG-PASSAGE-OPENED \?CCL9
+ ICALL2 REPELLED,STR?198
+ SET 'PASSAGE?,M-FATAL
+ JUMP ?CND1
+?CCL9: SET 'PASSAGE?,FALSE-VALUE
+ JUMP ?CND1
+?CCL6: EQUAL? HERE,SECRET-PASSAGE \?CCL11
+ ZERO? SECRET-PASSAGE-OPEN \?CCL14
+ ICALL2 REPELLED,STR?198
+ SET 'PASSAGE?,M-FATAL
+ JUMP ?CND1
+?CCL14: SET 'PASSAGE?,FALSE-VALUE
+ JUMP ?CND1
+?CCL11: EQUAL? HERE,CONSTRUCTION \?CCL16
+ INTBL? NORTH-EXITS,CONSTRUCTION-LOC,11 \?CND1
+ SET 'PASSAGE?,TRUE-VALUE
+ JUMP ?CND1
+?CCL16: EQUAL? HERE,WEIRD \?CCL20
+ EQUAL? TOWER-BEATEN,PYRAMID /?CCL20
+ ICALL2 REPELLED,STR?198
+ SET 'PASSAGE?,M-FATAL
+ JUMP ?CND1
+?CCL20: EQUAL? HERE,G-U-MOUNTAIN \?CCL24
+ IN? BOULDER,HERE \?CCL27
+ ICALL2 REPELLED,STR?198
+ SET 'PASSAGE?,M-FATAL
+ JUMP ?CND1
+?CCL27: SET 'PASSAGE?,FALSE-VALUE
+ JUMP ?CND1
+?CCL24: GETPT HERE,P?NORTH
+ ZERO? STACK /?CND1
+ SET 'PASSAGE?,TRUE-VALUE
+ JUMP ?CND1
+?CCL3: CALL ADJ-USED?,WALL,W?SOUTH,W?S
+ ZERO? STACK /?CCL30
+ EQUAL? HERE,CONSTRUCTION \?CCL33
+ ADD CONSTRUCTION-LOC,8
+ INTBL? NORTH-EXITS,STACK,11 \?CND1
+ SET 'PASSAGE?,TRUE-VALUE
+ JUMP ?CND1
+?CCL33: EQUAL? HERE,THRONE-ROOM \?CCL37
+ ZERO? SECRET-PASSAGE-OPEN \?CCL40
+ ICALL2 REPELLED,STR?199
+ SET 'PASSAGE?,M-FATAL
+ JUMP ?CND1
+?CCL40: SET 'PASSAGE?,FALSE-VALUE
+ JUMP ?CND1
+?CCL37: GETPT HERE,P?SOUTH
+ ZERO? STACK /?CND1
+ SET 'PASSAGE?,TRUE-VALUE
+ JUMP ?CND1
+?CCL30: CALL ADJ-USED?,WALL,W?NORTHWEST,W?NW
+ ZERO? STACK /?CCL43
+ EQUAL? HERE,CONSTRUCTION \?CCL46
+ SUB CONSTRUCTION-LOC,9
+ INTBL? SE-EXITS,STACK,7 \?CND1
+ SET 'PASSAGE?,TRUE-VALUE
+ JUMP ?CND1
+?CCL46: EQUAL? HERE,PERIMETER-WALL \?CCL50
+ SET 'PASSAGE?,FALSE-VALUE
+ JUMP ?CND1
+?CCL50: GETPT HERE,P?NW
+ ZERO? STACK /?CND1
+ SET 'PASSAGE?,TRUE-VALUE
+ JUMP ?CND1
+?CCL43: CALL ADJ-USED?,WALL,W?SOUTHEAST,W?SE
+ ZERO? STACK /?CND1
+ EQUAL? HERE,CONSTRUCTION \?CCL55
+ INTBL? SE-EXITS,CONSTRUCTION-LOC,7 \?CND1
+ SET 'PASSAGE?,TRUE-VALUE
+ JUMP ?CND1
+?CCL55: GETPT HERE,P?SE
+ ZERO? STACK /?CND1
+ SET 'PASSAGE?,TRUE-VALUE
+?CND1: EQUAL? PASSAGE?,M-FATAL /TRUE
+ ZERO? PASSAGE? /FALSE
+ PRINTR "There's already an exit in that direction!"
+
+
+ .FUNCT REPELLED,STRING
+ PRINTI "Strangely, the passage seems repelled by the "
+ PRINT STRING
+ PRINTR " wall, as though two inconsistent types of magic were at work in the same place."
+
+
+ .FUNCT GLOBAL-PASSAGE-F
+ EQUAL? PRSA,V?ENTER \FALSE
+ CALL1 V-WALK-AROUND
+ RSTACK
+
+
+ .FUNCT CEILING-F
+ CALL NOUN-USED?,CEILING,W?ROOF
+ ZERO? STACK /?CCL3
+ EQUAL? HERE,ROOF,PARAPET \?CCL3
+ EQUAL? PRSA,V?THROW-FROM \?CCL8
+ REMOVE PRSO
+ EQUAL? PRSO,PERCH /?CCL10
+ CALL ULTIMATELY-IN?,PERCH,PRSO
+ ZERO? STACK /?CND9
+?CCL10: SET 'REMOVED-PERCH-LOC,GROUND
+?CND9: PRINTI "You hear a ""splat"" as"
+ ICALL1 TPRINT-PRSO
+ PRINTR " sinks into the ground far below."
+?CCL8: EQUAL? PRSO,CEILING \?CCL14
+ CALL PERFORM-PRSA,GLOBAL-HERE,PRSI
+ RSTACK
+?CCL14: CALL PERFORM-PRSA,PRSO,GLOBAL-HERE
+ RSTACK
+?CCL3: FSET? HERE,OUTSIDEBIT \?CCL16
+ CALL2 HANDLE,CEILING
+ ZERO? STACK /?CCL16
+ CALL2 CANT-SEE,CEILING
+ RSTACK
+?CCL16: EQUAL? PRSA,V?EXAMINE \?CCL20
+ EQUAL? HERE,BARBICAN \?CCL23
+ PRINTR "It's too gloomy in here to make out any of the features of the ceiling."
+?CCL23: EQUAL? HERE,MEGABOZ-HUT \FALSE
+ PRINT MEGABOZ-CEILING-DESC
+ CRLF
+ RTRUE
+?CCL20: EQUAL? PRSA,V?LOOK-UNDER \FALSE
+ ICALL2 PERFORM,V?LOOK
+ RTRUE
+
+
+ .FUNCT SLIME-F
+ EQUAL? PRSA,V?EAT,V?TOUCH,V?TASTE \FALSE
+ PRINTR "Mega-yucko!"
+
+
+ .FUNCT WATER-F,X
+ CALL1 FIND-WATER >X
+ ZERO? X \?CND1
+ CALL2 VISIBLE?,LARGE-VIAL
+ ZERO? STACK /?CCL5
+ CALL2 VISIBLE?,SMALL-VIAL
+ ZERO? STACK /?CCL5
+ GRTR? LARGE-VIAL-GLOOPS,0 \?CCL5
+ GRTR? SMALL-VIAL-GLOOPS,0 \?CCL5
+ PRINT WHICH-WATER
+ RTRUE
+?CCL5: CALL2 VISIBLE?,LARGE-VIAL
+ ZERO? STACK /?CCL11
+ GRTR? LARGE-VIAL-GLOOPS,0 \?CCL11
+ SET 'X,LARGE-VIAL
+ JUMP ?CND1
+?CCL11: CALL2 VISIBLE?,SMALL-VIAL
+ ZERO? STACK /?CCL15
+ GRTR? SMALL-VIAL-GLOOPS,0 \?CCL15
+ SET 'X,SMALL-VIAL
+?CND1: EQUAL? PRSA,V?COUNT \?CCL22
+ CALL NOUN-USED?,WATER,W?GLOOPS
+ ZERO? STACK /?CCL22
+ CALL2 VISIBLE?,LARGE-VIAL
+ ZERO? STACK /?CND25
+ PRINTI "The large vial "
+ ZERO? LARGE-VIAL-GLOOPS \?CCL29
+ PRINTI "is empty"
+ JUMP ?CND27
+?CCL15: CALL2 HANDLE,WATER
+ ZERO? STACK /FALSE
+ PRINT YOU-CANT-SEE-ANY
+ PRINTR "water here.]"
+?CCL29: PRINTI "contains "
+ PRINTN LARGE-VIAL-GLOOPS
+ PRINTI " gloop"
+ EQUAL? LARGE-VIAL-GLOOPS,1 /?CND27
+ PRINTC 115
+?CND27: CALL2 VISIBLE?,SMALL-VIAL
+ ZERO? STACK /?CCL34
+ PRINTI ". "
+ JUMP ?CND25
+?CCL34: PRINT PERIOD-CR
+?CND25: CALL2 VISIBLE?,SMALL-VIAL
+ ZERO? STACK /FALSE
+ PRINTI "The small vial "
+ ZERO? SMALL-VIAL-GLOOPS \?CCL40
+ PRINTI "is empty"
+ JUMP ?CND38
+?CCL40: PRINTI "contains "
+ PRINTN SMALL-VIAL-GLOOPS
+ PRINTI " gloop"
+ EQUAL? SMALL-VIAL-GLOOPS,1 /?CND38
+ PRINTC 115
+?CND38: PRINT PERIOD-CR
+ RTRUE
+?CCL22: EQUAL? PRSA,V?FILL \?CCL44
+ EQUAL? PRSI,WATER \?CCL44
+ EQUAL? PRSO,LARGE-VIAL,SMALL-VIAL \?CCL49
+ EQUAL? X,LARGE-VIAL \?CCL52
+ ICALL PERFORM,V?FILL,PRSO,LARGE-VIAL
+ RTRUE
+?CCL52: EQUAL? X,SMALL-VIAL \FALSE
+ ICALL PERFORM,V?FILL,PRSO,SMALL-VIAL
+ RTRUE
+?CCL49: EQUAL? PRSO,CUP \?CCL56
+ PRINTR "The water evaporates in a puff of smoke as soon as it touches the cup. A strong magic is at work here!"
+?CCL56: CALL1 IMPOSSIBLES
+ RSTACK
+?CCL44: EQUAL? PRSA,V?EMPTY,V?REMOVE \?CCL58
+ ZERO? PRSI \?CCL58
+ CALL NOUN-USED?,WATER,W?GLOOP,W?GLOOPS
+ ZERO? STACK /?CCL58
+ CALL2 VISIBLE?,LARGE-VIAL
+ ZERO? STACK \?CTR57
+ CALL2 VISIBLE?,SMALL-VIAL
+ ZERO? STACK /?CCL58
+?CTR57: CALL2 VISIBLE?,LARGE-VIAL
+ ZERO? STACK /?CCL67
+ CALL2 VISIBLE?,SMALL-VIAL
+ ZERO? STACK /?CCL67
+ ZERO? LARGE-VIAL-GLOOPS /?CCL72
+ ZERO? SMALL-VIAL-GLOOPS /?CCL72
+ PRINTR "There's water in both vials."
+?CCL72: ZERO? LARGE-VIAL-GLOOPS /?CCL76
+ SET 'PRSI,LARGE-VIAL
+ JUMP ?CND65
+?CCL76: ZERO? SMALL-VIAL-GLOOPS /?CCL78
+ SET 'PRSI,SMALL-VIAL
+ JUMP ?CND65
+?CCL78: PRINTR "Neither vial contains water!"
+?CCL67: CALL2 VISIBLE?,LARGE-VIAL
+ ZERO? STACK /?CCL80
+ SET 'PRSI,LARGE-VIAL
+ JUMP ?CND65
+?CCL80: SET 'PRSI,SMALL-VIAL
+?CND65: ICALL PERFORM,V?EMPTY-FROM,WATER,PRSI
+ RTRUE
+?CCL58: EQUAL? PRSA,V?DRINK \?CCL82
+ PRINTR "You're not thirsty."
+?CCL82: EQUAL? PRSA,V?EXAMINE,V?LOOK-UNDER,V?LOOK-INSIDE \?CCL84
+ PRINTR "You see nothing of interest."
+?CCL84: EQUAL? PRSA,V?TOUCH,V?REACH-IN \?CCL86
+ PRINTI "Your hand is now wet"
+ EQUAL? HERE,OASIS \?CND87
+ PRINTI " and cold"
+?CND87: PRINT PERIOD-CR
+ RTRUE
+?CCL86: EQUAL? PRSA,V?PUT-ON,V?PUT \?CCL90
+ EQUAL? PRSI,WATER \?CCL90
+ IN? PROTAGONIST,DB \?CCL95
+ PRINTR "You can't reach the water -- the bathysphere is closed! (Fortunately.)"
+?CCL95: EQUAL? HERE,PARLOR \?CCL97
+ MOVE PRSO,FISH-TANK
+ JUMP ?CND93
+?CCL97: EQUAL? HERE,LAKE-FLATHEAD \?CCL99
+ FSET? PRSO,ANIMATEDBIT \?CCL102
+ REMOVE PRSO
+ JUMP ?CND93
+?CCL102: MOVE PRSO,LAKE-BOTTOM
+ JUMP ?CND93
+?CCL99: EQUAL? PRSO,PERCH /?CCL104
+ CALL ULTIMATELY-IN?,PERCH,PRSO
+ ZERO? STACK /?CND103
+?CCL104: SET 'REMOVED-PERCH-LOC,WATER
+?CND103: REMOVE PRSO
+?CND93: PRINTI "With a ""p"
+ EQUAL? PRSO,FLICKERING-TORCH,GUTTERING-TORCH,CANDLE \?CCL109
+ FSET? PRSO,ONBIT \?CCL109
+ FCLEAR PRSO,ONBIT
+ FCLEAR PRSO,FLAMEBIT
+ EQUAL? PRSO,GUTTERING-TORCH \?CCL114
+ ICALL2 DEQUEUE,I-GUTTERING-TORCH
+ JUMP ?CND112
+?CCL114: EQUAL? PRSO,FLICKERING-TORCH \?CND112
+ ICALL2 DEQUEUE,I-FLICKERING-TORCH
+?CND112: PRINTI "ffft"
+ JUMP ?CND107
+?CCL109: PRINTI "lunk"
+?CND107: PRINTI ","""
+ ICALL1 TPRINT-PRSO
+ PRINTI " sinks into the water"
+ EQUAL? PRSO,FOX,ROOSTER \?CND116
+ PRINTI ", you heartless animal drowner, you"
+?CND116: PRINT PERIOD-CR
+ RTRUE
+?CCL90: EQUAL? PRSA,V?SWIM,V?ENTER \?CCL119
+ EQUAL? X,SWAMP \?CCL122
+ PRINTR "You're already ankle-deep in the swampy water, which is yucky enough."
+?CCL122: EQUAL? X,FRIGID-RIVER \?CCL124
+ PRINTR "The Frigid River is known for its unpredictable currents."
+?CCL124: EQUAL? X,FLATHEAD-OCEAN \?CCL126
+ PRINTR "The pounding surf would kill you in a moment."
+?CCL126: EQUAL? X,LAKE-FLATHEAD \?CCL128
+ ZERO? ALLIGATOR /?CCL131
+ CALL2 JIGS-UP,STR?200
+ RSTACK
+?CCL131: PRINTR "These waters are known for their hungry denizens."
+?CCL128: EQUAL? X,STREAM-OBJECT \?CCL133
+ CALL2 DO-WALK,P?WEST
+ RSTACK
+?CCL133: EQUAL? X,OASIS-OBJECT \?CCL135
+ PRINTR "Only a Polar Gumffbeast could swim in such cold water!"
+?CCL135: EQUAL? X,FISH-TANK \?CCL137
+ ZERO? DESCRIBED-TANK-AS-LARGE /?CCL140
+ PRINTR "There's no way you could fit into this fish tank! [All right, I'll admit that I went a little overboard when I described the fish tank as ""bigger than a swimming pool.""]"
+?CCL140: SET 'DESCRIBED-TANK-AS-SMALL,TRUE-VALUE
+ PRINTR "What? Swim in an itsy-bitsy fish tank like this one?!?"
+?CCL137: EQUAL? X,MOAT \FALSE
+ ZERO? ALLIGATOR /?CCL145
+ CALL2 JIGS-UP,STR?201
+ RSTACK
+?CCL145: PRINTR "Not recommended. Moats tend to be populated with big, nasty alligators."
+?CCL119: EQUAL? PRSO,WATER \?CCL147
+ CALL PERFORM-PRSA,X,PRSI
+ RSTACK
+?CCL147: CALL PERFORM-PRSA,PRSO,X
+ RSTACK
+
+
+ .FUNCT FIND-WATER
+ CALL GLOBAL-IN?,MOAT,HERE
+ ZERO? STACK /?CCL3
+ RETURN MOAT
+?CCL3: EQUAL? HERE,STREAM \?CCL5
+ RETURN STREAM-OBJECT
+?CCL5: EQUAL? HERE,PARLOR \?CCL7
+ RETURN FISH-TANK
+?CCL7: EQUAL? HERE,RIVERS-END \?CCL9
+ RETURN FRIGID-RIVER
+?CCL9: CALL GLOBAL-IN?,FLATHEAD-OCEAN,HERE
+ ZERO? STACK /?CCL11
+ RETURN FLATHEAD-OCEAN
+?CCL11: EQUAL? HERE,LAKE-FLATHEAD /?CTR12
+ CALL GLOBAL-IN?,LAKE-FLATHEAD,HERE
+ ZERO? STACK /?CCL13
+?CTR12: RETURN LAKE-FLATHEAD
+?CCL13: CALL GLOBAL-IN?,SWAMP,HERE
+ ZERO? STACK /?CCL17
+ RETURN SWAMP
+?CCL17: CALL GLOBAL-IN?,FJORD,HERE
+ ZERO? STACK /?CCL19
+ RETURN FJORD
+?CCL19: EQUAL? HERE,OASIS \FALSE
+ RETURN OASIS-OBJECT
+
+
+ .FUNCT VIAL-WATER-F
+ EQUAL? PRSA,V?TAKE \FALSE
+ EQUAL? P-PRSA-WORD,W?REMOVE \FALSE
+ EQUAL? PRSO,LARGE-VIAL-WATER \?CCL8
+ PUSH LARGE-VIAL
+ JUMP ?CND6
+?CCL8: PUSH SMALL-VIAL
+?CND6: CALL PERFORM,V?EMPTY-FROM,WATER,STACK
+ RSTACK
+
+
+ .FUNCT G-VIAL-WATER-F,SR,F,ADJ,VB
+ GET F,5 >ADJ
+ ZERO? ADJ /?CND1
+ CALL2 CONVERT-NUMBER,ADJ >ADJ
+?CND1: LESS? LARGE-VIAL-GLOOPS,ADJ \?CCL5
+ LESS? SMALL-VIAL-GLOOPS,ADJ /FALSE
+ RETURN SMALL-VIAL-WATER
+?CCL5: LESS? SMALL-VIAL-GLOOPS,ADJ \FALSE
+ RETURN LARGE-VIAL-WATER
+
+
+ .FUNCT HANDS-F,ACTOR
+ EQUAL? PRSA,V?CLEAN \?CCL3
+ CALL1 WASTES
+ RSTACK
+?CCL3: EQUAL? PRSA,V?SHAKE \?CCL5
+ CALL FIND-IN,HERE,ACTORBIT,STR?202 >ACTOR
+ ZERO? ACTOR /?CCL8
+ ICALL PERFORM,V?SHAKE-WITH,HANDS,ACTOR
+ RTRUE
+?CCL8: PRINTR "There's no one here to shake hands with."
+?CCL5: EQUAL? PRSA,V?COUNT \?CCL10
+ CALL NOUN-USED?,HANDS,W?FINGER,W?FINGERS
+ ZERO? STACK /?CCL13
+ PRINTI "Ten"
+ JUMP ?CND11
+?CCL13: PRINTI "Two"
+?CND11: PRINTR ", as usual."
+?CCL10: EQUAL? PRSA,V?CLOSE,V?OPEN \?CCL15
+ ZERO? HAND-IN-WALDO /?CCL15
+ ICALL2 PERFORM-PRSA,WALDO
+ RTRUE
+?CCL15: EQUAL? PRSA,V?TAKE-OFF,V?REMOVE \?CCL19
+ ZERO? HAND-IN-WALDO /?CCL22
+ SET 'HAND-IN-WALDO,FALSE-VALUE
+ PRINTR "You withdraw your hand."
+?CCL22: ZERO? FINGER-ON-STRAW /?CCL24
+ SET 'FINGER-ON-STRAW,FALSE-VALUE
+ SET 'ELIXIR-TRAPPED,FALSE-VALUE
+ PRINTR "You remove your finger from the end of the straw."
+?CCL24: PRINTR "To quote an old song, ""The hand bone's connected to the wrist bone..."""
+?CCL19: EQUAL? PRSA,V?PUT-ON \?CCL26
+ EQUAL? PRSO,GLOVE \?CCL26
+ ICALL PERFORM,V?WEAR,GLOVE
+ RTRUE
+?CCL26: EQUAL? PRSA,V?TAKE-WITH \?CCL30
+ EQUAL? PRSI,HANDS \?CCL30
+ ICALL PERFORM,V?TAKE,PRSO
+ RTRUE
+?CCL30: EQUAL? PRSA,V?SNAP \FALSE
+ CALL NOUN-USED?,HANDS,W?FINGER,W?FINGERS
+ ZERO? STACK /FALSE
+ ZERO? TIME-STOPPED \FALSE
+ IN? PROTAGONIST,SMALL-THRONE \?CCL40
+ CALL1 OPEN-SECRET-PASSAGE?
+ RSTACK
+?CCL40: PRINTR """Snap!"""
+
+
+ .FUNCT OPEN-SECRET-PASSAGE?
+ ZERO? SECRET-PASSAGE-OPEN /?CCL3
+ SET 'SECRET-PASSAGE-OPEN,FALSE-VALUE
+ SET 'COMPASS-CHANGED,TRUE-VALUE
+ PRINTR "The secret passage closes!"
+?CCL3: ZERO? SECRET-PASSAGE-DISCOVERED /?CCL5
+ SET 'SECRET-PASSAGE-OPEN,TRUE-VALUE
+ SET 'COMPASS-CHANGED,TRUE-VALUE
+ PRINTR "The secret passage opens once again."
+?CCL5: SET 'SECRET-PASSAGE-OPEN,TRUE-VALUE
+ SET 'SECRET-PASSAGE-DISCOVERED,TRUE-VALUE
+ SET 'COMPASS-CHANGED,TRUE-VALUE
+ PRINTI "Behind the throne, accompanied by a puff of dust, a secret passage grinds open, leading south into darkness!"
+ IN? JESTER,HERE \?CND6
+ PRINTI " The jester applauds you, howling with mysterious delight."
+?CND6: CRLF
+ ICALL2 INC-SCORE,SECRET-PASSAGE-SCORE
+ SET 'SECRET-PASSAGE-SCORE,0
+ RTRUE
+
+
+ .FUNCT FEET-F
+ EQUAL? PRSA,V?ENTER \FALSE
+ EQUAL? P-PRSA-WORD,W?GET \FALSE
+ SET 'P-PRSA-WORD,W?STAND
+ SET 'PRSO,FALSE-VALUE
+ CALL1 V-STAND
+ RSTACK
+
+
+ .FUNCT EYES-F,WHOSE-EYE
+ CALL ADJ-USED?,EYES,W?MY,W?MINE
+ ZERO? STACK /?CCL3
+ SET 'WHOSE-EYE,PROTAGONIST
+ JUMP ?CND1
+?CCL3: CALL ADJ-USED?,EYES,W?ORACLE'S
+ ZERO? STACK /?CCL5
+ SET 'WHOSE-EYE,ORACLE-OBJECT
+ JUMP ?CND1
+?CCL5: CALL ADJ-USED?,EYES,W?AMULET'S
+ ZERO? STACK /?CCL7
+ SET 'WHOSE-EYE,AMULET
+ JUMP ?CND1
+?CCL7: EQUAL? HERE,ORACLE \?CCL9
+ SET 'WHOSE-EYE,ORACLE-OBJECT
+ JUMP ?CND1
+?CCL9: CALL2 VISIBLE?,AMULET
+ ZERO? STACK /?CCL11
+ SET 'WHOSE-EYE,AMULET
+ JUMP ?CND1
+?CCL11: SET 'WHOSE-EYE,PROTAGONIST
+?CND1: CALL ADJ-USED?,EYES,W?THREE,W?FOUR
+ ZERO? STACK \?PRD16
+ CALL ADJ-USED?,EYES,W?THIRD,W?FOURTH
+ ZERO? STACK /?CCL14
+?PRD16: EQUAL? WHOSE-EYE,PROTAGONIST \?CCL14
+ CALL2 CANT-SEE,EYES
+ RSTACK
+?CCL14: EQUAL? PRSA,V?COUNT \?CCL20
+ EQUAL? WHOSE-EYE,PROTAGONIST \?CCL23
+ PRINTR "Two, unless you've been careless with pointy sticks lately."
+?CCL23: PRINTR "Four."
+?CCL20: EQUAL? PRSA,V?CLOSE,V?OPEN \?CCL25
+ EQUAL? WHOSE-EYE,ORACLE-OBJECT,AMULET \?CCL25
+ PRINTR "There's no way to do that yourself."
+?CCL25: EQUAL? PRSA,V?CLOSE \?CCL29
+ ICALL2 PERFORM,V?SLEEP
+ RTRUE
+?CCL29: EQUAL? PRSA,V?OPEN \FALSE
+ PRINTR "Your eyes ARE open!"
+
+
+ .FUNCT NOSE-F
+ EQUAL? PRSA,V?PICK \FALSE
+ PRINTR "Oh, gross!"
+
+
+ .FUNCT MOUTH-F
+ EQUAL? PRSA,V?PUT \?CCL3
+ EQUAL? PRSI,MOUTH \?CCL3
+ EQUAL? PRSO,STRAW \?CCL8
+ PRINTR "Other than perhaps satisfying some primitive phallic urge of yours, this accomplishes nothing. [If you want to drink something with the straw, just try DRINK THING WITH STRAW!]"
+?CCL8: ICALL PERFORM,V?EAT,PRSO
+ RTRUE
+?CCL3: EQUAL? PRSA,V?ENTER \FALSE
+ PRINTR "That would involve quite a contortion!"
+
+ .ENDSEG
+
+ .SEGMENT "0"
+
+
+ .FUNCT ME-F
+ EQUAL? PRSA,V?CALL,V?YELL,V?TELL \?CCL3
+ PRINTI "Talking to yourself is a sign of impending mental collapse."
+ CRLF
+ CALL1 STOP
+ RSTACK
+?CCL3: EQUAL? PRSA,V?ALARM \?CCL5
+ PRINTR "You are already awake."
+?CCL5: EQUAL? PRSA,V?EAT \?CCL7
+ PRINTR "Auto-cannibalism is not the answer."
+?CCL7: EQUAL? PRSA,V?EXAMINE \?CCL9
+ CALL1 V-DIAGNOSE
+ RSTACK
+?CCL9: EQUAL? PRSA,V?GIVE \?CCL11
+ EQUAL? PRSI,ME \?CCL11
+ ICALL PERFORM,V?TAKE,PRSO
+ RTRUE
+?CCL11: EQUAL? PRSA,V?SHOW \?CCL15
+ EQUAL? PRSI,ME \?CCL15
+ ICALL PERFORM,V?EXAMINE,PRSO
+ RTRUE
+?CCL15: EQUAL? PRSA,V?MOVE \?CCL19
+ CALL1 V-WALK-AROUND
+ RSTACK
+?CCL19: EQUAL? PRSA,V?SEARCH \?CCL21
+ ICALL1 V-INVENTORY
+ RTRUE
+?CCL21: EQUAL? PRSA,V?KICK,V?MUNG,V?KILL \?CCL23
+ EQUAL? P-PRSA-WORD,W?KILL,W?MURDER \?CCL26
+ CALL2 JIGS-UP,STR?204
+ RSTACK
+?CCL26: PRINTI "[If you're really into masochistic fantasies, perhaps you'd be more at home playing Infocom's "
+ HLIGHT H-ITALIC
+ PRINTI "LEATHER GODDESSES OF PHOBOS"
+ HLIGHT H-NORMAL
+ PRINTR " (tm).]"
+?CCL23: EQUAL? PRSA,V?FIND \FALSE
+ PRINTI "You're in"
+ CALL2 TRPRINT,HERE
+ RSTACK
+
+
+ .FUNCT GLOBAL-HERE-F
+ EQUAL? PRSA,V?EXAMINE,V?LOOK-INSIDE,V?LOOK \?CCL3
+ CALL1 V-LOOK
+ RSTACK
+?CCL3: EQUAL? PRSA,V?WALK-TO,V?ENTER \?CCL5
+ EQUAL? HERE,LAKE-FLATHEAD \?CCL8
+ ICALL PERFORM,V?SWIM,LAKE-FLATHEAD
+ RTRUE
+?CCL8: PRINT LOOK-AROUND
+ RTRUE
+?CCL5: EQUAL? PRSA,V?EXIT,V?LEAVE \?CCL10
+ CALL2 DO-WALK,P?OUT
+ RSTACK
+?CCL10: EQUAL? PRSA,V?SEARCH \?CCL12
+ PRINT NOTHING-NEW
+ RTRUE
+?CCL12: EQUAL? PRSA,V?PUT-ON,V?PUT \FALSE
+ EQUAL? PRSI,GLOBAL-HERE \FALSE
+ EQUAL? P-PRSA-WORD,W?THROW \?CCL19
+ ICALL PERFORM,V?THROW,PRSO
+ RTRUE
+?CCL19: ICALL PERFORM,V?DROP,PRSO
+ RTRUE
+
+
+ .FUNCT GLOBAL-BLDG-F
+ EQUAL? PRSA,V?ENTER \?CCL3
+ EQUAL? HERE,FISHING-VILLAGE,WHARF \?CCL3
+ CALL2 DO-WALK,P?NORTH
+ RSTACK
+?CCL3: EQUAL? PRSA,V?LEAVE,V?EXIT \FALSE
+ CALL2 DO-WALK,P?OUT
+ RSTACK
+
+
+ .FUNCT ARCH-F
+ EQUAL? PRSA,V?ENTER \FALSE
+ CALL1 V-WALK-AROUND
+ RSTACK
+
+
+ .FUNCT WINDOW-F
+ EQUAL? PRSA,V?LOOK-INSIDE \?CCL3
+ EQUAL? HERE,GONDOLA \?CCL6
+ ZERO? DIRIGIBLE-COUNTER \?CCL9
+ PRINTR "The dirigible is moored in a hangar."
+?CCL9: EQUAL? DESTINATION,SMALLER-HANGAR \?CCL11
+ SUB DIRIGIBLE-COUNTER,2
+ GET DIRIGIBLE-TRIP-DESCS,STACK
+ PRINT STACK
+ CRLF
+ RTRUE
+?CCL11: SUB 5,DIRIGIBLE-COUNTER
+ GET DIRIGIBLE-TRIP-DESCS,STACK
+ PRINT STACK
+ CRLF
+ RTRUE
+?CCL6: EQUAL? HERE,DIMWITS-ROOM,BASTION,SOLAR \?CCL13
+ PRINTR "The window offers a splendid view of the castle grounds."
+?CCL13: EQUAL? HERE,HOTHOUSE \?CCL15
+ PRINTR "You see a ruined castle."
+?CCL15: EQUAL? HERE,FR-PENTHOUSE,OFFICES-NORTH,OFFICES-SOUTH /?CTR16
+ EQUAL? HERE,OFFICES-EAST,OFFICES-WEST \?CCL17
+?CTR16: EQUAL? HERE,FR-PENTHOUSE /?CTR21
+ GRTR? FLOOR-NUMBER,20 \?CCL22
+?CTR21: PRINTR "You can't see much; the air is pretty smoggy today."
+?CCL22: PRINTR "The window offers a good view of Flatheadia."
+?CCL17: PRINTR "Bug 29."
+?CCL3: EQUAL? PRSA,V?CLOSE,V?OPEN \?CCL26
+ EQUAL? HERE,HOTHOUSE \?CCL29
+ PRINTR "There's not much left of the windows."
+?CCL29: EQUAL? HERE,DIMWITS-ROOM,BASTION,SOLAR \?CCL31
+ PRINTR "The window is just a narrow slit in the stone wall; there's no way to open or close it."
+?CCL31: PRINTR "The window is unopenable."
+?CCL26: EQUAL? PRSA,V?LEAP-OFF,V?EXIT,V?ENTER \?CCL33
+ EQUAL? HERE,HOTHOUSE \?CCL36
+ PRINTR "You cut yourself to ribbons on the broken glass."
+?CCL36: EQUAL? HERE,DIMWITS-ROOM,BASTION,SOLAR \?CCL38
+ PRINTR "These slitted windows are narrower than your body."
+?CCL38: CALL DO-FIRST,STR?140,WINDOW
+ RSTACK
+?CCL33: EQUAL? PRSA,V?PUT-THROUGH \?CCL40
+ EQUAL? HERE,HOTHOUSE,DIMWITS-ROOM,SOLAR /?CTR42
+ EQUAL? HERE,BASTION \?CCL43
+?CTR42: REMOVE PRSO
+ PRINTI "You hear a ""splat"" as"
+ ICALL1 TPRINT-PRSO
+ PRINTI " sinks into the "
+ EQUAL? HERE,HOTHOUSE \?CCL48
+ EQUAL? PRSO,PERCH /?CCL50
+ CALL ULTIMATELY-IN?,PERCH,PRSO
+ ZERO? STACK /?CND49
+?CCL50: SET 'REMOVED-PERCH-LOC,WATER
+?CND49: PRINTI "swamp outside"
+ JUMP ?CND46
+?CCL48: EQUAL? PRSO,PERCH /?CCL54
+ CALL ULTIMATELY-IN?,PERCH,PRSO
+ ZERO? STACK /?CND53
+?CCL54: SET 'REMOVED-PERCH-LOC,GROUND
+?CND53: PRINTI "ground far below"
+?CND46: PRINT PERIOD-CR
+ RTRUE
+?CCL43: CALL DO-FIRST,STR?140,WINDOW
+ RSTACK
+?CCL40: EQUAL? PRSA,V?EXAMINE \FALSE
+ EQUAL? HERE,HOTHOUSE \FALSE
+ PRINTR "Many of the window panes are shattered."
+
+
+ .FUNCT LOCK-OBJECT-F
+ CALL NOUN-USED?,LOCK-OBJECT,W?KEYHOLE
+ ZERO? STACK /?CCL3
+ EQUAL? HERE,LOWEST-HALL \?CCL3
+ CALL2 CANT-SEE,LOCK-OBJECT
+ RSTACK
+?CCL3: EQUAL? PRSA,V?EXAMINE \?CCL7
+ EQUAL? HERE,LOWEST-HALL \?CCL10
+ PRINTR "It's a large combination dial lock."
+?CCL10: PRINTR "It's your basic keyhole lock."
+?CCL7: EQUAL? PRSA,V?LOOK-INSIDE \?CCL12
+ PRINTR "You see nothing of interest, you shameless Peeping Tom you."
+?CCL12: EQUAL? PRSA,V?PICK \?CCL14
+ PRINTR "You have neither the tools nor the expertise."
+?CCL14: EQUAL? PRSA,V?LOCK,V?UNLOCK,V?OPEN \FALSE
+ EQUAL? PRSO,LOCK-OBJECT \FALSE
+ CALL GLOBAL-IN?,EAST-DOOR,HERE
+ ZERO? STACK /?CCL21
+ CALL PERFORM-PRSA,EAST-DOOR,PRSI
+ RSTACK
+?CCL21: CALL GLOBAL-IN?,WEST-DOOR,HERE
+ ZERO? STACK /?CCL23
+ CALL PERFORM-PRSA,WEST-DOOR,PRSI
+ RSTACK
+?CCL23: CALL GLOBAL-IN?,VAULT-DOOR,HERE
+ ZERO? STACK /?CCL25
+ CALL PERFORM-PRSA,VAULT-DOOR,PRSI
+ RSTACK
+?CCL25: EQUAL? HERE,ATTIC \FALSE
+ CALL PERFORM-PRSA,TRUNK,PRSI
+ RSTACK
+
+
+ .FUNCT SIGN-F,NUM
+ EQUAL? PRSA,V?EXAMINE,V?READ \FALSE
+ EQUAL? HERE,EXIT \?CCL6
+ PRINTR """ROCKVILLE ESTATES: The new, prestigious address for the discriminating Young Underground Professional
+64 units, Occupancy Spring 881
+Frobozz Magic Construction Company
+Quizbo Frotzwit, Managing Foreman"""
+?CCL6: EQUAL? HERE,CROSSROADS \?CCL8
+ PRINTR """JUNCTION of GUH-90 and GUH-95
+NORTH: Flatheadia, 1 bloit
+SOUTH: Shadowland, 15 bloits
+ Royal Museum, 17 bloits
+ Fublio Valley, 90 bloits
+EAST: White Cliffs Beach, 4 bloits
+ Flood Control Dam #3, 4 bloits
+ Aragain Falls, 5 bloits
+WEST: Port Foozle, 9 bloits
+ Quilbozza Beach, 9 bloits"""
+?CCL8: EQUAL? HERE,FISHING-VILLAGE \?CCL10
+ PRINTR """Sinners: Enter here for purification!"""
+?CCL10: EQUAL? HERE,INQUISITION \?CCL12
+ PRINTR """Sinners, take note!
+1. We cannot execute everyone at once! Please take a number!
+2. Everyone is permitted a final request.
+3. Tell the executioner your request when your number is called.
+4. If we cannot grant your final wish, we shall be quick and merciful. We will behead you.
+5. If we CAN grant your final wish, we will hang you. Please note that this is slow and excruciatingly painful."""
+?CCL12: EQUAL? HERE,NORTH-OF-ANTHAR \?CCL14
+ PRINTR """We've got as many refugees from the Eastlands as we can handle! Go somewhere else!"""
+?CCL14: EQUAL? HERE,MINE-ENTRANCE \?CCL16
+ PRINTR """Warning! Falling rock zone!"""
+?CCL16: EQUAL? HERE,TOLL-PLAZA \?CCL18
+ PRINTR """Exact Change Only: 1 Zorkmid (coins only)."" Below the sign is a basket."
+?CCL18: EQUAL? HERE,OUTSIDE-HOVEL \?CCL20
+ PRINTR """Korboz the Magnificent"""
+?CCL20: EQUAL? HERE,OUTSIDE-SHACK \?CCL22
+ PRINTR """Warning! This shack is protected against looting by powerful magic!"""
+?CCL22: EQUAL? HERE,WARNING-ROOM \?CCL24
+ PRINTR """Warning! This area is populated by three races: the Veritassi (who always tell the truth), the Prevaricons (who always lie), and the Wishyfoo (who alternate with every statement). Be aware that visitors to Veritass and Prevaricon areas are immediately fed to ravenous hellhounds."""
+?CCL24: PRINTI "Bug 49"
+ RTRUE
+
+
+ .FUNCT STAIRS-F
+ EQUAL? HERE,NORTH-SHORE,EAST-SHORE,SOUTH-SHORE /?PRD5
+ EQUAL? HERE,WEST-SHORE \?CCL3
+?PRD5: IN? PROTAGONIST,YACHT /?CCL3
+ CALL2 CANT-SEE,STAIRS
+ RSTACK
+?CCL3: EQUAL? PRSA,V?CLIMB-UP,V?CLIMB \?CCL9
+ CALL2 DO-WALK,P?UP
+ RSTACK
+?CCL9: EQUAL? PRSA,V?CLIMB-DOWN \FALSE
+ CALL2 DO-WALK,P?DOWN
+ RSTACK
+
+
+ .FUNCT FIXED-LADDER-F
+ EQUAL? PRSA,V?CLIMB-UP,V?CLIMB \?CCL3
+ CALL2 DO-WALK,P?UP
+ RSTACK
+?CCL3: EQUAL? PRSA,V?CLIMB-DOWN \?CCL5
+ CALL2 DO-WALK,P?DOWN
+ RSTACK
+?CCL5: EQUAL? PRSA,V?TAKE \FALSE
+ PRINTR "The ladder is attached to the wall."
+
+
+ .FUNCT BONES-F
+ CALL2 TOUCHING?,BONES
+ ZERO? STACK /FALSE
+ PRINTR "Let the dead lie in peace."
+
+
+ .FUNCT CLEAR-BORDER,X,Y,WRD,?TMP1
+ SCREEN S-WINDOW
+ COLOR FG-COLOR,BG-COLOR
+ ICALL2 PICINF-PLUS-ONE,TEXT-WINDOW-PIC-LOC
+ GET PICINF-TBL,0 >Y
+ GET PICINF-TBL,1 >X
+ WINPOS S-WINDOW,1,1
+ GET 0,17
+ WINSIZE S-WINDOW,Y,STACK
+ CLEAR 1
+ GRTR? X,1 \?CND1
+ ADD Y,1
+ WINPOS S-WINDOW,STACK,1
+ GET 0,18
+ SUB STACK,Y >?TMP1
+ SUB X,1
+ WINSIZE S-WINDOW,?TMP1,STACK
+ CLEAR 1
+ ADD Y,1 >?TMP1
+ GET 0,17
+ SUB STACK,X
+ ADD STACK,1
+ WINPOS S-WINDOW,?TMP1,STACK
+ GET 0,18
+ SUB STACK,Y
+ WINSIZE S-WINDOW,STACK,X
+ CLEAR 1
+?CND1: SET 'SL-SCORE,-1
+ SET 'OLD-REGION,FALSE-VALUE
+ SET 'OLD-HERE,FALSE-VALUE
+ SET 'COMPASS-CHANGED,TRUE-VALUE
+ COLOR 1,1
+ SCREEN S-TEXT
+ RTRUE
+
+
+ .FUNCT ADJUST-TEXT-WINDOW,ID,SCRY,WINY,ADJ
+ GET 0,18 >SCRY
+ ZERO? ID /?CND1
+ PICINF ID,PICINF-TBL /?BOGUS3
+?BOGUS3: GET PICINF-TBL,0 >ADJ
+?CND1: WINGET S-TEXT,WTOP
+ SUB STACK,1
+ SUB SCRY,STACK
+ SUB STACK,ADJ >WINY
+ DIV WINY,FONT-Y
+ MUL FONT-Y,STACK >WINY
+ WINGET S-TEXT,WWIDE
+ WINSIZE S-TEXT,WINY,STACK
+ RTRUE
+
+
+ .FUNCT SPLIT-BY-PICTURE,ID,CLEAR-SCREEN?,Y,X,YS,XS,?TMP2,?TMP1
+ SET 'CURRENT-SPLIT,ID
+ ZERO? CLEAR-SCREEN? /?CND1
+ CLEAR -1
+?CND1: PICINF ID,PICINF-TBL /?BOGUS3
+?BOGUS3: GET PICINF-TBL,0 >Y
+ ADD Y,1 >?TMP1
+ ZERO? BORDER-ON \?CCL6
+ EQUAL? ID,TEXT-WINDOW-PIC-LOC \?CCL6
+ PUSH 1
+ JUMP ?CND4
+?CCL6: GET PICINF-TBL,1 >X
+ ADD X,1
+?CND4: WINPOS S-TEXT,?TMP1,STACK
+ GET 0,18
+ SUB STACK,Y >?TMP1
+ ZERO? BORDER-ON \?CCL11
+ EQUAL? ID,TEXT-WINDOW-PIC-LOC \?CCL11
+ MUL WIDTH,FONT-X
+ JUMP ?CND9
+?CCL11: GET 0,17 >?TMP2
+ MUL X,2
+ SUB ?TMP2,STACK
+?CND9: WINSIZE S-TEXT,?TMP1,STACK
+ WINPOS S-WINDOW,1,1
+ GET 0,17
+ WINSIZE S-WINDOW,Y,STACK
+ RTRUE
+
+
+ .FUNCT INIT-SL-WITH-SPLIT,WHICH,DONT-CLEAR,YFUDGE
+ ZERO? WHICH /?CND1
+ SET 'CURRENT-SPLIT,WHICH
+?CND1: CALL2 INIT-STATUS-LINE,DONT-CLEAR
+ RSTACK
+
+
+ .FUNCT INIT-STATUS-LINE,DONT-CLEAR,NUM,X,Y,?TMP2,?TMP1
+ SET 'NUM,1
+ SET 'OLD-HERE,FALSE-VALUE
+ SET 'OLD-REGION,FALSE-VALUE
+ SET 'SL-SCORE,-1
+ SET 'COMPASS-CHANGED,TRUE-VALUE
+ ZERO? DONT-CLEAR \?CND1
+ CLEAR -1
+?CND1: ICALL2 SPLIT-BY-PICTURE,CURRENT-SPLIT
+ EQUAL? CURRENT-SPLIT,TEXT-WINDOW-PIC-LOC \?CCL5
+ ICALL2 ADJUST-TEXT-WINDOW,0
+ SCREEN S-FULL
+ ZERO? BORDER-ON /?CCL10
+ CALL1 SET-BORDER
+ DISPLAY STACK,1,1
+ PICSET COMPASS-PICSET-TBL
+ JUMP ?CND8
+?CCL5: EQUAL? CURRENT-SPLIT,F-SPLIT \?CCL7
+ ICALL2 ADJUST-TEXT-WINDOW,F-BOTTOM
+ RTRUE
+?CCL7: ICALL2 ADJUST-TEXT-WINDOW,PBOZ-BOTTOM
+ RTRUE
+?CCL10: HLIGHT H-INVERSE
+ ICALL2 INVERSE-LINE,1
+ ICALL2 INVERSE-LINE,2
+ ICALL2 INVERSE-LINE,3
+?CND8: SCREEN S-WINDOW
+ FONT 4
+ ICALL2 PICINF-PLUS-ONE,HERE-LOC
+ GET PICINF-TBL,0
+ ADD STACK,FONT-Y >?TMP1
+ GET PICINF-TBL,1
+ CURSET ?TMP1,STACK
+ GETB 0,30
+ EQUAL? STACK,DEC-20 /?CCL12
+ ZERO? BORDER-ON \?CND11
+?CCL12: HLIGHT H-INVERSE
+?CND11: ZERO? BORDER-ON /?CND15
+ COLOR 1,-1
+?CND15: PRINTI "Moves:"
+ ICALL2 PICINF-PLUS-ONE,REGION-LOC
+ GET PICINF-TBL,0
+ ADD STACK,FONT-Y >?TMP1
+ GET PICINF-TBL,1 >?TMP2
+ MUL FONT-X,10
+ SUB ?TMP2,STACK
+ CURSET ?TMP1,STACK
+ PRINTI "Score:"
+ ZERO? BORDER-ON /?CND17
+ COLOR 1,1
+?CND17: FONT 1
+ GETB 0,30
+ EQUAL? STACK,DEC-20 \?CND19
+ HLIGHT H-NORMAL
+?CND19: SCREEN S-TEXT
+ RFALSE
+
+
+ .FUNCT SET-BORDER
+ EQUAL? HERE,GONDOLA \?CCL3
+ GRTR? DIRIGIBLE-COUNTER,0 \?CCL3
+ RETURN OUTSIDE-BORDER
+?CCL3: EQUAL? HERE,FORMAL-GARDEN,COURTYARD \?CCL7
+ RETURN CASTLE-BORDER
+?CCL7: EQUAL? HERE,BARBICAN,UPPER-BARBICAN,GARRISON \?CCL9
+ RETURN OUTSIDE-BORDER
+?CCL9: FSET? HERE,OUTSIDEBIT \?CCL11
+ RETURN OUTSIDE-BORDER
+?CCL11: FSET? HERE,UNDERGROUNDBIT /?CTR12
+ RETURN CASTLE-BORDER
+?CTR12: RETURN UNDERGROUND-BORDER
+
+
+ .FUNCT PRINT-SPACES,CNT
+?PRG1: DLESS? 'CNT,0 /TRUE
+ PRINTC 32
+ JUMP ?PRG1
+
+
+ .FUNCT UPDATE-STATUS-LINE,?TMP2,?TMP1
+ SCREEN S-WINDOW
+ FONT 4
+ GETB 0,30
+ EQUAL? STACK,DEC-20 /?CCL2
+ ZERO? BORDER-ON \?CND1
+?CCL2: HLIGHT H-INVERSE
+?CND1: PICINF HERE-LOC,PICINF-TBL /?BOGUS5
+?BOGUS5: GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ CURSET ?TMP1,STACK
+ ZERO? BORDER-ON /?CND6
+ COLOR 1,-1
+?CND6: EQUAL? HERE,OLD-HERE /?CND8
+ SET 'OLD-HERE,HERE
+ ICALL2 PICINF-PLUS-ONE,HERE-LOC
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ CURSET ?TMP1,STACK
+ ICALL2 PRINT-SPACES,24
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ CURSET ?TMP1,STACK
+ EQUAL? HERE,PHIL-HALL \?CCL12
+ PRINTI "Philharmonic Hall"
+ JUMP ?CND8
+?CCL12: EQUAL? HERE,G-U-MOUNTAIN \?CCL14
+ PRINTI "Great Undergd. Mountain"
+ JUMP ?CND8
+?CCL14: EQUAL? HERE,G-U-SAVANNAH \?CCL16
+ PRINTI "Great Undergd. Savannah"
+ JUMP ?CND8
+?CCL16: EQUAL? HERE,G-U-HIGHWAY \?CCL18
+ PRINTI "Great Undergd. Highway"
+ JUMP ?CND8
+?CCL18: ICALL2 DPRINT,HERE
+?CND8: GETP HERE,P?REGION
+ EQUAL? STACK,OLD-REGION /?CND19
+ GETP HERE,P?REGION >OLD-REGION
+ ICALL2 PICINF-PLUS-ONE,REGION-LOC
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1 >?TMP2
+ MUL FONT-X,23
+ SUB ?TMP2,STACK
+ CURSET ?TMP1,STACK
+ ICALL2 PRINT-SPACES,23
+ DIROUT D-TABLE-ON,SLINE
+ PUT SLINE,0,0
+ PRINT OLD-REGION
+ DIROUT D-TABLE-OFF
+ GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1 >?TMP2
+ GET SLINE,0
+ MUL FONT-X,STACK
+ SUB ?TMP2,STACK
+ CURSET ?TMP1,STACK
+ PRINT OLD-REGION
+?CND19: ICALL2 PICINF-PLUS-ONE,HERE-LOC
+ GET PICINF-TBL,0
+ ADD STACK,FONT-Y >?TMP1
+ GET PICINF-TBL,1 >?TMP2
+ MUL FONT-X,8
+ ADD ?TMP2,STACK
+ CURSET ?TMP1,STACK
+ ICALL2 PRINT-SPACES,5
+ GET PICINF-TBL,0
+ ADD STACK,FONT-Y >?TMP1
+ GET PICINF-TBL,1 >?TMP2
+ MUL FONT-X,8
+ ADD ?TMP2,STACK
+ CURSET ?TMP1,STACK
+ PRINTN MOVES
+ EQUAL? SCORE,SL-SCORE /?CND21
+ SET 'SL-SCORE,SCORE
+ ICALL2 PICINF-PLUS-ONE,REGION-LOC
+ GET PICINF-TBL,0
+ ADD STACK,FONT-Y >?TMP1
+ GET PICINF-TBL,1 >?TMP2
+ MUL FONT-X,4
+ SUB ?TMP2,STACK
+ CURSET ?TMP1,STACK
+ ICALL2 PRINT-SPACES,4
+ GET PICINF-TBL,0
+ ADD STACK,FONT-Y >?TMP1
+ GET PICINF-TBL,1 >?TMP2
+ GRTR? SCORE,999 /?CTR24
+ LESS? SCORE,-99 \?CCL25
+?CTR24: PUSH 4
+ JUMP ?CND23
+?CCL25: GRTR? SCORE,99 /?CTR28
+ LESS? SCORE,-9 \?CCL29
+?CTR28: PUSH 3
+ JUMP ?CND23
+?CCL29: GRTR? SCORE,9 /?CTR32
+ LESS? SCORE,0 \?CCL33
+?CTR32: PUSH 2
+ JUMP ?CND23
+?CCL33: PUSH 1
+?CND23: MUL FONT-X,STACK
+ SUB ?TMP2,STACK
+ CURSET ?TMP1,STACK
+ PRINTN SCORE
+?CND21: ZERO? BORDER-ON /?CND36
+ COLOR 1,1
+?CND36: GETB 0,30
+ EQUAL? STACK,DEC-20 /?CCL39
+ ZERO? BORDER-ON \?CND38
+?CCL39: HLIGHT H-NORMAL
+?CND38: ZERO? COMPASS-CHANGED /?CND42
+ ZERO? BORDER-ON /?CND42
+ GETB 0,30
+ EQUAL? STACK,DEC-20 /?CND42
+ SET 'COMPASS-CHANGED,FALSE-VALUE
+ ICALL2 PICINF-PLUS-ONE,COMPASS-PIC-LOC
+ ICALL DRAW-COMPASS-ROSE,P?NORTH,N-HL,N-UNHL
+ ICALL DRAW-COMPASS-ROSE,P?NE,NE-HL,NE-UNHL
+ ICALL DRAW-COMPASS-ROSE,P?EAST,E-HL,E-UNHL
+ ICALL DRAW-COMPASS-ROSE,P?SE,SE-HL,SE-UNHL
+ ICALL DRAW-COMPASS-ROSE,P?SOUTH,S-HL,S-UNHL
+ ICALL DRAW-COMPASS-ROSE,P?SW,SW-HL,SW-UNHL
+ ICALL DRAW-COMPASS-ROSE,P?WEST,W-HL,W-UNHL
+ ICALL DRAW-COMPASS-ROSE,P?NW,NW-HL,NW-UNHL
+ ICALL2 PICINF-PLUS-ONE,U-BOX-LOC
+ CALL SHOW-DIRECTION?,HERE,P?UP,FALSE-VALUE
+ ZERO? STACK /?CCL49
+ ZERO? LIT /?CCL49
+ SET '?TMP2,U-BOX
+ JUMP ?CND47
+?CCL49: SET '?TMP2,BOX-COVER
+?CND47: GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY ?TMP2,?TMP1,STACK
+ ICALL2 PICINF-PLUS-ONE,D-BOX-LOC
+ CALL SHOW-DIRECTION?,HERE,P?DOWN,FALSE-VALUE
+ ZERO? STACK /?CCL54
+ ZERO? LIT /?CCL54
+ SET '?TMP2,D-BOX
+ JUMP ?CND52
+?CCL54: SET '?TMP2,BOX-COVER
+?CND52: GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY ?TMP2,?TMP1,STACK
+?CND42: FONT 1
+ SCREEN S-TEXT
+ RFALSE
+
+
+ .FUNCT DRAW-COMPASS-ROSE,DIR,HIGHLIGHT-PIC,UNHIGHLIGHT-PIC,?TMP1,?TMP2
+ CALL SHOW-DIRECTION?,HERE,DIR,FALSE-VALUE
+ ZERO? STACK /?CCL3
+ ZERO? LIT /?CCL3
+ SET '?TMP2,HIGHLIGHT-PIC
+ JUMP ?CND1
+?CCL3: SET '?TMP2,UNHIGHLIGHT-PIC
+?CND1: GET PICINF-TBL,0 >?TMP1
+ GET PICINF-TBL,1
+ DISPLAY ?TMP2,?TMP1,STACK
+ RTRUE
+
+
+ .FUNCT SHOW-DIRECTION?,RM,DIR,MAPPING,PTS
+ ASSIGNED? 'MAPPING /?CND1
+ SET 'MAPPING,TRUE-VALUE
+?CND1: IN? N-S-PASSAGE,RM \?CCL5
+ EQUAL? RM,CONSTRUCTION /?CCL5
+ EQUAL? N-S-PASSAGE-DIR,DIR /TRUE
+?CCL5: IN? NW-SE-PASSAGE,RM \?CCL10
+ EQUAL? RM,CONSTRUCTION /?CCL10
+ EQUAL? NW-SE-PASSAGE-DIR,DIR /TRUE
+?CCL10: IN? PROTAGONIST,YACHT \?CCL15
+ EQUAL? DIR,P?DOWN /TRUE
+?CCL15: FSET? RM,DELTABIT \?CCL19
+ EQUAL? DIR,P?UP,P?DOWN /FALSE
+ EQUAL? RM,DELTA-1 \TRUE
+ EQUAL? DIR,P?SOUTH \TRUE
+ ZERO? MAPPING \FALSE
+ RTRUE
+?CCL19: EQUAL? RM,CONSTRUCTION \?CCL29
+ EQUAL? DIR,P?UP,P?DOWN /FALSE
+ EQUAL? DIR,P?NORTH \?PRD36
+ INTBL? CONSTRUCTION-LOC,NORTH-EXITS,11 /TRUE
+?PRD36: EQUAL? DIR,P?NE \?PRD39
+ INTBL? CONSTRUCTION-LOC,NE-EXITS,17 /TRUE
+?PRD39: EQUAL? DIR,P?EAST \?PRD42
+ INTBL? CONSTRUCTION-LOC,EAST-EXITS,15 /TRUE
+?PRD42: EQUAL? DIR,P?SE \?PRD45
+ INTBL? CONSTRUCTION-LOC,SE-EXITS,7 /TRUE
+?PRD45: EQUAL? DIR,P?SOUTH \?PRD48
+ ADD CONSTRUCTION-LOC,8
+ INTBL? STACK,NORTH-EXITS,11 /TRUE
+?PRD48: EQUAL? DIR,P?SW \?PRD51
+ ADD CONSTRUCTION-LOC,7
+ INTBL? STACK,NE-EXITS,17 /TRUE
+?PRD51: EQUAL? DIR,P?WEST \?PRD54
+ SUB CONSTRUCTION-LOC,1
+ INTBL? STACK,EAST-EXITS,15 /TRUE
+?PRD54: EQUAL? DIR,P?NW \?PRD57
+ SUB CONSTRUCTION-LOC,9
+ INTBL? STACK,SE-EXITS,7 /TRUE
+?PRD57: EQUAL? DIR,P?EAST \?CCL34
+ EQUAL? CONSTRUCTION-LOC,47 /TRUE
+?CCL34: IN? N-S-PASSAGE,RM \?CCL63
+ FSET? N-S-PASSAGE,TAKEBIT /?CCL63
+ EQUAL? DIR,P?NORTH,P?SOUTH \?CCL63
+ EQUAL? CONSTRUCTION-LOC,N-S-PASSAGE-LOC \?CCL69
+ EQUAL? N-S-PASSAGE-DIR,DIR /TRUE
+?CCL69: EQUAL? CONSTRUCTION-LOC,N-S-PASSAGE-LOC /FALSE
+ EQUAL? N-S-PASSAGE-DIR,DIR /FALSE
+ RTRUE
+?CCL63: IN? NW-SE-PASSAGE,RM \FALSE
+ FSET? NW-SE-PASSAGE,TAKEBIT /FALSE
+ EQUAL? DIR,P?NW,P?SE \FALSE
+ EQUAL? CONSTRUCTION-LOC,NW-SE-PASSAGE-LOC \?CCL83
+ EQUAL? NW-SE-PASSAGE-DIR,DIR /TRUE
+?CCL83: EQUAL? CONSTRUCTION-LOC,NW-SE-PASSAGE-LOC /FALSE
+ EQUAL? NW-SE-PASSAGE-DIR,DIR /FALSE
+ RTRUE
+?CCL29: EQUAL? RM,PLAIN \?CCL91
+ EQUAL? DIR,P?UP,P?DOWN /FALSE
+ EQUAL? DIR,P?NORTH,P?NE,P?NW \?PRD98
+ EQUAL? RANK,1 /FALSE
+?PRD98: EQUAL? DIR,P?EAST,P?NE,P?SE \?PRD101
+ EQUAL? FILE,8 /FALSE
+?PRD101: EQUAL? DIR,P?SOUTH,P?SE,P?SW \?PRD104
+ EQUAL? RANK,8 /FALSE
+?PRD104: EQUAL? DIR,P?WEST,P?SW,P?NW \TRUE
+ EQUAL? FILE,1 /FALSE
+ RTRUE
+?CCL91: EQUAL? RM,MIRROR-LAKE \?CCL110
+ EQUAL? DIR,P?UP,P?DOWN \TRUE
+?CCL110: EQUAL? RM,WISHYFOO-TERRITORY \?CCL114
+ EQUAL? DIR,P?SW \?CCL114
+ ZERO? MAPPING /TRUE
+?CCL114: EQUAL? RM,STREAM \?CCL119
+ EQUAL? DIR,P?WEST \?CCL119
+ IN? BRIDGE,STREAM \FALSE
+?CCL119: GETPT RM,DIR >PTS
+ ZERO? PTS /FALSE
+ PTSIZE PTS
+ EQUAL? STACK,NEXIT /FALSE
+ EQUAL? RM,THRONE-ROOM \?CCL129
+ EQUAL? DIR,P?SOUTH \?CCL129
+ ZERO? SECRET-PASSAGE-OPEN /FALSE
+?CCL129: EQUAL? RM,G-U-MOUNTAIN \?CCL134
+ EQUAL? DIR,P?NORTH \?CCL134
+ IN? BOULDER,RM /FALSE
+?CCL134: EQUAL? RM,HOLLOW \?CCL139
+ EQUAL? DIR,P?SOUTH \?CCL139
+ ZERO? IRON-MINE-OPEN /FALSE
+?CCL139: EQUAL? RM,PEG-ROOM \?CCL144
+ EQUAL? DIR,P?NORTH \?CCL144
+ ZERO? PEG-PASSAGE-OPENED /FALSE
+?CCL144: EQUAL? RM,CRYPT \?CCL149
+ EQUAL? DIR,P?DOWN \?CCL149
+ FSET? HOLEY-SLAB,TOUCHBIT \FALSE
+?CCL149: EQUAL? RM,RUINED-HALL \?CCL154
+ EQUAL? DIR,P?EAST \?CCL154
+ ZERO? SECRET-ROOM-REVEALED /FALSE
+?CCL154: EQUAL? RM,MARSH \?CCL159
+ EQUAL? DIR,P?NORTH \?CCL159
+ ZERO? STEPPING-STONES-VISIBLE /FALSE
+?CCL159: EQUAL? RM,WEIRD \?CCL164
+ EQUAL? DIR,P?NORTH,P?EAST,P?WEST \?CCL164
+ EQUAL? DIR,P?NORTH \?CCL169
+ EQUAL? TOWER-BEATEN,PYRAMID /TRUE
+ FSET? PYRAMID,TOUCHBIT \FALSE
+ ZERO? MAPPING \TRUE
+ RFALSE
+?CCL169: EQUAL? DIR,P?EAST \?CCL178
+ EQUAL? TOWER-BEATEN,PYRAMID-R /TRUE
+ FSET? PYRAMID-R,TOUCHBIT \FALSE
+ ZERO? MAPPING \TRUE
+ RFALSE
+?CCL178: EQUAL? TOWER-BEATEN,PYRAMID-L /TRUE
+ FSET? PYRAMID-L,TOUCHBIT \FALSE
+ ZERO? MAPPING \TRUE
+ RFALSE
+?CCL164: ZERO? MAPPING /TRUE
+ EQUAL? RM,COURTROOM \?CCL196
+ EQUAL? DIR,P?SOUTH /FALSE
+?CCL196: EQUAL? RM,TAX-OFFICE \?CCL200
+ EQUAL? DIR,P?SOUTH /FALSE
+?CCL200: EQUAL? RM,JESTERS-QUARTERS \?CCL204
+ EQUAL? DIR,P?SOUTH /FALSE
+?CCL204: EQUAL? RM,BASE-OF-MOUNTAIN \?CCL208
+ EQUAL? DIR,P?EAST /FALSE
+?CCL208: EQUAL? RM,G-U-MOUNTAIN \?CCL212
+ EQUAL? DIR,P?WEST /FALSE
+?CCL212: EQUAL? RM,FOOTHILLS \?CCL216
+ EQUAL? DIR,P?SOUTH /FALSE
+?CCL216: EQUAL? RM,BASE-OF-MOUNTAINS \TRUE
+ EQUAL? DIR,P?NORTH /FALSE
+ RTRUE
+
+
+ .FUNCT COMPASS-CLICK,PIC1,PIC2,TL-X,TL-Y,BR-X,BR-Y,CENTER-X,CENTER-Y,DIR
+ EQUAL? PIC1,COMPASS-PIC-LOC \?CND1
+ ICALL2 PICINF-PLUS-ONE,U-BOX-LOC
+ GET PICINF-TBL,1 >TL-X
+ GET PICINF-TBL,0 >TL-Y
+ PICINF U-BOX,PICINF-TBL /?BOGUS3
+?BOGUS3: GET PICINF-TBL,1
+ ADD TL-X,STACK >BR-X
+ GET PICINF-TBL,0
+ ADD TL-Y,STACK >BR-Y
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK /?CND4
+ RETURN P?UP
+?CND4: ICALL2 PICINF-PLUS-ONE,D-BOX-LOC
+ GET PICINF-TBL,1 >TL-X
+ GET PICINF-TBL,0 >TL-Y
+ PICINF D-BOX,PICINF-TBL /?BOGUS6
+?BOGUS6: GET PICINF-TBL,1
+ ADD TL-X,STACK >BR-X
+ GET PICINF-TBL,0
+ ADD TL-Y,STACK >BR-Y
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK /?CND1
+ RETURN P?DOWN
+?CND1: ICALL2 PICINF-PLUS-ONE,PIC1
+ GET PICINF-TBL,0 >TL-Y
+ GET PICINF-TBL,1 >TL-X
+ PICINF PIC2,PICINF-TBL /?BOGUS9
+?BOGUS9: GET PICINF-TBL,0
+ ADD STACK,TL-Y >BR-Y
+ GET PICINF-TBL,1
+ ADD STACK,TL-X >BR-X
+ GET PICINF-TBL,1
+ DIV STACK,2
+ ADD TL-X,STACK >CENTER-X
+ GET PICINF-TBL,0
+ DIV STACK,2
+ ADD TL-Y,STACK >CENTER-Y
+ CALL WITHIN?,TL-X,TL-Y,BR-X,BR-Y
+ ZERO? STACK /?CCL12
+ GETB 0,30
+ EQUAL? STACK,MACINTOSH \?CCL15
+ CALL1 MAC-II?
+ ZERO? STACK /?CCL18
+ CALL MAC-II-CLICK,CENTER-X,CENTER-Y >DIR
+ JUMP ?CND13
+?CCL18: CALL MAC-CLICK,CENTER-X,CENTER-Y,TL-X,TL-Y >DIR
+?CND13: ZERO? DIR /?CCL21
+ RETURN DIR
+?CCL15: SOUND 1
+ PRINTI "[Sorry, clicking on the compass rose is not yet implemented on this machine.]"
+ CRLF
+ RFALSE
+?CCL21: SOUND 1
+ RFALSE
+?CCL12: SOUND 1
+ RFALSE
+
+
+ .FUNCT MAC-CLICK,CENTER-X,CENTER-Y,TL-X,TL-Y,X,Y,DIR,?TMP3,?TMP1,?TMP2
+ ADD TL-X,25 >?TMP2
+ ADD TL-X,35 >?TMP1
+ ADD TL-Y,20
+ CALL WITHIN?,?TMP2,TL-Y,?TMP1,STACK
+ ZERO? STACK /?CCL3
+ SET 'DIR,P?NORTH
+ RETURN DIR
+?CCL3: ADD TL-X,25 >?TMP3
+ ADD TL-Y,36 >?TMP2
+ ADD TL-X,35 >?TMP1
+ ADD TL-Y,58
+ CALL WITHIN?,?TMP3,?TMP2,?TMP1,STACK
+ ZERO? STACK /?CCL5
+ SET 'DIR,P?SOUTH
+ RETURN DIR
+?CCL5: ADD TL-X,38 >?TMP3
+ ADD TL-Y,23 >?TMP2
+ ADD TL-X,60 >?TMP1
+ ADD TL-Y,33
+ CALL WITHIN?,?TMP3,?TMP2,?TMP1,STACK
+ ZERO? STACK /?CCL7
+ SET 'DIR,P?EAST
+ RETURN DIR
+?CCL7: ADD TL-Y,23 >?TMP2
+ ADD TL-X,22 >?TMP1
+ ADD TL-Y,33
+ CALL WITHIN?,TL-X,?TMP2,?TMP1,STACK
+ ZERO? STACK /?CCL9
+ SET 'DIR,P?WEST
+ RETURN DIR
+?CCL9: ADD TL-X,37 >?TMP3
+ ADD TL-Y,10 >?TMP2
+ ADD TL-X,48 >?TMP1
+ ADD TL-Y,21
+ CALL WITHIN?,?TMP3,?TMP2,?TMP1,STACK
+ ZERO? STACK /?CCL11
+ SET 'DIR,P?NE
+ RETURN DIR
+?CCL11: ADD TL-X,37 >?TMP3
+ ADD TL-Y,35 >?TMP2
+ ADD TL-X,48 >?TMP1
+ ADD TL-Y,46
+ CALL WITHIN?,?TMP3,?TMP2,?TMP1,STACK
+ ZERO? STACK /?CCL13
+ SET 'DIR,P?SE
+ RETURN DIR
+?CCL13: ADD TL-X,12 >?TMP3
+ ADD TL-Y,35 >?TMP2
+ ADD TL-X,23 >?TMP1
+ ADD TL-Y,46
+ CALL WITHIN?,?TMP3,?TMP2,?TMP1,STACK
+ ZERO? STACK /?CCL15
+ SET 'DIR,P?SW
+ RETURN DIR
+?CCL15: ADD TL-X,12 >?TMP3
+ ADD TL-Y,10 >?TMP2
+ ADD TL-X,23 >?TMP1
+ ADD TL-Y,21
+ CALL WITHIN?,?TMP3,?TMP2,?TMP1,STACK
+ ZERO? STACK /?CCL17
+ SET 'DIR,P?NW
+ RETURN DIR
+?CCL17: ADD TL-X,23 >?TMP3
+ ADD TL-Y,21 >?TMP2
+ ADD TL-X,37 >?TMP1
+ ADD TL-Y,35
+ CALL WITHIN?,?TMP3,?TMP2,?TMP1,STACK
+ ZERO? STACK /FALSE
+ GRTR? MOUSE-LOC-X,CENTER-X \?CCL22
+ LESS? MOUSE-LOC-Y,CENTER-Y \?CCL22
+ SUB MOUSE-LOC-X,CENTER-X >X
+ SUB CENTER-Y,MOUSE-LOC-Y >Y
+ GRTR? X,Y \?CCL27
+ SET 'DIR,P?EAST
+ RETURN DIR
+?CCL27: SET 'DIR,P?NORTH
+ RETURN DIR
+?CCL22: GRTR? MOUSE-LOC-X,CENTER-X \?CCL29
+ SUB MOUSE-LOC-X,CENTER-X >X
+ SUB MOUSE-LOC-Y,CENTER-Y >Y
+ GRTR? X,Y \?CCL32
+ SET 'DIR,P?EAST
+ RETURN DIR
+?CCL32: SET 'DIR,P?SOUTH
+ RETURN DIR
+?CCL29: GRTR? MOUSE-LOC-Y,CENTER-Y \?CCL34
+ SUB CENTER-X,MOUSE-LOC-X >X
+ SUB MOUSE-LOC-Y,CENTER-Y >Y
+ GRTR? X,Y \?CCL37
+ SET 'DIR,P?WEST
+ RETURN DIR
+?CCL37: SET 'DIR,P?SOUTH
+ RETURN DIR
+?CCL34: SUB CENTER-X,MOUSE-LOC-X >X
+ SUB CENTER-Y,MOUSE-LOC-Y >Y
+ GRTR? X,Y \?CCL40
+ SET 'DIR,P?WEST
+ RETURN DIR
+?CCL40: SET 'DIR,P?NORTH
+ RETURN DIR
+
+
+ .FUNCT MAC-II-CLICK,CENTER-X,CENTER-Y,X,Y,DIR,?TMP1
+ GRTR? MOUSE-LOC-X,CENTER-X \?CCL3
+ LESS? MOUSE-LOC-Y,CENTER-Y \?CCL3
+ SUB MOUSE-LOC-X,CENTER-X >X
+ SUB CENTER-Y,MOUSE-LOC-Y >Y
+ MUL X,TANGENT-VALUE >?TMP1
+ MUL Y,100
+ GRTR? ?TMP1,STACK \?CCL8
+ SET 'DIR,P?EAST
+ RETURN DIR
+?CCL8: MUL Y,TANGENT-VALUE >?TMP1
+ MUL X,100
+ GRTR? ?TMP1,STACK \?CCL10
+ SET 'DIR,P?NORTH
+ RETURN DIR
+?CCL10: SET 'DIR,P?NE
+ RETURN DIR
+?CCL3: GRTR? MOUSE-LOC-X,CENTER-X \?CCL12
+ SUB MOUSE-LOC-X,CENTER-X >X
+ SUB MOUSE-LOC-Y,CENTER-Y >Y
+ MUL X,TANGENT-VALUE >?TMP1
+ MUL Y,100
+ GRTR? ?TMP1,STACK \?CCL15
+ SET 'DIR,P?EAST
+ RETURN DIR
+?CCL15: MUL Y,TANGENT-VALUE >?TMP1
+ MUL X,100
+ GRTR? ?TMP1,STACK \?CCL17
+ SET 'DIR,P?SOUTH
+ RETURN DIR
+?CCL17: SET 'DIR,P?SE
+ RETURN DIR
+?CCL12: GRTR? MOUSE-LOC-Y,CENTER-Y \?CCL19
+ SUB CENTER-X,MOUSE-LOC-X >X
+ SUB MOUSE-LOC-Y,CENTER-Y >Y
+ MUL X,TANGENT-VALUE >?TMP1
+ MUL Y,100
+ GRTR? ?TMP1,STACK \?CCL22
+ SET 'DIR,P?WEST
+ RETURN DIR
+?CCL22: MUL Y,TANGENT-VALUE >?TMP1
+ MUL X,100
+ GRTR? ?TMP1,STACK \?CCL24
+ SET 'DIR,P?SOUTH
+ RETURN DIR
+?CCL24: SET 'DIR,P?SW
+ RETURN DIR
+?CCL19: SUB CENTER-X,MOUSE-LOC-X >X
+ SUB CENTER-Y,MOUSE-LOC-Y >Y
+ MUL X,TANGENT-VALUE >?TMP1
+ MUL Y,100
+ GRTR? ?TMP1,STACK \?CCL27
+ SET 'DIR,P?WEST
+ RETURN DIR
+?CCL27: MUL Y,TANGENT-VALUE >?TMP1
+ MUL X,100
+ GRTR? ?TMP1,STACK \?CCL29
+ SET 'DIR,P?NORTH
+ RETURN DIR
+?CCL29: SET 'DIR,P?NW
+ RETURN DIR
+
+
+ .FUNCT SAY-HERE,X
+ ICALL2 DPRINT,HERE
+ LOC PROTAGONIST >X
+ IN? PROTAGONIST,CARD-TABLE \?CCL3
+ PRINTI ", at"
+ ICALL2 TPRINT,X
+ RTRUE
+?CCL3: EQUAL? X,HERE /?CCL5
+ FSET? X,VEHBIT \?CCL5
+ PRINTI ", "
+ FSET? X,INBIT \?CCL10
+ PRINTC 105
+ JUMP ?CND8
+?CCL10: PRINTC 111
+?CND8: PRINTC 110
+ ICALL2 TPRINT,X
+ RTRUE
+?CCL5: ZERO? UNDER-TABLE /TRUE
+ PRINTI ", under the table"
+ RTRUE
+
+
+ .FUNCT CENTER-1,STR,BOLD,Y,X,LEN
+ CURGET SLINE
+ GET SLINE,0 >Y
+ WINGET S-TEXT,WWIDE
+ DIV STACK,2 >X
+ ZERO? BOLD /?CND1
+ HLIGHT H-BOLD
+?CND1: DIROUT D-TABLE-ON,SLINE,-80
+ PRINT STR
+ DIROUT D-TABLE-OFF
+ GET 0,24 >LEN
+ DIV LEN,2
+ SUB X,STACK
+ CURSET Y,STACK
+ PRINT STR
+ HLIGHT H-NORMAL
+ CRLF
+ RTRUE
+
+
+ .FUNCT CENTER-2,STR1,STR2,Y,X1,X2,LEN
+ CURGET SLINE
+ GET SLINE,0 >Y
+ WINGET S-TEXT,WWIDE
+ DIV STACK,3 >X1
+ MUL X1,2 >X2
+ DIROUT D-TABLE-ON,SLINE,-80
+ PRINT STR1
+ DIROUT D-TABLE-OFF
+ GET 0,24 >LEN
+ DIV LEN,2
+ SUB X1,STACK
+ CURSET Y,STACK
+ PRINT STR1
+ DIROUT D-TABLE-ON,SLINE,-80
+ PRINT STR2
+ DIROUT D-TABLE-OFF
+ GET 0,24 >LEN
+ DIV LEN,2
+ SUB X2,STACK
+ CURSET Y,STACK
+ PRINT STR2
+ CRLF
+ RTRUE
+
+
+ .FUNCT CENTER-3,STR1,STR2,STR3,Y,X1,X2,X3,LEN
+ CURGET SLINE
+ GET SLINE,0 >Y
+ WINGET S-TEXT,WWIDE
+ DIV STACK,4 >X1
+ MUL X1,2 >X2
+ MUL X1,3 >X3
+ DIROUT D-TABLE-ON,SLINE,-80
+ PRINT STR1
+ DIROUT D-TABLE-OFF
+ GET 0,24 >LEN
+ DIV LEN,2
+ SUB X1,STACK
+ CURSET Y,STACK
+ PRINT STR1
+ DIROUT D-TABLE-ON,SLINE,-80
+ PRINT STR2
+ DIROUT D-TABLE-OFF
+ GET 0,24 >LEN
+ DIV LEN,2
+ SUB X2,STACK
+ CURSET Y,STACK
+ PRINT STR2
+ DIROUT D-TABLE-ON,SLINE,-80
+ PRINT STR3
+ DIROUT D-TABLE-OFF
+ GET 0,24 >LEN
+ DIV LEN,2
+ SUB X3,STACK
+ CURSET Y,STACK
+ PRINT STR3
+ CRLF
+ RTRUE
+
+
+ .FUNCT TOUCHING?,THING
+ EQUAL? PRSO,THING \?CCL3
+ EQUAL? PRSA,V?BITE,V?CLEAN,V?CLIMB /TRUE
+ EQUAL? PRSA,V?CLIMB-DOWN,V?CLIMB-ON,V?CLIMB-UP /TRUE
+ EQUAL? PRSA,V?CLOSE,V?CUT,V?EAT /TRUE
+ EQUAL? PRSA,V?ENTER,V?KICK,V?KILL /TRUE
+ EQUAL? PRSA,V?KISS,V?KNOCK,V?LOCK /TRUE
+ EQUAL? PRSA,V?LOOK-BEHIND,V?LOOK-INSIDE,V?LOOK-UNDER /TRUE
+ EQUAL? PRSA,V?MOVE,V?MUNG,V?OFF /TRUE
+ EQUAL? PRSA,V?ON,V?OPEN,V?PUSH /TRUE
+ EQUAL? PRSA,V?RAISE,V?REACH-IN,V?SEARCH /TRUE
+ EQUAL? PRSA,V?SET,V?SHAKE,V?STAND-ON /TRUE
+ EQUAL? PRSA,V?SWIM,V?TASTE,V?TAKE /TRUE
+ EQUAL? PRSA,V?THROW,V?TIE,V?TOUCH /TRUE
+ EQUAL? PRSA,V?UNLOCK /TRUE
+?CCL3: EQUAL? PRSI,THING \FALSE
+ EQUAL? PRSA,V?PUT-ON,V?PUT,V?GIVE /TRUE
+ RFALSE
+
+
+ .FUNCT HANDLE,OBJ
+ EQUAL? OBJ,PRSO \?PRD5
+ CALL2 EVERYWHERE-VERB?,1
+ ZERO? STACK \FALSE
+?PRD5: EQUAL? OBJ,PRSI \TRUE
+ CALL2 EVERYWHERE-VERB?,2
+ ZERO? STACK /TRUE
+ RFALSE
+
+
+ .FUNCT CANT-SEE,OBJ,STRING,WRD
+ CALL2 GET-NP,OBJ >WRD
+ ZERO? WRD /?CND1
+ GET WRD,2 >WRD
+?CND1: SET 'P-WON,FALSE-VALUE
+ PRINTC 91
+ PRINT YOU-CANT
+ PRINTI "see"
+ ZERO? OBJ /?CCL4
+ ZERO? WRD /?CND3
+ CALL2 CAPITAL-NOUN?,WRD
+ ZERO? STACK \?CND3
+?CCL4: PRINTI " any"
+?CND3: ZERO? OBJ \?CCL11
+ PRINTC 32
+ PRINT STRING
+ JUMP ?CND9
+?CCL11: EQUAL? OBJ,PRSI \?CCL13
+ ICALL1 PRSI-PRINT
+ JUMP ?CND9
+?CCL13: ICALL1 PRSO-PRINT
+?CND9: PRINTI " here.]"
+ CRLF
+ CALL1 STOP
+ RSTACK
+
+
+ .FUNCT PRSO-PRINT,PTR
+ CALL NOUN-USED?,PRSO,W?IT
+ ZERO? STACK /?CCL3
+ PRINTC 32
+ CALL2 DPRINT,PRSO
+ RSTACK
+?CCL3: PRINTC 32
+ CALL2 GET-NP,PRSO
+ CALL2 NP-PRINT,STACK
+ RSTACK
+
+
+ .FUNCT PRSI-PRINT,PTR
+ CALL NOUN-USED?,PRSI,W?IT
+ ZERO? STACK /?CCL3
+ PRINTC 32
+ CALL2 DPRINT,PRSI
+ RSTACK
+?CCL3: PRINTC 32
+ CALL2 GET-NP,PRSI
+ CALL2 NP-PRINT,STACK
+ RSTACK
+
+
+ .FUNCT CANT-VERB-A-PRSO,STRING
+ PRINT YOU-CANT
+ PRINT STRING
+ ICALL2 APRINT,PRSO
+ PRINTR "!"
+
+
+ .FUNCT TELL-HIT-HEAD
+ PRINTI "You hit your head against"
+ ICALL1 TPRINT-PRSO
+ PRINTR " as you attempt this feat."
+
+
+ .FUNCT OPEN-CLOSED,OBJ
+ FSET? OBJ,OPENBIT \?CCL3
+ PRINTI "open"
+ RTRUE
+?CCL3: PRINTI "closed"
+ RTRUE
+
+
+ .FUNCT CANT-REACH,OBJ
+ ZERO? HAND-IN-WALDO /?CCL3
+ EQUAL? OBJ,WALDO /?CCL3
+ IN? OBJ,HERE \?CCL3
+ PRINTR "The waldo doesn't seem capable of that."
+?CCL3: ZERO? UNDER-TABLE /?CCL8
+ PRINT YOULL-HAVE-TO
+ PRINTR "get out from under the table in order to reach it."
+?CCL8: PRINT YOU-CANT
+ PRINTI "reach"
+ ICALL2 TPRINT,OBJ
+ IN? PROTAGONIST,HERE /?CND9
+ PRINTI " from"
+ LOC PROTAGONIST
+ ICALL2 TPRINT,STACK
+?CND9: PRINT PERIOD-CR
+ RTRUE
+
+
+ .FUNCT DO-FIRST,STRING,OBJ
+ PRINT YOULL-HAVE-TO
+ PRINT STRING
+ ZERO? OBJ /?CND1
+ ICALL2 TPRINT,OBJ
+?CND1: PRINTR " first."
+
+
+ .FUNCT NOT-IN
+ PRINTI "But"
+ ICALL2 IS-ARE-PRINT,PRSO
+ PRINTI "not "
+ FSET? PRSI,ACTORBIT \?CCL3
+ PRINTI "being held by"
+ JUMP ?CND1
+?CCL3: FSET? PRSI,SURFACEBIT \?CCL5
+ PRINTI "on"
+ JUMP ?CND1
+?CCL5: PRINTI "in"
+?CND1: CALL2 TRPRINT,PRSI
+ RSTACK
+
+
+ .FUNCT PART-OF
+ PRINT YOU-CANT
+ PRINTI "--"
+ ICALL2 IS-ARE-PRINT,PRSO
+ PRINTI "an integral part of"
+ LOC PRSO
+ CALL2 TRPRINT,STACK
+ RSTACK
+
+
+ .FUNCT RECOGNIZE
+ SET 'P-WON,FALSE-VALUE
+ PRINTR "[Sorry, but I don't understand. Please rephrase that or try something else.]"
+
+
+ .FUNCT PRONOUN
+ EQUAL? PRSO,ME \?CCL3
+ PRINTI "You"
+ RTRUE
+?CCL3: EQUAL? PRSO,WHITE-CASTLE \?CCL5
+ CALL NOUN-USED?,WHITE-CASTLE,W?MAN
+ ZERO? STACK \?CCL5
+ PRINTI "It"
+ RTRUE
+?CCL5: FSET? PRSO,PLURALBIT \?CCL9
+ PRINTI "They"
+ RTRUE
+?CCL9: FSET? PRSO,FEMALEBIT \?CCL11
+ PRINTI "She"
+ RTRUE
+?CCL11: FSET? PRSO,ACTORBIT \?CCL13
+ PRINTI "He"
+ RTRUE
+?CCL13: PRINTI "It"
+ RTRUE
+
+
+ .FUNCT HIT-ANY-KEY,STRING
+ PRINTI "[Hit any key to "
+ ZERO? STRING /?CCL3
+ PRINTI "begin playing "
+ PRINT STRING
+ JUMP ?CND1
+?CCL3: PRINTI "continue"
+?CND1: PRINTI ".]"
+ DIROUT D-SCREEN-OFF
+ CRLF
+ DIROUT D-SCREEN-ON
+ ZERO? DEMO-VERSION? /?CCL6
+ ICALL2 INPUT-DEMO,1
+ JUMP ?CND4
+?CCL6: INPUT 1
+?CND4: CALL1 MOUSE-INPUT?
+ RSTACK
+
+
+ .FUNCT LOCKED-UNLOCKED,OBJ,UN
+ PRINTI "A faint click indicates that"
+ ICALL2 TPRINT,OBJ
+ PRINTI " is now "
+ ZERO? UN /?CND1
+ PRINTI "un"
+?CND1: PRINTR "locked."
+
+
+ .FUNCT CANT-TURN,STRING
+ PRINT YOU-CANT
+ PRINTI "turn that o"
+ PRINT STRING
+ PRINT PERIOD-CR
+ RTRUE
+
+
+ .FUNCT YOU-MUST-TELL-ME
+ PRINTI "You must tell me how to do that to"
+ CALL2 ARPRINT,PRSO
+ RSTACK
+
+
+ .FUNCT GRUE-PIT-WARNING
+ IN? PROTAGONIST,DB /?CND1
+ ZERO? TIME-STOPPED \?CND1
+ EQUAL? HERE,PIT-BOMB-LOC /?CND1
+ PRINTI " You are likely to "
+ FSET? LANTERN,TRYTAKEBIT \?CCL8
+ PRINTR "fall into a bottomless pit."
+?CCL8: PRINTR "be eaten by a grue."
+?CND1: CRLF
+ RTRUE
+
+
+ .FUNCT DARK-DEATH
+ PRINTI "Oh, no! You have "
+ FSET? LANTERN,TRYTAKEBIT \?CCL3
+ PRINTI "fallen into a bottomless pit"
+ JUMP ?CND1
+?CCL3: PRINTI "walked into the slavering fangs of a lurking grue"
+?CND1: CALL2 JIGS-UP,STR?135
+ RSTACK
+
+ .ENDSEG
+
+ .ENDI
diff --git a/globals.zil b/globals.zil
new file mode 100644
index 0000000..2fcf4f7
--- /dev/null
+++ b/globals.zil
@@ -0,0 +1,2460 @@
+"GLOBALS for
+
+ ZORK ZERO
+ (c) Copyright 1988 Infocom, Inc. All Rights Reserved."
+
+;<BEGIN-SEGMENT 0>
+
+<INCLUDE "BASEDEFS" "FIND" "PDEFS">
+
+<ADJ-SYNONYM LARGE HUGE BIG GIANT GIGANTIC TREMENDOUS MIGHTY MASSIVE ENORMOUS
+ ;"LARGER HUGER BIGGER MIGHTIER">
+
+<ADJ-SYNONYM SMALL SMALLER TINY TINIER LITTLE PETITE TEENSY WEENSY>
+
+;<ADJ-SYNONYM MY MINE> ;"screws up parsing of Iron Mine and Granola Mine"
+
+<GLOBAL LIT T>
+
+<GLOBAL MOVES 0>
+
+<GLOBAL SCORE 0>
+
+<GLOBAL HERE:OBJECT BANQUET-HALL>
+
+<OBJECT GLOBAL-OBJECTS
+ ;(SYNONYM ZZMGCK) ;"No, this synonym doesn't need to exist... sigh"
+ (DESC "it")
+ (FLAGS INVISIBLE TOUCHBIT SURFACEBIT TRYTAKEBIT OPENBIT SEARCHBIT
+ TRANSBIT WEARBIT ONBIT LIGHTBIT RLANDBIT WORNBIT INTEGRALBIT
+ VEHBIT OUTSIDEBIT CONTBIT VOWELBIT LOCKEDBIT NDESCBIT DOORBIT
+ ACTORBIT PARTBIT INBIT FEMALEBIT KLUDGEBIT DROPBIT BURNBIT
+ ORBBIT FLAMEBIT NALLBIT KEYBIT UNDERGROUNDBIT REDESCBIT)>
+
+<OBJECT LOCAL-GLOBALS
+ (LOC GLOBAL-OBJECTS)
+ (DESC "it")
+ ;(SYNONYM ZZMGCK)
+ ;(DESCFCN 0)
+ ;(GLOBAL GLOBAL-OBJECTS)
+ ;(FDESC "F")
+ ;(LDESC "F")
+ ;(SIZE 0)
+ ;(TEXT "")
+ ;(CAPACITY 0)
+ ;(GENERIC ME-F)>
+
+<OBJECT ROOMS
+ ;(IN TO ROOMS)
+ (DESC "it")>
+
+<OBJECT INTNUM
+ (LOC GLOBAL-OBJECTS)
+ (DESC "number")
+ (SYNONYM NUMBER NUMBERS INT.NUM)
+ (ADJECTIVE INT.NUM INT.TIM)
+ (ACTION INTNUM-F)>
+
+<BEGIN-SEGMENT 0>
+
+<ROUTINE INTNUM-F ("AUX" X)
+ <COND (<AND <EQUAL? ,HERE ,CONSTRUCTION>
+ <NOUN-USED? ,INTNUM ,W?NUMBER>>
+ <TELL
+"The number engraved on the wall is \"" N ,CONSTRUCTION-LOC ".\"" CR>)>>
+
+<END-SEGMENT>
+
+<OBJECT IT
+ (LOC GLOBAL-OBJECTS)
+ (SYNONYM IT ;THEM)
+ (DESC "it")
+ (FLAGS VOWELBIT NARTICLEBIT TOUCHBIT)>
+
+<OBJECT HIM
+ (LOC GLOBAL-OBJECTS)
+ (SYNONYM HIM HIMSELF)
+ (DESC "him")
+ (FLAGS NARTICLEBIT TOUCHBIT)>
+
+<OBJECT HER
+ (LOC GLOBAL-OBJECTS)
+ (SYNONYM HER HERSELF)
+ (DESC "her")
+ (FLAGS NARTICLEBIT TOUCHBIT)>
+
+<OBJECT LEFT-RIGHT
+ (LOC GLOBAL-OBJECTS)
+ (DESC "that way")
+ (SYNONYM LEFT RIGHT)
+ (FLAGS NARTICLEBIT)
+ (ACTION LEFT-RIGHT-F)>
+
+<BEGIN-SEGMENT 0>
+
+<ROUTINE LEFT-RIGHT-F ()
+ <COND (<VERB? CHASTISE> ;"LOOK LEFT or LOOK RIGHT"
+ <TELL "You see nothing unusual." CR>)
+ (<VERB? WALK WALK-TO ENTER>
+ <COND (<AND <EQUAL? ,HERE ,WEIRD>
+ <NOUN-USED? ,LEFT-RIGHT ,W?LEFT>
+ <EQUAL? ,TOWER-BEATEN ,PYRAMID-L>>
+ <DO-WALK ,P?WEST>)
+ (<AND <EQUAL? ,HERE ,WEIRD>
+ <NOUN-USED? ,LEFT-RIGHT ,W?RIGHT>
+ <EQUAL? ,TOWER-BEATEN ,PYRAMID-R>>
+ <DO-WALK ,P?EAST>)
+ (<EQUAL? ,HERE ,TESTING-ROOM>
+ <PERFORM ,V?ENTER
+ <COND (<NOUN-USED? ,LEFT-RIGHT ,W?RIGHT>
+ ,RIGHT-BOOTH)
+ (T
+ ,LEFT-BOOTH)>>)
+ (T
+ <V-WALK-AROUND>)>)
+ (<VERB? SET>
+ <TELL "You turn ninety degrees, with little effect." CR>)>>
+
+<END-SEGMENT>
+<BEGIN-SEGMENT CASTLE>
+
+<OBJECT GRUE
+ (LOC GLOBAL-OBJECTS)
+ (SYNONYM GRUE GRUES)
+ (ADJECTIVE LURKING SINISTER HUNGRY SILENT)
+ (DESC "lurking grue")
+ (RESEARCH
+"\"The grue was once a sinister, lurking presence in the dark places of the
+earth. Its favorite diet was adventurers, but its insatiable appetite was
+tempered by its fear of light. No grue was ever seen by the light of day,
+and few ever survived its fearsome jaws to tell the tale.\"|
+ The encyclopedia goes on to say, \"Grues were eradicated from the face of
+the world during the time of Entharion, many by his own hand and his legendary
+blade Grueslayer. Although it has now been many a century since the last grue
+sighting, old hags still delight in scaring children by telling them that
+grues still lurk in the bottomless pits of the Empire, and will one day lurk
+forth again.\"")
+ (ACTION GRUE-F)>
+
+<END-SEGMENT>
+<BEGIN-SEGMENT 0>
+
+<ROUTINE GRUE-F ()
+ <COND (<VERB? EXAMINE FIND>
+ <COND (<FSET? ,LANTERN ,TRYTAKEBIT>
+ <TELL
+"Don't be silly! There haven't been grues around for centuries!" CR>)
+ (T
+ <TELL
+"There is no grue here, but I'm sure there is at least one lurking
+in the darkness nearby.">
+ <COND (<AND <FIND-IN ,PROTAGONIST ,ONBIT>
+ <NOT <FSET? ,HERE ,ONBIT>>>
+ <TELL
+" I wouldn't let my light go out if I were you!" CR>)>)>)>>
+
+<OBJECT SAILOR
+ (LOC GLOBAL-OBJECTS)
+ (DESC "sailor")
+ (SYNONYM SAILOR)
+ (ACTION SAILOR-F)>
+
+<ROUTINE SAILOR-F ("OPT" (ARG <>))
+ <COND (<EQUAL? .ARG ,M-WINNER>
+ <COND (<VERB? HELLO>
+ <TELL "Nothing happens here." CR>)
+ (T
+ <CANT-SEE ,SAILOR>)>)
+ (<VERB? WAIT-FOR>
+ <TELL "You are liable to be waiting for several sequels." CR>)
+ (<AND <HANDLE ,SAILOR>
+ <NOT <VERB? TELL HELLO>>>
+ <CANT-SEE ,SAILOR>)>>
+
+<OBJECT GLOBAL-SLEEP
+ (LOC GLOBAL-OBJECTS)
+ (DESC "sleep")
+ (SYNONYM SLEEP NAP SNOOZE)
+ (FLAGS NARTICLEBIT)
+ (ACTION GLOBAL-SLEEP-F)>
+
+<ROUTINE GLOBAL-SLEEP-F ()
+ <COND (<VERB? WALK-TO TAKE>
+ <V-SLEEP>)
+ (<AND <VERB? PUT-TO>
+ <PRSI? ,GLOBAL-SLEEP>>
+ <COND (<PRSO? ,BEDBUG>
+ <TELL "You sing a brief lullaby. ">
+ <REMOVE-BEDBUG "hear">)
+ (T
+ <TELL "You're not a hypnotist." CR>)>)>>
+
+<OBJECT LULLABY
+ (LOC GLOBAL-OBJECTS)
+ (DESC "lullaby")
+ (SYNONYM LULLABY LULLABYE SONG)
+ (ACTION LULLABY-F)>
+
+<ROUTINE LULLABY-F ("AUX" ACTOR)
+ <COND (<VERB? SING>
+ <COND (<NOT ,PRSI>
+ <COND (<IN? ,BEDBUG ,HERE>
+ <SETG PRSI ,BEDBUG>)
+ (<SET ACTOR <FIND-IN ,HERE ,ACTORBIT>>
+ <SETG PRSI .ACTOR>)
+ (T
+ <TELL
+"[If you put me to sleep, you'd have a heck of a time communicating with the
+game! By the way, don't expect any offers from the Borphee Opera Company.]" CR>