Open advent1 and File, Save As, advent2
In this section, we ask the user to make a choice. This concept is called conditional selection.
If they choose one path, one set of consequences will happen. Otherwise, they choose the other path, and another set of consequences will happen.
Vocabulary: Flow of control is the order in which the code runs. In the example below it could take two paths.
print("You spot a fierce rat in the centre of the tunnel") #Text to describe event
event1 = input("Press s to sneak by. Press t to throw stone at it") #User made choice assigned to event1
if event1 == ("s"): #If event1 is same as s then it will #print Carefully you edge past
print("Carefully you edge past")
else: #If t or any other letter chosen
print("You throw a stone at the rat and it runs off")
Here we can see the two pathways the code can take. We call this the flow of control. When the flow meets the decision diamond it checks to see if the value assigned to the variable event1 is equal (the same as) the letter s. If it is, it goes down the brown path and prints "Carefully you edge past". If t or anything else was typed, it goes down the blue path and prints "You throw a stone....".
I have purposely avoided detailed descriptions in this example to make it easy to understand. In your adventure/event, I recommend that you make your descriptions detailed to entice the player to continue reading/playing.
Write at least one choice in Python code