| Chapter 8: Change |

| 8.10. Now...

As Chapter 5 has already discussed, Inform looks at a whole range of "relations" between objects, many of which we can change. The general rule is as follows. Suppose S is a sentence about a relationship between things. Then there are three things we can do with S:

> S. - The relation holds at the start of play.
> if S, ...; - Does the relation hold right now?
> now S; - Make the relation hold from now on.

For instance,

> The apple is in the basket.
> if the apple is in the basket, ...;
> now the apple is in the basket;

The effect of "now the apple is in the basket" is identical to "move the apple to the basket", so this appears to offer nothing new; and "now" duplicates other things already available, too, because "now the oaken door is open" does the same thing as "change the oaken door to open". But "now" is more general and more flexible. For instance,

> now the top hat is worn by Mr Darcy;

will make the hat worn, rather than simply carried, by Darcy: this is something which could not be done with the "move" phrase. We can also apply "now" to many things at once:

> now all the doors are open;
> now all of the things in the sack are in the box;

The second of these moves the entire contents of the sack to the box.

103
| Example Bee Chambers A maze with directions between rooms randomized at the start of play.

Mazes are a traditional element of interactive fiction, often consisting of apparently identical rooms with exits that do not work reciprocally and which cause confusion. The methods of mapping mazes are now fairly well understood and mazes themselves tend to be regarded as tiresome rather than enjoyable by a large portion of the playing audience. However, if we did want to ignore the common wisdom and create a maze, randomly generated at the start of play, here would be one way to go about it: "Maze of Gloom" A Bee Chamber is a kind of room. The printed name of a Bee Chamber is usually "Hexagonal Room". The description of a Bee Chamber is usually "Waxy, translucent walls surround you on six sides; the floor and ceiling are made of the same material, gently uneven. There are exits in every direction, cut into the faces or the corners." Bee1, Bee2, Bee3, Bee4, Bee5, Bee6, Bee7, Bee8, Bee9, and Bee10 are Bee Chambers. When play begins: change right hand status line to "[number of visited rooms]/[number of rooms]"; repeat with place running through Bee Chambers begin; now a random Bee Chamber is mapped north of place; now a random Bee Chamber is mapped northwest of place; now a random Bee Chamber is mapped west of place; now a random Bee Chamber is mapped southwest of place; now a random Bee Chamber is mapped south of place; now a random Bee Chamber is mapped southeast of place; now a random Bee Chamber is mapped east of place; now a random Bee Chamber is mapped northeast of place; now a random Bee Chamber is mapped above place; now a random Bee Chamber is mapped below place; now a random Bee Chamber is mapped inside place; now a random Bee Chamber is mapped outside place; end repeat. Test me with "in / out / up / down / n / ne / nw / e / w / sw / se / s".

104
| Example Technological Terror A ray gun which destroys objects, leaving their component parts behind.

Previous | Contents | Next