Final Project: Choose-Your-Own-Adventure

Thanks for sticking with us throughout the course! We have one final project left for you to accomplish to compile all the concepts we've learned so far. It's called a choose-your-own-adventure! You can hone the skills that you've picked up by building this.

What is a choose-your-own-adventure story? A choose-your-own-adventure involves writing a story that has options. The person who runs your program will be able to input the options they want to choose, and you’ll print something based on what they choose, using conditionals. You can also add loops to print specific things, and loops in the story can go back to the starting. If you're still a bit confused, don't worry! Here's an example to clarify:


tunnels = input("Nice and Happy were walking together when they suddenly stumbled across a huge cave with 3 tunnels to choose from: Type in tunnel1, tunnel2, or tunnel3: ")



In this example, the user can type
tunnel1
to go into the first tunnel. You can then check using a conditional if the tunnel equals a certain input. You can also use a loop to go back to the starting:


while tunnels != "tunnel1" or tunnels != "tunnel2":
  tunnels = input("Dead end! pick another tunnel from tunnel1 or tunnel2: ")
if tunnels == "tunnel1":
  print("Add tunnel1 story here")
elif tunnels == "tunnel2":
  print("Add tunnel2 story here")



You can keep doing this until you want to finish up the story. Add more loops to go back to critical points in the story or use them with time.sleep() to do a countdown at tense moments in the story. Remember though that you have to include options for the player to choose from.

I hope you enjoy this interactive story game since it’s pretty fun to make and great to play with friends. It's quite an experience to see what they will do if a crisis occurs. The options are endless! You can add multiple endings and inventory items (secret, easy, hard, good, or bad) based on variables that hold a score, money, or some other info. Keep in mind, you will have to put some effort into this to make it good. This will be a great review for you!


And that's it! That's the course. We taught you everything you need to get started with programming with Python. As long as you get the idea of this game, you will be on the right path to do anything with the language. Good luck and have fun!