Python with turtle
利用程式畫圖

"""
import turtle as t
import random as ra #隨機整數
import time
x = 0
y = 0
r = 0
g = 0
b = 0
scale = 20 #比例
t.hideturtle()#隱藏畫筆
t.penup()#提起筆 t.pensize(20)#筆頭寬度 t.color("red" , "pink") #畫筆的顏色 t.pendown()#放下筆 t.begin_fill()#填滿顏色 t.left(170)#左轉 t.forward(200)#前進 t.circle(-100,200)#半徑 t.setheading(270)#畫筆方向 t.circle(100,-200) t.left(180) t.forward(200) t.end_fill()#填滿顏色 t.penup() t.goto(50,-200)#指定的位置 t.pencolor("skyblue") t.write("happy 6 months !!",False,'center', ('Arial', 50, 'bold'))#字串顯示 t.showturtle()#顯示畫筆 while True: t.goto(x,y) t.color(r,g,b) t.write("SL1110",True,"center",("Arial",scale,"normal")) time.sleep(0.2)#挂起的時間 t.clear()#清除 t.dot(scale,(r,g,b))#實心圓圈 t.goto(x+100,y) x = ra.randint (-250,250) y = ra.randint (-250,250) r = ra.randint (0,255) g = ra.randint (0,255) b = ra.randint (0,255) scale = ra.randint(50,100)
"""
Σχόλια