-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·27 lines (22 loc) · 861 Bytes
/
test.py
File metadata and controls
executable file
·27 lines (22 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/python3
import re
from hero import Hero
# from random import shuffle
heroName = input("What is your hero's name? ") or "Bozo"
heroBest = input("What is your hero's best skill? ") or "Clowning"
heroMid = input("What is your hero's second best skill? ") or "Juggling"
heroWorst = input("What is your hero's worst skill? ") or "Tax Accounting"
heroLevel = 0
myHero = Hero(heroName, heroBest, heroMid, heroWorst, heroLevel)
conflict = {'description': 'An old man demand you perform ' + myHero.best + "."}
print(conflict['description'])
perform = input("Will you do it? (Y or N) ")
if re.match("[Yy]", perform):
roll = myHero.skills[myHero.best]()
if roll > 2:
print(myHero.name + " did it!")
else:
print(myHero.name + " rolled a " + str(roll) + " and had a problem.")
else:
print("Oh fartnuggets!")
# print(myHero())