Neil Cerutti
cerutti@together.net
These pages were last updated on August 17, 2000

The Inform Port of Ditch Day Drifter

An Example Game

Introduction

This is the HTML version of the Inform port of Mike Robert's TADS example game, Ditch Day Drifter. Copyright and licensing information is contained in the comment in the file "ditch.inf".

This port was done with the goal of helping new Inform programmers. To that end, the code is commented more heavily than an every-day program. The comments are sometimes not specific to the program, but are instead of general interest to Inform programmers.

An HTML version was made available to give the source code a wider audience. HTML markup was used to make the source code easier to navigate.

Using this document

The source code to Ditch Day Drifter will be much more useful to you after playing through the game. At the very least, a short play session using the walkthrough helps to make sense of the structure of the source code. If you find an object or an interaction in the game that you are curious about, it is easy to quickly navigate to that section of the source code using the Table of contents.

To play the game, you'll need to unzip the compiled game file, ditchday.zip, and a working interpreter.

As an alternative to playing the game, you can read this saved transcript of a complete play session created using the walkthrough.

Playing the game can also be helpful for testing sections of the code that you find confusing. Using the standard Inform debugging commands, you can quickly jump to the section you would like to play through. For example, if you want to try interacting with the security guard, start up a play session and type GONEAR GUARD. If you find you need the funnel, type PURLOIN FUNNEL.

Playing the game without cheating or using a walkthrough is the best way to get to know Ditch Day Drifter. Thanks to Mike Roberts, it's well designed, funny, and challenging. You will make the most of this source code if you know the game.

Some other stuff you may find useful

iditchs.zip      the plain source code
iditchs-html.zip the html version of the source code
fulltest.txt     an elaborate test script

Differences from the original TADS example game

This version of Ditch Day Drifter is slightly different from the original version of the game. It contains many more verbs and possible actions than in the original, but only for educational purposes. With Mike's permission, it introduces a few alternate solutions to puzzles which seemed logical.

However, the walkthroughs for the two version are identical. A transcript of a game created using the walkthrough in the Inform version of the game will be practically identical to a transcript made using the original TADS game. No effort has been made to make the Inform standard library act more like the TADS standard library, though it would have been worth it in some places.

Contacting the author

You can reach the author and maintainer of this port at cerutti@together.net to sound off, positive, negative or undecided. Especially for new Inform authors who read this site: please let me know if there are comments or code that you find confusing.

To do

When the new version of the Inform Designer's Manual by Graham Nelson is released, comments with referals to the proper section of the new Manual will be added. Hopefully, this will make the Inform port of Ditch Day Drifter more valuable as an example game.

Syntax highlighting

The Inform code in this document is syntax highlighted. To see the colors, you will need a browser that supports color and CSS ( Cascading Style Sheets).

Special thanks go to Stephen Thomas, Bram Moolenaar, and the group of dedicated people responsible for Vim, an excellent text editor.

Special apologies to those with eyes sensitive to the blinding white background. If you would like to create a style sheet for a black background version, or if you have suggestions for improvements of the current colors, please let me know.

Color key

has
Keyword
! Hello
Comment
"Hello."
String
'small'
Dictionary word
animate
Library attribute
description
Library property
Story
Library constant
children
Library routine
self
Library object
verb_word
Library variable

Table of contents

"ditch.inf" 

   Include directives

"conrep.inf"

   CONSTANTS (A)
   REPLACE DIRECTIVES (B)

"surface.inf"

   THE DORM BUILDING (1) 
     Room Three (1.1) 
       small wooden desk (1.1.1)
         desk drawer (1.1.1.2)
  
    Crawlable class (C)
  
       food item (1.1.2)
       waste basket (1.1.3)
         plastic bottle (1.1.3.1)
          attributes, name, description (1.1.3.1a)
          invent (1.1.3.1b)
          poured_into (1.1.3.1c)
          before (1.1.3.1d)
          number, daemon (1.1.3.1e)
          after (1.1.3.1f)
           bottle cap (1.1.3.1.1)
       bed (1.1.4)
       one-dollar bill (1.1.5)
     Alley One (1.2)
       alley one door (1.2-3.1)
  
    Treasure class (D)
  
       treasure slot (1.2.1.1)
       welcome sign (1.2.1.2)
     Room Four (1.3)
       win note (1.3.1)
       warp motivator (1.3.2)
     Alley One North (1.4)
     Computer Room (1.5)
       computer (1.5.1)
       students (1.5.2)
        attributes, name, description, describe, life (1.5.2a)
        orders, greet, react_before, number (1.5.2b)
        each_turn (1.5.2c)
     Breezeway (1.6)
     Courtyard (1.7)
     Lounge (1.8)
     Dining Room (1.9)
       wooden table (1.9.1)
         fish protein module (1.9.1.1)
         coffee cup (1.9.1.2)
     Kitchen (1.10)
       ToxiCola(tm) machine (1.10.1)
         ToxiCola(tm) button (1.10.1.1)
         ToxiCola(tm) (1.10.1.2)
  
   THE CAMPUS (2)
     Orange Walk 1 (2.1)
     Orange Walk 2 (2.2)
       orange trees (2.1-2.1)
     Quad (2.3)
  
    Crowd class (E)
  
       leak students (2.3.1)
       reporters (2.3.2)
       flask (2.3.3)
    
    LiquidNitrogen class (F)
  
         original liquid nitrogen (2.3.3.1)
         bottled liquid nitrogen (2.3.3.2)
     B&G (2.4)
       B&G memo (2.4.1)
     Health Center (2.5)
       
    SimpleDesk class (G)
    
       health desk (2.5.1)
         health memo (2.5.1.1)
     Walkway 1 (2.6)
     Walkway 2 (2.7)
     Biology Building (2.8)
       biology notebook (2.8.1)
     Explosive Lab (2.9)
       explosives thesis (2.9.1)
     Bookstore (2.10)
       battery (2.10.1)
    
    buy_obj global (H)
  
       clerk (2.10.2)
     Behavior Lab (2.11)
       bahavior door south (2.11.1)
     Maze Viewing Room (2.12)
       maze window (2.12.1)
       maze plaque (2.12.2)
     Security Office (2.13)
       security desk (2.13.1)
         security memo (2.13.1.1)
         flashlight (2.13.1.2)

