資源簡介
來副小豬佩奇,用python畫個小豬佩奇
代碼片段和文件信息
#?coding:utf-8
import?turtle?as?t
def?nose(xy):#鼻子
????t.pu()
????t.goto(xy)
????t.pd()
????t.seth(-30)
????t.begin_fill()
????a=0.4
????for?i?in?range(120):
????????if?0<=i<30?or?60<=i<90:
????????????a=a+0.08
????????????t.lt(3)?#向左轉3度
????????????t.fd(a)?#向前走a的步長
????????else:
????????????a=a-0.08
????????????t.lt(3)
????????????t.fd(a)
????t.end_fill()
????t.pu()
????t.seth(90)
????t.fd(25)
????t.seth(0)
????t.fd(10)
????t.pd()
????t.pencolor(255155192)
????t.seth(10)
????t.begin_fill()
????t.circle(5)
????t.color(1608245)
????t.end_fill()
????t.pu()
????t.seth(0)
????t.fd(20)
????t.pd()
????t.pencolor(255155192)
????t.seth(10)
????t.begin_fill()
????t.circle(5)
????t.color(1608245)
????t.end_fill()
def?head(xy):#頭
????t.colo
- 上一篇:django編寫個人博客園完整版,注釋詳細
- 下一篇:一個超簡單的五子棋游戲
評論
共有 條評論