Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions

Question

DN 0 2 . ? , .

Answered: 1 week ago