Skip to content

zhenw22523/Beginners-Selection-Problems

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

If-Else-Activity-1

Choose your own adventure!

Create code which takes the user through their own adventure through a Treasure Island. Allow the user to make their own choices and lead them to their own fate! Note that for any input given by the user, it should only be for the prompts provided (e.g. if we ask the user if they want to swim or walk, if they input ‘jog’ the game should end because they should listen to the rules). This is just a basic template of how your code should be structured, so you don’t have to follow this exactly! Get creative! Note: What I will write is essentially what should be in the console. For multiple choices, I will provide both pathways (but you should only have one pathway for the user) Input is in blue.

Print an introduction message to the user:

You are exploring a rainforest in search of treasure.

Legend has it that there are some buried on a nearby island.

Ask the user their first question.

You come across a lake. Do you want to swim across, or wait for a boat? (swim/wait):

User: swim

You get eaten by a hungry shark. Game over. Code ends here

User: wait

A boat arrives and you arrive at the island safely.

Ask the user another question.

You come to a cave.

Do you want to venture inside or walk on? (venture/walk):

User: venture

You are squished by boulders never to be seen again. Game over. Code ends here

User: walk

If the user chose the right option, ask another question (with multiple options)

Tell the user what happens based on their decision. One way should mean they find the treasure.

You’re at a crossroads.

Do you go left, right, or straight? (left/right/straight)

User: left

You are trampled by a herd of wildebeest. Game over. Code ends here.

User: straight

You get stung by a poisonous wasp. Game over. Code ends here.

User: right

You march on and find the buried treasure! Yippee!! Code ends here

About

Beginners Problems on Selection and Boolean

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%