After going to Bedroom:
now the command prompt is "A question [line break]> ";
How can I complete this code in order to execute different actions based on the answer to the “question”? Let’s say I want the player to be moved to the Living Room if the answer entered by the player is the word “answer”. How could I do that?
The Corridor is a room.
The Bedroom is west of the Corridor.
The Living Room is east of the Corridor.
After going to the Bedroom:
now the command prompt is "A question? >".
To decide whether answering a question:
if the command prompt is "A question? >", yes;
no.
After reading a command when answering a question:
if the player's command matches "answer":
move the player to the Living Room;
now the command prompt is ">";
reject the player's command;
otherwise:
say "Sorry, that's not the answer.";
reject the player's command.