Inform 7 Home Page / Documentation


§6.16. Counting while comparing

Lastly we can also ask for a more specific number of possibilities, like so:

if two women are carrying animals
if at most three doors are open
if fewer than 10 portable containers are closed
if all but two of the devices are switched on
if there are more than six locked doors

Likewise for "less than", "at least", "all except". Something to watch out for is that

if two doors are open

will be found true if there are (say) three open doors: after all, if three doors are open, then certainly two doors are. So this is not quite counting. We can be more precise by writing

if exactly two doors are open

The "all but" counts - say, "if all but two doors are open" - are exact: if, in fact, all of the doors are open then this will be found false.

We can often use these counting forms with values, too. As with the use of "all", this is allowed only if the kind of value is one which can reasonably be searched through. For example:

if more than three scenes are happening
if there are more than two non-recurring scenes

are allowed because the built-in kind of value "scene" (of which much more later on) has only a small number of possible values.

Lastly, note that the "the" in text like "two of the doors" matters: without it, the phrase will not be recognised as a requirement on the number. (This is to make sure that names of things like "two of hearts" are not misinterpreted.)


arrow-up.png Start of Chapter 6: Descriptions
arrow-left.png Back to §6.15. All, each and every
arrow-right.png Onward to Chapter 7: Basic Actions: §7.1. Actions

**ExampleYolk of Gold
Set of drawers where the item the player seeks is always in the last drawer he opens, regardless of the order of opening.