Question
I need to make a turn-based game for my Cs class (in python). The instructions are below: Using a loop, simulate a battle between Krogg
I need to make a turn-based game for my Cs class (in python).
The instructions are below:
Using a loop, simulate a battle between Krogg and the boss where Krogg attacks the boss, then the boss attacks Krogg repeatedly until one of the two characters has died. _**Note:** A character has died if and when their HP reaches zero (more precisely, 0)_ Each time the loop iterates, one round of fighting will occur. Each character will attack exactly once per round. Your loop will also display a summary after the round has finished. The loop will continue as long as both Krogg and the boss are still alive (i.e. Krogg's HP > 0 and the boss' HP > 0). Below is the sample output, using the values given in code listing 1.
Write your code that matches the output below:
### Sample Output 1 ``` Round 1 Krogg does 26.0 points of damage to Boss Boss does 5.0 points of damage to Krogg Boss: 174.0 Krogg: 195.0
Round 2 Krogg does 26.0 points of damage to Boss Boss does 5.0 points of damage to Krogg Boss: 148.0 Krogg: 190.0
Round 3 Krogg does 26.0 points of damage to Boss Boss does 5.0 points of damage to Krogg Boss: 122.0 Krogg: 185.0
Round 4 Krogg does 26.0 points of damage to Boss Boss does 5.0 points of damage to Krogg Boss: 96.0 Krogg: 180.0
Round 5 Krogg does 26.0 points of damage to Boss Boss does 5.0 points of damage to Krogg Boss: 70.0 Krogg: 175.0
Round 6 Krogg does 26.0 points of damage to Boss Boss does 5.0 points of damage to Krogg Boss: 44.0 Krogg: 170.0
Round 7 Krogg does 26.0 points of damage to Boss Boss does 5.0 points of damage to Krogg Boss: 18.0 Krogg: 165.0
Round 8 Krogg does 26.0 points of damage to Boss Boss does 5.0 points of damage to Krogg Boss: -8.0 Krogg: 160.0
Krogg has won. You are victorious! ```
You should test your program with other values, to ensure that all of your logic works properly. If the boss wins, display the following message instead:
``` The Boss has won. You have been defeated! ```
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