"gue.inf"

   HALLWAYS (3)
     Hallway 1 (3.1)
     Hallway 2 (3.2)
     Hallway 3 (3.3)
     Laundry Room (3.4)
       washing machine (3.4.1)
         blue jeans (3.4.1.1)
           master key (3.4.1.1.1)
     Hallway 4 (3.5)
     Hallway 5 (3.6)
     Hallway 6 (3.7)
     Storage Room (3.8)
       guard (3.8.1)
        attributes, name, description, initial, act (3.8.1a)
        greet, number, tied_to (3.8.1b)
        react_before (3.8.1c)
        react_after, orders (3.8.1d)
        life (3.8.1e)
        each_turn, before (3.8.1f)
         memo pad (3.8.1.1)
       card table (3.8.2)
         empty glass (3.8.2.1)
       tunnel door (3.8.3)
  
   STEAM TUNNELS (4)
     tunnel pipes (4.*)
  
    TunnelRoom class (I)
    DarkTunnelRoom class (J)
  
     Tunnel 1 (4.1)
     Tunnel 2 (4.2)
     Tunnel 3 (4.3)
     Tunnel 4 (4.4)
     Tunnel 5 (4.4)
     Tunnel 6 (4.6)
     Tunnel 7 (4.7)
       tight passage (4.7.1)
     Tunnel 8 (4.8)
       control unit (4.8.1)
         control keypad (4.8.1.1)
         control display (4.8.1.2)
         control button (4.8.1.3)
     Tunnel 9 (4.9)
     Tunnel 10 (4.10)
     Tunnel 11 (4.11)
       chute top (4.11.1)
     Tunnel 12 (4.12)
     Tunnel 13 (4.13)
     Tunnel Storage (4.14)
       rope (4.14.1)
     Top of Pit (4.15)
       pit top (4.15.1)
       railing (4.15.2)
     
   GREAT UNDERGRADUATE EXCAVATION (5) 
     Huge Cavern (5.1)
       pit rope (5.1.1)
       pit plaque (5.1.2)
     Chute Room (5.2)
       chute bottom (5.2.1)
     Machine Room (5.3)
       machine (5.3.1)
         machine button (5.3.1.1)
     Machine Storage (5.4)
       Mr. Happy Gear (5.4.1)
     Bank (5.5)
     Vault Room (5.6)
       safe (5.6.1)
         deposit slot (5.6.1.1)
         DarbCard (5.6.1.2)
     Insurance Office (5.7)
     Tunnel (5.8)
     Subway Station 1 (5.9)
       rail car (5.9.1)
         coolant guage (5.9.1.1)
         coolant hole (5.9.1.2)
         ignition button (5.9.1.3)
         rail car instructions (5.9.1.4)
       tunnel mouth (5.9-11.2)
     Rail Tunnel (5.10)
     Subway Station 2 (5.11)
     Computer Center (5.12)
       computer equipment (5.12.1)
       A Million Random Digits (5.12.2)
     Bio Hall 1 (5.13)
     Bio Lab (5.14)
       strange equipment (5.14.1)
       lab bench (5.14.2)
         CloneMaster (5.14.2.1)
           CloneMaster button (5.14.2.1.1)
         funnel (5.14.2.2)
       cabinet (5.14.3)
  
    ChemItem class (K)
  
         GF-XQ3 (5.14.3.1)
         GF-XQ9 (5.14.3.2)
         Poly Red (5.14.3.3)
         Poly Blue (5.14.3.4)
         Compound T99 (5.14.3.5)
         Compount T30 (5.14.3.6)
     Bio Hall 2 (5.15)
       slime creature (5.15.1)
         slime (5.15.1.1)
     Bio Office (5.16)
       bio desk (5.16.1)
         The Great Seal of the Omega (5.16.1.1)
     Spaceship Room (5.17)
       spaceship (5.17.1)
         warp motivator socket (5.17.1.1)
     Spaceship Interior (5.18)
       launch button (5.18.1)

