import turtle as tt
from random import randint
tt.TurtleScreen._RUNNING = True
tt.hideturtle()#隐藏画笔
tt.speed(0) # 绘图速度为最快
tt.bgcolor("black") # 背景色为黑色
tt.setpos(-10, 10) # 改变初始位置,这可以让图案居中
tt.colormode(255) # 颜色模式为真彩色
cnt = 0
while cnt < 1000:
r = randint(0, 255)
g = randint(0, 255)
b = randint(0, 255)
tt.pencolor(r, g, b) # 画笔颜色每次随机
tt.forward(50 + cnt)
tt.right(91)
cnt += 1
tt.done()
来画图吧
最新推荐文章于 2024-05-28 12:36:20 发布