Nancy -画满天星

import turtle
import random

turtle.speed(0)
turtle.width(5)
turtle.bgcolor("black")
# turtle.color("yellow")
# 三基色:红 绿 蓝 ,光,任意组成画其他颜色, red green blue
# 三原色:红 黄 蓝 ,画画(颜料),任意组成画其他颜色,
for v in range(100):
    b = random.randint(-350, 350)
    a = random.randint(-350, 350)
    # 画一颗五角星
    long = random.randint(5, 30)
    turtle.write("我不想上学")
    # for x in range(5):
    turtle.color(random.randint(0, 255) / 256, random.randint(0, 255) / 256, random.randint(0, 255) / 256)
        # turtle.fd(long)
        # turtle.lt(144)
    # 换一个地方画画
    turtle.up()
    turtle.goto(b, a)
    turtle.down()

turtle.done()
发布了414 篇原创文章 · 获赞 19 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/houlaos/article/details/104571591