猫史档案馆


Python作品分享。

用户:python爱好者恺恺python爱好者恺恺查看:0 回复:0 评论:0 创建时间:2023-08-24T23:27:15


import turtle
import random
t = turtle.Pen()
colors = ["red","yellow","blue","green","orange","purple","gray","white"]

t.speed(1000)
turtle.bgcolor("black")

def paintbrush(x,y):
a = random.randint(0,7)
b = random.randint(0,50)
t.pencolor(colors[a])
t.fillcolor(colors[a])
t.penup()
t.goto(x,y)
t.pendown()
t.begin_fill()
t.circle(b)
t.end_fill()

turtle.onscreenclick(paintbrush)

exit = input("按下回车键,离开源码世界……")


回复

上一页1 页 / 共 0下一页