其他分享
首页 > 其他分享> > 彩色贪吃蛇实验

彩色贪吃蛇实验

作者:互联网

 1 import turtle
 2 turtle.setup(650,350,200,200)
 3 turtle.penup()
 4 turtle.fd(-250)
 5 turtle.pendown()
 6 turtle.pensize(25)
 7 turtle.pencolor("purple")
 8 turtle.seth(-40)
 9 colors = ["red","yellow","pink","blue"]
10 for i in range(4):
11     turtle.circle(40,80)
12     turtle.circle(-40,80)
13     turtle.pencolor(colors[i])
14 turtle.color("blue")
15 turtle.circle(40,80/2)
16 turtle.fd(40)
17 turtle.color("green")
18 turtle.circle(16,180)
19 turtle.fd(40 * 2/3

 

标签:turtle,color,彩色,40,贪吃蛇,实验,fd,circle,80
来源: https://www.cnblogs.com/gniygnahz/p/15361646.html