Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using the function from the previous problem, write a function adventure ( ) which takes in no arguments, and gives the user a sequence of
Using the function from the previous problem, write a function adventure ( ) which takes in no arguments, and gives the user a sequence of choices, leading to one of several endings. Since we want this problem to not be impossible to grade, you need to follow a very specific choice structure, namely the one outlined in the flowchart below: Note that: - Each diamond represents a decision, for which you must call your choose_three function from problem B. - Each arrow represents one of the three possible choices for that decision: A, B, or C. - Each rounded box represents an ending to the story, which comes in one of two possible types: Good (the user succeeds in some way) or Bad (the user fails). Your function should return the boolean value (not the string) True if the user reached a Good ending, or False if they reached a Bad ending. You can put in a few additional print statements beyond the ones inside the choose_three function to better explain the story, but this is not required. The story itself is entirely up to you, with one exception: you can't use the one in the example below. We will not be grading you based on the story's quality, logic, originality, or grammatical The dragon sneezes out a fireball and incinerates you instantly. False > adventure() You sneak into the dragon's lair, with your comrades wizard McBlastyFace and Stella the Bard. The dragon is fast asleep. A. Tell your team to start stealing things B. Tickle the dragon on the nose C. Tell your team to prepare for battle Choose A,B, or C : A You can't carry the entire hoard of loot. A. Take as much gold as I can carry B. Take the pile of silk in the corner C. Take the huge diamond curled under the dragon's claw Choose A,B, or C:C You trip over a rock and the dragon wakes up. A. Tell stella to sing to the dragon B. CHARGE! C. Run away Choose A,B, or C : Surrender?? Invalid option, try again. Choose A,B, or C : AAAAHHHH
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started