資源簡介
用python畫出五星紅旗
代碼片段和文件信息
from?math?import?tan
from?turtle?import?*
w?=?288
h?=?192
a?=?192?/?10
setup(w?*?2h?*?2)
bgcolor(“red“)
def?star(a?angle):
????begin_fill()
????pu()
????fillcolor(“yellow“)
????for?i?in?range(5):
????????fd(a)
????????rt(angle)
????end_fill()
????pd()
def?move(x?y):
????pu()
????goto(x?y)
????pd()
speed(8)
#?移動到大五角星點位并繪制
move(-12.9?*?a?5.9?*?a)
star(a?*?3?*?2?*?
- 上一篇:python繪制七巧板
- 下一篇:python 繪制太陽花
評論
共有 條評論