Alternatives
version 2 by Eric Eve
Section: Other Restrictions and Workarounds
Note that Alternatives only works for comparisons, that is for testing whether one value is equal to one of up to six other values, or unequal to all of six other values. Although it might be useful to be able to do so, Alternatives does not allow us to write, for example:
After taking either the bucket or the spade:
say "You pick up [the noun] with gusto."
It is, however, often possible to achieve the desired effect with a slight rephrasing. We can, for example, write:
After taking when the noun is either the bucket or the spade:
say "You pick up [the noun] with gusto."
And this will have the desired effect.
A similar technique can be used to handle numerical values input by the player, for example:
Guessing is an action applying to one number.
Understand "guess [number]" as guessing.
After guessing when the number understood is either 2 or 3 or 5 or 7 or 11 or 13:
say "Ah, a prime number less than 17!"
Report guessing: Say "[the number understood] doesn't interest me much."