Commit a3d02655 by BellCodeEditor

save project

parent c1b2b1f5
Showing with 9 additions and 5 deletions
......@@ -9,14 +9,18 @@ class Hero(object):
def combat(self,enerny):
enerny.hp=enerny.hp-self.attack
info1=self.name+'对'+enerny.name+'点噢力给'
info2=self.attack+'点粑粑'
info2=str(self.attack)+'点粑粑'
if enerny.hp>0:
info3=enerny.name+'还剩'+enerny.hp+'点噢力给'
info3=enerny.name+'还剩'+str(enerny.hp)+'点噢力给'
info=info1+info2+info3
print(info)
else:
info3=enerny.name+"去世了"
info=info1+info2+info3
print(info)
exit()
info=info1+info2+info3
yase = Hero("傻逼")
houyi= Hero("坤坤")
......
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