Question
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
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