Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Random Character Generator Learning Outcomes in python programming: Use and call functions Call a function with a parameter Import the random module in python Use

Random Character Generator


Learning Outcomes in python programming:


Use and call functions


Call a function with a parameter


Import the random module in python


Use if/else if/else statements to determine the flow of the program


Comment your code #


Debug your code in python


Test your code


Scenario


Create a character generator program for a Role Playing game. The character can be any type of character you want it to be.

Use an magic Egyptian
(I've had people build generators for ice cream, robots, cars, cute bug. Be creative. Have fun! )

The program must do the following:


Ask if the user would like to generate a character in python.


Ask for a character name. Or provide a name for them.


Import and use the random module.


Generate at least 5 different characteristics of a character (such as strength, intellect, hit points, wisdom, charisma, etc.) and assign a random value to each of them.


Use at least TWO functions. One function must pass a parameter.


Use a random number and if statement to generate a class/race or character type (such as human warrior, or alien from Mars, etc.)


Output the character information and all of their stats in a user friendly format in python.


Ask if the user would like to create a different character.

comments made using # in python programming


For advanced coders


If you want an extra challenge, modify the scenario above with a BATTLE depending on the type of character you've chosen to create. Create a second character with random stats and build a loop that carries out a battle between the two characters, deducting from the character's hit points and possibly randomly healing a character until someone's hit points fall to 0 or below. Output the battle scene and declare the winner. Ask if the player would like to battle again before ending the program.
At the end of the program, be sure to also ask if they would like to generate another set of characters and play again.

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

Managerial Accounting Tools for business decision making

Authors: Jerry J. Weygandt, Paul D. Kimmel, Donald E. Kieso

5th edition

470506954, 471345881, 978-0470506950, 9780471345886, 978-0470477144

Students also viewed these Programming questions

Question

=+Describe the components of this time series.

Answered: 1 week ago

Question

What is meant by Career Planning and development ?

Answered: 1 week ago

Question

What are Fringe Benefits ? List out some.

Answered: 1 week ago

Question

3-1. Give an example of hierarchical planning in an organization.

Answered: 1 week ago