zhaowei - 高級版滿天星

import turtle
import random
# 變量:把數據放進盒子裏
win94 = 144  # 角度
turtle.speed(0)  # 速度
turtle.color("yellow")  #
# bgm 背景音樂
turtle.bgcolor("black")
# 粗細
# 三基色 : rgb  紅綠藍  光
# turtle.color(118/256,238/256,0/256) # 寫上三個數字 0-255
for a in range(4000):
    turtle.color(random.randint(0, 255) / 256, random.randint(0, 255) / 256, random.randint(0, 255) / 256)  # 寫上三個數字 0-255
    turtle.pensize(random.randint(1, 3))
    sks = random.randint(1, 100)  # 長度
    pdg = random.randint(-350, 350)  # 產生一個隨機的整數
    pdg2 = random.randint(-350, 350)   # 產生一個隨機的整數
    turtle.up()
    turtle.goto(pdg,pdg2)
    turtle.down()
    # for i in range(5):
    #     turtle.fd(sks)
    #     turtle.lt(win94)
    # 寫字  write
    turtle.write("雞你太美", font=(None, 20))

# down下  done 完成
turtle.done()




import random
# 產生一個0-1隨機小數
a = random.random()
print(a)
# 產生一個1-100的隨機整數 randint(最小值,最大值)
b = random.randint(1,100)
print(b)
# 產生一個1-100的隨機小數??????
print(b+a)









發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章