1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-05 16:44:21 +03:00
inform7/resources/Documentation/Examples/Candy.txt
2019-03-16 13:12:11 +00:00

21 lines
945 B
Plaintext

* Random choices of things
(Assigning attributes randomly at the start of play--Poisoned candy chosen randomly; Candy)
One of several identical candies chosen at the start of play to be poisonous.
Suppose we want to give the player a bag of candies, of which a random one is poisonous. We can pick which one should be poisoned at the start of play, like this:
{*}"Candy"
The plural of piece of candy is pieces of candy. A piece of candy is a kind of thing. A piece of candy is always edible. Four pieces of candy are in the Halloween bag.
Toxicity is a kind of value. The toxicities are safe and poisonous. A piece of candy has a toxicity. A piece of candy is usually safe.
The Porch is a room. The player carries the Halloween bag.
After eating a poisonous piece of candy:
say "Oh, that didn't taste right at all. Oh well!"
When play begins:
now a random piece of candy is poisonous.
Test me with "eat candy / g / g / g".