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?
Comments
Assuming that you don't have a preexisting array of pets that you wish to select from, such an assignment might look like the following: