| Chapter 13: Relations |

| 13.12. Relations which express conditions

One last way to create a new relation and, in many ways, the easiest of all. If we write:

> Contact relates a thing (called X) to a thing (called Y) when X is part of Y or Y is part of X. The verb to be joined to implies the contact relation.

then we would be able to talk about a handle being joined to a door, and a door being joined to a handle, and so on. We are not allowed to declare:

> The hook is joined to the line.

because the question of whether they are joined is not for us to decide: that will be for the condition to determine, whenever we test it. Similarly, we cannot meaningfully write

> now the hook is joined to the line;

(and Inform will not let us) because this relation is not something we can force either way: we can make it come true by other means, maybe, but we cannot simply make it true by saying so. Lastly, this kind of relation is restricted in that we are not allowed to find paths or calculate numbers of steps through it.

So this way to define relations is, on the face of it, just a sort of verbal trick to write conditions in a more attractive way. The more flexible, changeable relations in previous sections have much greater expressive power. All the same, it is nice to be able to write -

> Nearness relates a room (called A) to a room (called B) when the number of moves from B to A is less than 3. The verb to be near implies the nearness relation.

and then to be able to write rules like:

> Instead of listening when the location is near the Sundial: say "You hear a splashing of water."

191
| Example A Humble Wayside Flower Relations track the relationships between one character and another. Whenever the player meets a relative of someone he already knows, he receives a brief introduction.

Previous | Contents | Next