turtle画图代码大全

  • A+
所属分类:百科知识

1.彩色螺旋线

from turtle import *
import turtle
t = Turtle()
t.pensize(2)
turtle.bgcolor("black")
colors = ["red", "yellow", 'purple', 'blue']
t._tracer(False)
for x in range(400):
    for y in range(200):
        t.forward(x * y)
        t.color(colors[x % 4])
        t.left(91)
t._tracer(True)
done()

turtle画图代码大全

大家都在看:

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: