Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. ( 6 points) Suppose you're developing a fighting game where one of the characters, Slotherius, is a deadly combat sloth. Here's a rarely seen

image text in transcribed
image text in transcribed
5. ( 6 points) Suppose you're developing a fighting game where one of the characters, Slotherius, is a deadly combat sloth. Here's a rarely seen photo of Slotherius demonstrating his fighting skills to a group of human admirers: Slotherius has a special move called Triple Claw Slash that consists of three attacks delivered in rapid (well, for a sloth...) succession. The first two attacks each deal an integer value from 15-21 (inclusive) points of damage. The last attack allows the player to "charge" the attack to potentially deal greater damage. However, this comes at a cost: charging the attack also has a chance to reduce the damage done, or even backfire and end up hurting Slotherius himself! Specifically, the last attack deals an integer value between (2310n) and (23+11n) damage (inclusive), where n is the number of seconds spent charging. Not charging the attack at all (n=0) makes it deal exactly 23 damage every time. Charging for 1 second makes the attack deal between 13 and 34 damage. Charging for 3 seconds makes the attack deal between 7 and 56 damage. A negative damage value just indicates that Slotherius himself takes the damage rather than his opponent. Write a program named slotherius.py that simulates making the Triple Claw Slash attack. The program should allow the user to enter the number of seconds to charge the attack. You may assume that the user input is a non-negative integer. Then show the damage done from each of the three attacks, randomly choosing an integer within the appropriate ranges each time the program is run. Example program run (underlined parts indicate what the user enters) Slotherius uses Triple Claw Slash! How many seconds would you like to charge? 3 Damage dealt: Attack 1: 15 Attack 2: 16 Attack 3: 5

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

Essential Data Protection For Estate Agencies In Singapore 2024

Authors: Yang Yen Thaw Yt

1st Edition

B0CQK79WD3, 979-8872095392

More Books

Students also viewed these Databases questions

Question

1. Identify three approaches to culture.

Answered: 1 week ago

Question

2. Define communication.

Answered: 1 week ago

Question

4. Describe how cultural values influence communication.

Answered: 1 week ago