Escape Room Program – Part 2: making decisions

Step 4 – Add a hint

The problem with the program so far is that if the player can't guess what to do then they can't move on.

That might be very frustrating. And make it a boring escape room.

We should add a hint to help them.

  1. Code helper imageThis needs another question and an IF block inside the original ELSE block
  2. Change your while loop by adding code so that it looks like the screenshot

    All this does is ask another question and store the answer in another variable called hint

    Get the order of this stuff right and it will work!

  3. Run your program and check that it works. Type "Y" to get a hint and anything else not to

    Did you notice that I used .upper() this time?

  4. Run your program again to check another set of inputs.

It's really important to check that everything works each time. This is called testing. If you test your program as you make it then you can usually pick up errors as you go.

Now do: This is a good time to add some comments to your code if you haven't already done so. Remember, comments start with #