import random, os, time
def diceRollSix(number):
dice = random.randint(1, number)
return dice
diceRollSix(6)
def diceRollTwelve(number):
dice = random.randint(1, number)
return dice
diceRollTwelve(12)
def Character():
print("""Choose Your Character!
Put the name of your character and choose from the following for the classes:
1. Wizard
2. Warrior
3. Normal
4. Imp
5. Elf""")
print()
classForCharacters = ["Wizard", "wizard", "Warrior" "warrior", "normal", "Normal", "Imp" "imp", "Elf", "elf"]
nameChara = input("Name of your character: ")
classChara = input("Class of your character: ")
while True:
if classChara not in classForCharacters:
print("Please choose from the classes stated above.")
classChara = input("Class of your character: ")
elif classChara in classForCharacters:
health = (diceRollSix(6) * diceRollTwelve(12))/2 + 10
print(f"Your character's health is {health}.")
print()
strength = (diceRollSix(6) * diceRollTwelve(12))/2 + 12
print(f"Your character's strength is {strength}.")
characterStatsDict = {}
characterStatsDict["name"] = nameChara
characterStatsDict["class"] = classChara
characterStatsDict["strength"] = strength
characterStatsDict["health"] = health
break
def playAgain():
playBuilderAgain = input("Would you like to play again? > ")
if playBuilderAgain == "yes" or playBuilderAgain == "Yes":
Character()
return True
else:
exit()
while True:
intro = input("Welcome to the character builder! Would you like to play? > ")
print()
if intro == "yes" or intro == "Yes":
print("Great! Let's get started! Please waita second for this the menu to load!")
time.sleep(1)
os.system("clear")
else:
break
Character()
playAgain()
if playAgain() == "yes" or playAgain() == "Yes":
pass
else:
exit()
```