Say a randomly selected word from a group

There is a password randomly selected from a set of 4 (i.e. “Barracuda”, “Trout”, “Salmon”, “Mola”) – it is determined when play begins but stays consistent for that playthrough. You are informed of these by, say, reading a slip of paper. You must say the password to a guard to permit entry, otherwise you will be told that you got it wrong.

My current idea is to declare password as a text that varies, then roll a random number from 1 to 4 and set the password to one of these words based on which number it rolls. But is there a faster way to do this, and would you be able to say it properly?

1 Like
The password is some text that varies.
When play begins:
    now the password is the substituted form of "[one of]Barracuda[or]Trout[or]Salmon[or]Mola[at random]".
A slip of paper is a thing.
The description of the slip of paper is "It has [the password in upper case] written on it."
3 Likes

I suggest picking the password at the time it is needed so that players can’t play games like: save the game, determine the password, reload the save game, and know the password without going through the business of figuring it out.

2 Likes

This works, but how would you be able to program responses based on the password? Like:

if the password is Mola:
say “Sounds flat.”;

If the password is "Mola":
2 Likes

What about checking if the player’s command is equal to the password? i.e. >SAY “MOLA”

18:33 - Reading a command

RB 2:3 - Using the Player’s Input

1 Like