Chapter 11: Phrases
11.4. Conditions and questions

A variety of "conditions" have already appeared in this documentation. A condition is a phrase which describes a situation which might be true, or might be false, and examples might include:

Mr Kite is in Bishopsgate
the score is greater than 10
Sherlock Holmes suspects a woman

These are all examples of sentences, formed by putting nouns either side of a verb, and clearly a wide range of conditions can be written this way. But there are also a few special conditions built into Inform which have a fixed wording, and test questions difficult to address with ordinary sentences. For instance, the condition

in darkness

(e.g., "if in darkness...") tests whether the player is currently in the dark, and this is better than the more obvious-looking

the player is in a dark room

since the player might have a torch, or be inside a cage which is itself in a dark room, and so on. Another example of a condition not easily written as a sentence is

player consents

(e.g., "if the player consents...") which is unusual in doing something and not simply making a silent check: it waits for the player to type YES (or Y) or NO (or N) at the keyboard.


152
** Example  Proposal
Asking the player a yes/no question which he must answer, and another which he may answer or not as he chooses.

RB


PreviousContentsNext