Commit c24de8f6 by BellCodeEditor

auto save

parent a984d3ee
Showing with 18 additions and 1 deletions
import random
class Hero(object): class Hero(object):
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
...@@ -41,7 +42,23 @@ print('-'*30) ...@@ -41,7 +42,23 @@ print('-'*30)
print(' Fight!') print(' Fight!')
print('-'*30) print('-'*30)
while True: while True:
choice=int(input('请输入(攻击———1 治疗术——2):')) choice=input('请输入(攻击———1 治疗术——2 退出——q):')
print('-'*30) print('-'*30)
if choice=='1':
houyi.combat(yase)
elif choice=='2':
houyi.cure()
elif choice=='q':
prin()
else:
print('请重新输入!')
continue
num = random.randint(1,2)
if num==1:
yase.combat(houyi)
elif num==2:
yase.cure()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment