Commit 4b2d58af by BellCodeEditor

save project

parent 04b55c7c
Showing with 21 additions and 10 deletions
...@@ -5,16 +5,27 @@ class Hero: ...@@ -5,16 +5,27 @@ class Hero:
self.level = level self.level = level
self.name = name self.name = name
def wsnd(self):
self.level = self.level + 1
self.hp = self.hp + 400
self.attack = self.attack + 80
def hhhh(self):
print(self.name,"level=",self.level)
print(self.name,"hp=",self.hp)
print(self.name,"attack=",self.attack)
yase = Hero("yase",4500,245,1) yase = Hero("yase",4500,245,1)
houyi = Hero("houyi",3100,300,1) houyi = Hero("houyi",3100,300,1)
def wsnd(): yase.wsnd()
yase.level = yase.level + 1 houyi.wsnd()
yase.hp = yase.hp + 400
yase.attack = yase.attack + 80 yase.hhhh()
houyi.hhhh()
yase.wsnd()
houyi.wsnd()
wsnd() yase.hhhh()
wsnd() houyi.hhhh()
wsnd() \ No newline at end of file
print("亚瑟的血量",yase.hp)
print("后羿的血量",houyi.h
\ No newline at end of file
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