Text-based adventure game: Pretend you are creating a text-based adventure game. At different points in the game, you want the user to select to fight, run, or hide from certain enemies.  The selection variable must be sent as an argument into the choice() function.  The user should enter 1 to fight, 2 to run, or 3 to hide in the main(). The choice() function should print one of the three options. Add an if statement in the choice() function to make the correct selection.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question

In Python

Text-based adventure game: Pretend you are creating a text-based adventure game. At different points in the game, you want the user to select to fight, run, or hide from certain enemies.  The selection variable must be sent as an argument into the choice() function. 

The user should enter 1 to fight, 2 to run, or 3 to hide in the main(). The choice() function should print one of the three options.

Add an if statement in the choice() function to make the correct selection. 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning