- * THIS SAYS THAT, FROM 11, 49 TAKES HIM TO 8 UNLESS PROP(3)=0, IN WHICH
- * CASE HE GOES TO 9. VERB 50 TAKES HIM TO 9 REGARDLESS OF PROP(3).
- * SECTION 4: VOCABULARY. EACH LINE CONTAINS A NUMBER (N), A TAB, AND A
- * FIVE-LETTER WORD. CALL M=N/1000. IF M=0, THEN THE WORD IS A MOTION
- * VERB FOR USE IN TRAVELLING (SEE SECTION 3). ELSE, IF M=1, THE WORD IS
- * AN OBJECT. ELSE, IF M=2, THE WORD IS AN ACTION VERB (SUCH AS "CARRY"
- * OR "ATTACK"). ELSE, IF M=3, THE WORD IS A SPECIAL CASE VERB (SUCH AS
- * "DIG") AND N MOD 1000 IS AN INDEX INTO SECTION 6. OBJECTS FROM 50 TO
- * (CURRENTLY, ANYWAY) 79 ARE CONSIDERED TREASURES (FOR PIRATE, CLOSEOUT).
- * SECTION 5: OBJECT DESCRIPTIONS. EACH LINE CONTAINS A NUMBER (N), A TAB,
- * AND A MESSAGE. IF N IS FROM 1 TO 100, THE MESSAGE IS THE "INVENTORY"
- * MESSAGE FOR OBJECT N. OTHERWISE, N SHOULD BE 000, 100, 200, ETC., AND
- * THE MESSAGE SHOULD BE THE DESCRIPTION OF THE PRECEDING OBJECT WHEN ITS
- * PROP VALUE IS N/100. THE N/100 IS USED ONLY TO DISTINGUISH MULTIPLE
- * MESSAGES FROM MULTI-LINE MESSAGES; THE PROP INFO ACTUALLY REQUIRES ALL
- * MESSAGES FOR AN OBJECT TO BE PRESENT AND CONSECUTIVE. PROPERTIES WHICH
- * PRODUCE NO MESSAGE SHOULD BE GIVEN THE MESSAGE ">$<".
- * SECTION 6: ARBITRARY MESSAGES. SAME FORMAT AS SECTIONS 1, 2, AND 5, EXCEPT
- * THE NUMBERS BEAR NO RELATION TO ANYTHING (EXCEPT FOR SPECIAL VERBS
- * IN SECTION 4).
- * SECTION 7: OBJECT LOCATIONS. EACH LINE CONTAINS AN OBJECT NUMBER AND ITS
- * INITIAL LOCATION (ZERO (OR OMITTED) IF NONE). IF THE OBJECT IS
- * IMMOVABLE, THE LOCATION IS FOLLOWED BY A "-1". IF IT HAS TWO LOCATIONS
- * (E.G. THE GRATE) THE FIRST LOCATION IS FOLLOWED WITH THE SECOND, AND
- * THE OBJECT IS ASSUMED TO BE IMMOVABLE.
- * SECTION 8: ACTION DEFAULTS. EACH LINE CONTAINS AN "ACTION-VERB" NUMBER AND
- * THE INDEX (IN SECTION 6) OF THE DEFAULT MESSAGE FOR THE VERB.
- * SECTION 9: LOCATION ATTRIBUTES. EACH LINE CONTAINS A NUMBER (N) AND UP TO
- * 20 LOCATION NUMBERS. BIT N (WHERE 0 IS THE UNITS BIT) IS SET IN
- * COND(LOC) FOR EACH LOC GIVEN. THE COND BITS CURRENTLY ASSIGNED ARE:
- * 0 LIGHT
- * 1 IF BIT 2 IS ON: ON FOR OIL, OFF FOR WATER
- * 2 LIQUID ASSET, SEE BIT 1
- * 3 PIRATE DOESN'T GO HERE UNLESS FOLLOWING PLAYER
- * 4 CANNOT USE "BACK" TO MOVE AWAY
- * BITS PAST 10 INDICATE AREAS OF INTEREST TO "HINT" ROUTINES:
- * 11 TRYING TO GET INTO CAVE
- * 12 TRYING TO CATCH BIRD
- * 13 TRYING TO DEAL WITH SNAKE
- * 14 LOST IN MAZE
- * 15 PONDERING DARK ROOM
- * 16 AT WITT'S END
- * 17 CLIFF WITH URN
- * 18 LOST IN FOREST
- * 19 TRYING TO DEAL WITH OGRE
- * 20 FOUND ALL TREASURES EXCEPT JADE
- * COND(LOC) IS SET TO 2, OVERRIDING ALL OTHER BITS, IF LOC HAS FORCED
- * MOTION.
- * SECTION 10: CLASS MESSAGES. EACH LINE CONTAINS A NUMBER (N), A TAB, AND A
- * MESSAGE DESCRIBING A CLASSIFICATION OF PLAYER. THE SCORING SECTION
- * SELECTS THE APPROPRIATE MESSAGE, WHERE EACH MESSAGE IS CONSIDERED TO
- * APPLY TO PLAYERS WHOSE SCORES ARE HIGHER THAN THE PREVIOUS N BUT NOT
- * HIGHER THAN THIS N. NOTE THAT THESE SCORES PROBABLY CHANGE WITH EVERY
- * MODIFICATION (AND PARTICULARLY EXPANSION) OF THE PROGRAM.
- * SECTION 11: HINTS. EACH LINE CONTAINS A HINT NUMBER (ADD 10 TO GET COND
- * BIT; SEE SECTION 9), THE NUMBER OF TURNS HE MUST BE AT THE RIGHT LOC(S)
- * BEFORE TRIGGERING THE HINT, THE POINTS DEDUCTED FOR TAKING THE HINT,
- * THE MESSAGE NUMBER (SECTION 6) OF THE QUESTION, AND THE MESSAGE NUMBER
- * OF THE HINT. THESE VALUES ARE STASHED IN THE "HINTS" ARRAY. HNTMAX IS
- * SET TO THE MAX HINT NUMBER (<= HNTSIZ).
- * SECTION 12: UNUSED IN THIS VERSION.
- * SECTION 13: SOUNDS AND TEXT. EACH LINE CONTAINS EITHER 2 OR 3 NUMBERS. IF
- * 2 (CALL THEM N AND S), N IS A LOCATION AND MESSAGE ABS(S) FROM SECTION
- * 6 IS THE SOUND HEARD THERE. IF S<0, THE SOUND THERE DROWNS OUT ALL
- * OTHER NOISES. IF 3 NUMBERS (CALL THEM N, S, AND T), N IS AN OBJECT
- * NUMBER AND S+PROP(N) IS THE PROPERTY MESSAGE (FROM SECTION 5) IF HE
- * LISTENS TO THE OBJECT, AND T+PROP(N) IS THE TEXT IF HE READS IT. IF
- * S OR T IS -1, THE OBJECT HAS NO SOUND OR TEXT, RESPECTIVELY. NEITHER
- * S NOR T IS ALLOWED TO BE 0.
- * SECTION 14: TURN THRESHHOLDS. EACH LINE CONTAINS A NUMBER (N), A TAB, AND
- * A MESSAGE BERATING THE PLAYER FOR TAKING SO MANY TURNS. THE MESSAGES
- * MUST BE IN THE PROPER (ASCENDING) ORDER. THE MESSAGE GETS PRINTED IF
- * THE PLAYER EXCEEDS N MOD 100000 TURNS, AT WHICH TIME N/100000 POINTS
- * GET DEDUCTED FROM HIS SCORE.
- * SECTION 0: END OF DATABASE. */
-
-/* THE VARIOUS MESSAGES (SECTIONS 1, 2, 5, 6, ETC.) MAY INCLUDE CERTAIN
- * SPECIAL CHARACTER SEQUENCES TO DENOTE THAT THE PROGRAM MUST PROVIDE
- * PARAMETERS TO INSERT INTO A MESSAGE WHEN THE MESSAGE IS PRINTED. THESE
- * SEQUENCES ARE:
- * %S = THE LETTER 'S' OR NOTHING (IF A GIVEN VALUE IS EXACTLY 1)
- * %W = A WORD (UP TO 10 CHARACTERS)
- * %L = A WORD MAPPED TO LOWER-CASE LETTERS
- * %U = A WORD MAPPED TO UPPER-CASE LETTERS
- * %C = A WORD MAPPED TO LOWER-CASE, FIRST LETTER CAPITALISED
- * %T = SEVERAL WORDS OF TEXT, ENDING WITH A WORD OF -1
- * %1 = A 1-DIGIT NUMBER
- * %2 = A 2-DIGIT NUMBER
+ * This says that, from 11, 49 takes him to 8 unless PROP(3)=0, in which
+ * case he goes to 9. Verb 50 takes him to 9 regardless of PROP(3).
+ * Section 4: Vocabulary. Each line contains a number (n), a tab, and a
+ * five-letter word. Call M=N/1000. If M=0, then the word is a motion
+ * verb for use in travelling (see section 3). Else, if M=1, the word is
+ * an object. Else, if M=2, the word is an action verb (such as "carry"
+ * or "attack"). Else, if M=3, the word is a special case verb (such as
+ * "dig") and N % 1000 is an index into section 6. Objects from 50 to
+ * (currently, anyway) 79 are considered treasures (for pirate, closeout).
+ * Section 5: Object descriptions. Each line contains a number (N), a tab,
+ * and a message. If N is from 1 to 100, the message is the "inventory"
+ * message for object n. Otherwise, N should be 000, 100, 200, etc., and
+ * the message should be the description of the preceding object when its
+ * prop value is N/100. The N/100 is used only to distinguish multiple
+ * messages from multi-line messages; the prop info actually requires all
+ * messages for an object to be present and consecutive. Properties which
+ * produce no message should be given the message ">$<". (The magic value
+ * 100 is now mostly abstracted out as NOBJECTS.)
+ * Section 6: Arbitrary messages. Same format as sections 1, 2, and 5, except
+ * the numbers bear no relation to anything (except for special verbs
+ * in section 4).
+ * Section 7: Object locations. Each line contains an object number and its
+ * initial location (zero (or omitted) if none). If the object is
+ * immovable, the location is followed by a "-1". If it has two locations
+ * (e.g. the grate) the first location is followed with the second, and
+ * the object is assumed to be immovable.
+ * Section 8: Action defaults. Each line contains an "action-verb" number and
+ * the index (in section 6) of the default message for the verb.
+ * Section 9: Location attributes. Each line contains a number (n) and up to
+ * 20 location numbers. Bit N (where 0 is the units bit) is set in
+ * COND(LOC) for each loc given. The cond bits currently assigned are:
+ * 0 Light
+ * 1 If bit 2 is on: on for oil, off for water
+ * 2 Liquid asset, see bit 1
+ * 3 Pirate doesn't go here unless following player
+ * 4 Cannot use "back" to move away
+ * Bits past 10 indicate areas of interest to "hint" routines:
+ * 11 Trying to get into cave
+ * 12 Trying to catch bird
+ * 13 Trying to deal with snake
+ * 14 Lost in maze
+ * 15 Pondering dark room
+ * 16 At witt's end
+ * 17 Cliff with urn
+ * 18 Lost in forest
+ * 19 Trying to deal with ogre
+ * 20 Found all treasures except jade
+ * COND(LOC) is set to 2, overriding all other bits, if loc has forced
+ * motion.
+ * Section 10: Class messages. Each line contains a number (n), a tab, and a
+ * message describing a classification of player. The scoring section
+ * selects the appropriate message, where each message is considered to
+ * apply to players whose scores are higher than the previous N but not
+ * higher than this N. Note that these scores probably change with every
+ * modification (and particularly expansion) of the program.
+ * SECTION 11: Hints. Each line contains a hint number (add 10 to get cond
+ * bit; see section 9), the number of turns he must be at the right loc(s)
+ * before triggering the hint, the points deducted for taking the hint,
+ * the message number (section 6) of the question, and the message number
+ * of the hint. These values are stashed in the "hints" array. HNTMAX is
+ * set to the max hint number (<= HNTSIZ).
+ * Section 12: Unused in this version.
+ * Section 13: Sounds and text. Each line contains either 2 or 3 numbers. If
+ * 2 (call them N and S), N is a location and message ABS(S) from section
+ * 6 is the sound heard there. If S<0, the sound there drowns out all
+ * other noises. If 3 numbers (call them N, S, and T), N is an object
+ * number and S+PROP(N) is the property message (from section 5) if he
+ * listens to the object, and T+PROP(N) is the text if he reads it. If
+ * S or T is -1, the object has no sound or text, respectively. Neither
+ * S nor T is allowed to be 0.
+ * Section 14: Turn threshholds. Each line contains a number (N), a tab, and
+ * a message berating the player for taking so many turns. The messages
+ * must be in the proper (ascending) order. The message gets printed if
+ * the player exceeds N % 100000 turns, at which time N/100000 points
+ * get deducted from his score.
+ * Section 0: End of database. */
+
+/* The various messages (sections 1, 2, 5, 6, etc.) may include certain
+ * special character sequences to denote that the program must provide
+ * parameters to insert into a message when the message is printed. These
+ * sequences are:
+ * %S = The letter 'S' or nothing (if a given value is exactly 1)
+ * %W = A word (up to 10 characters)
+ * %L = A word mapped to lower-case letters
+ * %U = A word mapped to upper-case letters
+ * %C = A word mapped to lower-case, first letter capitalised
+ * %T = Several words of text, ending with a word of -1
+ * %1 = A 1-digit number
+ * %2 = A 2-digit number