Commit 507936d7 by BellCodeEditor

auto save

parent 6f2012f5
Showing with 28 additions and 7 deletions
import turtle
pen=turtle.Pen()
screen=turtle.Screen()
pen.fillcolor("white")
pen.begin_fill()
pen.forward(200)
pen.left(90)
pen.forward(200)
pen.left(90)
pen.forward(200)
pen.left(90)
pen.forward(200)
pen.left(90)
pen.end_fill()
pen.hideturtle()
turtle.done()
\ No newline at end of file
......@@ -4,9 +4,13 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
yase=Hero('yase',300,20)
houyi=Hero('houyi',250,23)
caihong=Hero('caihong',5600,199)
print(yase.attack)
print(houyi.attack)
print(caikong.attack)
\ No newline at end of file
def upgrade():#升级
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+10
yase=Hero("亚瑟",300,20)
print('亚瑟的初始血量',yase.hp)
upgrade()
upgrade()
upgrade()
print('亚瑟的升级血量',yase.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