天天看點

weixuan -奧利給turtle

# 用變量,for循環,畫一個藍色blue的五角星
import turtle
import random
turtle.bgcolor('black')
turtle.color('white')

# 顔色 光  太陽光----》雲   光的散射 彩虹 七種 —————》 白
# 三基色  紅綠藍  光   red 0-255  green 0-255 blue 0-255
# 三原色  紅黃藍  顔料

jiaodu = 144
turtle.speed(0)
# ctrl + c 複制
# ctrl + v 粘貼
# ctrl + x 剪切
# ctrl + z 撤銷
# turtle.color("white")
turtle.color(30/256, 144/256, 255/256)
turtle.width(5)

for ai in range(10000):
    turtle.pensize(random.randint(1, 10))
    changdu = random.randint(1, 15)
    r = random.randint(0, 255)
    g = random.randint(0, 255)
    b = random.randint(0, 255)
    turtle.color(r / 256, g / 256, b / 256)
    # 五角星
    # for qwer in range(5):
    #     turtle.fd(changdu)
    #     turtle.right(60)
    # 寫字  write  font字型
    # turtle.write("雞你太美",font=(None, random.randint(10,50)))
    turtle.write("奧利給", font=(None, random.randint(10, 50)))
    turtle.up()
    turtle.goto(random.randint(-850, 850), random.randint(-550, 550))
    turtle.down()

turtle.done()