Milestone 1: Printing a Scene to Console

We are now moving over to writing code in infinite_adventure.py! One of the first things you’ll want to do is to load in the story that is specified by the STORY_NAME constant, which you can do in a very similar way to how you did things in the Milestone 0. Once you have your story data, our first step will be to print to the screen a single scene from the story.

To print out a single scene from the story, we essentially need to print out several things: the content or “text” of the scene, and then all the possible choices that a player can make. When printing out the choices, they should be numbered for the user, starting at 1, so that it is easy for a player to (eventually) indicate which choice they would like to make. Because you are going to be printing out scenes constantly in this program, it makes a lot of sense to write a helper function to manage this.

Write a function to print everything from a single scene to the console. Your function should take just a single parameter: the dictionary associated with a single scene.

When testing this function initially, you will need to extract a scene dictionary from the greater story dictionary to pass into your function. The scene with the key “start” is a great candidate, as that is eventually where you’ll want the adventure to start. When printing out the “start” scene then, you should print out the following:

You are standing at the end of a road before a small brick building. 
A small stream flows out of the building and down the gully to the 
south. A road runs up a small hill to the west.
  1. Take the road up the hill
  2. Walk up to the stream
  3. Knock on the door

Note that in addition to enumerating the choices, we have indented them in two spaces, which I think helps set them apart from the story description.

Test your function with scene dictionaries beyond just the “start” scene! It should work for any scene you choose. Note that you do not need to print or do anything with the “scene_summary” key right now: that data will come in handy later.

Note

We are eventually going to render a scene by both printing out a description of the scene to the terminal and rendering an image associated with the scene. But rendering the image is for a future milestone.