Commit afa5057f by BellCodeEditor

save project

parent 77c02dbf
Showing with 15 additions and 8 deletions
...@@ -4,11 +4,18 @@ class Hero: ...@@ -4,11 +4,18 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero("亚瑟",10000,1000) yase=Hero("亚瑟",5000,600)
libai=Hero("李白",5000,4000) libai=Hero("李白",1500,2000)
simayi=Hero("司马懿",3000,5000) simayi=Hero("司马懿",900,1500)
liushan=Hero("刘禅",15000,2000) liushan=Hero("刘禅",8000,900)
print("亚瑟的血量为:",yase.hp) # print("亚瑟的血量为:",yase.hp)
# print("司马懿的血量为:",simayi.hp)
# print("刘禅的血量为:",liushan.hp)
def upgrade():
libai.leval+=1
libai.hp+=500
libai.attack+=200
upgrade()
upgrade()
print("李白的血量为:",libai.hp) print("李白的血量为:",libai.hp)
\ No newline at end of file
print("司马懿的血量为:",simayi.hp)
print("刘禅的血量为:",liushan.hp)
\ 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