Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Generating random non-numerical values

$
0
0
I'm using Twine 2, SugarCube 2.

How can I set a variable to a random word out of a list?

If I want a variable to be a random number from 1 to10, I do this:
<<set $variable = random(1, 10)>>

But what do I do if, say, I want the variable $pet to be chosen randomly from the following list: cat, dog, fish?

Viewing all articles
Browse latest Browse all 1844

Trending Articles