Commit 27dcfd2c by BellCodeEditor

auto save

parent 17e936d7
Showing with 57 additions and 3 deletions
a=input("请出拳(石头/剪刀/布):")
print("玩家出拳是:"+a)
\ No newline at end of file
import turtle
pen=turtle.Pen()
pen.penup()
pen.goto(100,-100)
pen.write("你好,诺亿\n turtle真好用\n 我会在画布上添加文字啦",font=("Times",20,"normal"))
pen.hideturtle()
pen1=turtle.Pen()
pen1.pensize(10)
pen1.pencolor("pink")
pen1.left(45)
pen1.forward(100)
pen1.circle(50,180)
pen1.right(90)
pen1.circle(50,180)
pen1.forward(100)
turtle.done()
class Hero:
def __init__(self, name, hp, attack):
self.level = 1
self.name = name # name:名字
self.hp= hp
self.attack= attack # attack:攻击
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
houyi = Hero("后羿",300,20)
houyi.upgrade()
print(" 等级:",houyi.level)
print("血量:",houyi.hp)
print("攻击力:",houyi.attack)
class Hero:
def __init__(self,name,hp,attack):
self.leve1=1000000000000000000000000
self.hp=name
self.hp=hp
self.attack=attack
def upgrade():
yase.leve1=yase.leve1+1000000000000000000000000000000000000000
yase.hp=yase.hp+50000000000000000000000000000000000000000000000000000000000000
yase.attack=yase.attack+4000000000000000000000000000000000000000000000000000000000000000000000000000
yase=Hero('baba',30000000000000000000000000000000000000000000000,2000000000000000000000000000000000000000000000000000000)
upgrade()
upgrade()
print(yase.hp)
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