![]() | Chapter 11: Phrases | ![]() ![]() |
11.1. Fitting values into phrases |
We are now able to set up the model world, to respond to certain actions of the player within it, and to make changes over time, giving the game a start and an end. But although we have defined many rules, none of them have done more than to use a few basic phrases: saying something to the player, changing some property or moving things around.
A phrase is a pattern of words which instructs the computer to do something immediately. For instance:
say "Look out!"
award 20 points
are instructions using two phrases, "say ..." and "award ... points". Phrases are not the same things as rules: rules lay out what should happen under what circumstances, but it is phrases that actually do what needs to be done.
Where the "20" appears in "award 20 points", any number would have done. This does not need to be a literal number expressed in digits: it can be any value known to Inform which works out as a number. For instance, "the score" is always acceptable as a number, since it is the name of a number variable: its value at any point in play is the current score.
Previous | Contents | Next |