用python写血轮眼
import turtle
turtle.title(‘血轮眼’) #画布标题
turtle.bgcolor(“green”) #背景颜色
turtle.pensize(5) #画笔宽度
turtle.speed(100) #海龟移动速度
turtle.fillcolor(“red”) #填充的颜色
turtle.begin_fill() #开始填色
for i in range(4):
turtle.circle(80, 50)
turtle.circle(20, 180)
turtle.left(180)
turtle.circle(20, 180)
turtle.circle(80, 50)
turtle.left(180)
turtle.circle(80, 50)
turtle.circle(20, 180)
turtle.left(180)
turtle.circle(20, 180)
turtle.circle(80, 50)
turtle.left(180)
turtle.circle(80, 50)
turtle.circle(20, 180)
turtle.left(180)
turtle.circle(20, 180)
turtle.circle(80, 50)
turtle.left(180)
turtle.circle(80, 50)
turtle.circle(20, 180)
turtle.left(180)
turtle.circle(20, 180)
turtle.circle(80, 50)
turtle.left(180)
turtle.end_fill() #结束填色
pen = turtle.Turtle() # 定义画笔实例
a = 1
for i in range(140):
if 0 <= i < 100 or 100 <= i < 150: # 控制a的变化
a = a + 0.2
pen.lt(20) # 向左转3度
pen.fd(a) # 向前走a的步长
else:
a = a - 0.2
pen.lt(20)
pen.fd(a)
print(pen)
turtle.done()
版权归原作者 Wzr-赟空 所有, 如有侵权,请联系我们删除。