import turtle
import time
def curveMove():
for i in range(200):
turtle.speed(10)
turtle.right(1)
turtle.forward(1)
def curveMove2():
for i in range(200):
turtle.speed(10)
turtle.right(1)
turtle.forward(1)
def curveMove3():
for i in range(200):
turtle.speed(10)
turtle.right(1)
turtle.forward(1)
def drawHeart():
turtle.speed(1)#画笔速度调到最高
turtle.color('blue','red')
turtle.begin_fill()
turtle.left(140)#逆时针旋转140度
turtle.forward(111.65)#向前移动111,65个像素
#turtle.forward(250)#向前移动111,65个像素
curveMove()#画曲线
turtle.left(120)#逆时针旋转120度 right是顺时针移动角度
curveMove()#继续画曲线
turtle.forward(111.65)#向前移动111,65个像素
turtle.end_fill()
def drawHeart2():
turtle.speed(1)#画笔速度调到最高
turtle.color('blue','red')
turtle.begin_fill()
turtle.left(140)#逆时针旋转140度
turtle.forward(111.65)#向前移动111,65个像素
#turtle.forward(250)#向前移动111,65个像素
curveMove()#画曲线
turtle.left(120)#逆时针旋转120度 right是顺时针移动角度
curveMove()#继续画曲线
turtle.forward(111.65)#向前移动111,65个像素
turtle.end_fill()
def drawHeart3():
turtle.speed(1) # 画笔速度调到最高
turtle.color('blue', 'red')
turtle.begin_fill()
turtle.left(140) # 逆时针旋转140度
turtle.forward(111.65) # 向前移动111,65个像素
# turtle.forward(250)#向前移动111,65个像素
curveMove() # 画曲线
turtle.left(120) # 逆时针旋转120度 right是顺时针移动角度
curveMove() # 继续画曲线
turtle.forward(111.65) # 向前移动111,65个像素
turtle.end_fill()
def my_goto(x,y):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
if __name__ == '__main__':
drawHeart()
drawHeart2()
drawHeart3()
my_goto(230,-300)
turtle.write('to 赵丽颖',font=('Bradley Hand ITC',30,'bold'))
my_goto(0,0)
time.sleep(10)
作业
最新推荐文章于 2024-06-21 19:20:27 发布