"maze.inf"

   MAZE (6)
     Outside Maze (6.1)
       maze equipment (6.1.1)
       maze view (6.1.2)
  
    exits property (L)
    MazeRoom class (M)
  
     Maze Room 1 (6.2)
     Maze Room 2 through 35 (6.3)
     Start of Maze (6.4)
       behavior door north (6.4.1)

"lloyd.inf"

   LLOYD (7) 
  
    status property (N)
    Lloyd's status constants (O)
  
     Lloyd (7.1)
      attributes, parse_name (7.1a)
      status (7.1b)
      description (7.1c)
      describe (7.1d)
      daemon (7.1e)
      orders (7.1f)
      life (7.1g)
      act (7.1h)
      react_before (7.1i)
      greet (7.1j)
       insurance policy (7.1.1)
       five-dollar bill (7.1.2)

"entrypts.inf"

   ENTRY POINTS (8)
     AfterPrompt (8.1)
     ChooseObjects (8.2)
     InScope (8.3)
     Initialise (8.4)
     PrintRank (8.5)
     PrintVerb (8.6)

"verbs.inf"

   SPECIAL PARSING ROUTINES (9)
     noun=Routine tokens (9.1)
       AssumeKey (9.1.1)
       AssumeKeyboard (9.1.2)
       AssumeNotAnimate (9.1.3)
       AssumeRailing (9.1.4)
       AssumeRope (9.1.5)
    
    knock_knock_joke global (P)
  
     General Parsing Routines (9.2)
       TopicOn (9.2.1)
       topic object (9.2.2)
       MatchMultiWordNothingHeld (9.2.3)
       ParseAnything (9.2.4)
       ParseThere (9.2.5)
       ParseWho (9.2.6)
  
   GRAMMAR (10)
     climb up/down (10.1)
       ClimbUpSub (10.1.1)
       ClimbDownSub (10.1.2)
     drink (10.2)
       DrinkSub (10.2.1)
     drop (10.3)
       DropAllErrorSub (10.3.1)
     eye (10.4)
     fill (10.5)
       Liquid (10.5.1)
       FillSub (10.5.2)
     hello (10.6)
       HelloSub (10.6.1)
     jump into/on/off (10.7)
       JumpIntoSub (10.7.1)
       JumpOnSub (10.7.2)
     kick down/over/open (10.8)
     knock (10.9)
       'knock-knock' (10.9.1)
       KnockSub (10.9.2)
       KnockInsultSub (10.9.3)
       KnockOnSub (10.9.4)
       "who's" (10.9.5)
       'who' (10.9.6)
       WhosThereSub (10.9.7)
       'madame' (10.9.8)
       NonVerbSub (10.9.9)
       MadameWhoSub (10.9.10)
     lock and unlock (10.10)
     look out (10.11)
     make (10.12)
       MakeSub (10.12.1)
     paying for things (10.13)
       'pay' (10.13.1)
       'bribe' (10.13.2)
       'purchase' (10.13.3)
       PayInanimateSub (10.13.4)
       PaySub (10.13.5)
       PayForSub (10.13.6)
       PayCreatureForThingSub (10.13.7)
       PayThingForThingSub (10.13.8)
     pouring liquids (10.14)
       PourOntoSub (10.14.1)
       PourIntoSub (10.14.2)
     throw (10.15)
     tie and untie (10.16)
       'tie' (10.16.1)
       TieRopeSub (10.16.2)
       TieToSub (10.16.3)
       'untie' (10.16.4)
       UntieSub (10.16.5)
     type (10.17)
       TypeOnSub (10.17.1)
     sleep (10.18)
       SleepSub (10.18.1)
     switch (10.19)
       SwitchVagueSub (10.19.1)
     under (10.20)
       'put under' (10.20.1)
       'hide' 'stash' (10.20.2)
       'hide in' (10.20.3)
       HideMeSub (10.20.4)
       HideInSub (10.20.5)
       PutUnderSub (10.20.6)
       'get under' (10.20.7)
       'go under' (10.20.8)
       GoUnderSub (10.20.9)
       LookUnderSub (10.20.10)
     xyzzy (10.21)
       MagicWordSub (10.21.1)
       hollow_voice (10.21.2)
  
   ACTION REPLACEMENTS (11)
     EatSub (11.1)
     RemoveSub (11.2)
     TransferSub (11.3)

"misc.inf"

   MISC (12)
     replacement player object (12.1)
      attributes, number, orders (12.1a)
      awake_time, hungry_time, each_turn (12.1b)
     SilentAction (12.2)
     IsNotHeldOrTaken (12.3)
     ShowCont (12.4)
     EasterEgg (12.5)
     EmphasisStyleText (12.6)
     NormalStyleText (12.7)

Valid HTML 4.0!