資源簡介
用python畫皮卡丘(基于turtle)
代碼片段和文件信息
import?turtle?as?t
def?nose():
????t.penup()
????t.seth(90)
????t.fd(100)
????t.pendown()
????t.begin_fill()
????t.fillcolor(“black“)
????t.seth(45)
????t.fd(25)
????t.seth(135)
????t.circle(25?90)
????t.seth(315)
????t.fd(25)
????t.end_fill()
def?eyes(seth?fd?c):
????t.penup()
????t.seth(seth)
????t.fd(fd)
????t.pendown()
????t.begin_fill()
????t.fillcolor(‘black‘)
????t.circle(50)
????t.end_fill()
????t.penup()
????t.circle(50?c)
????t.pendown()
????t.begin_fill()
????t.fillcolor(‘white‘)
????t.circle(20)
????t.end_fill()
def?face(seth?fd):
????t.penup()
????t.seth(seth)
????t.fd(fd)
????t.pendown()
????t.begin_fill()
????t.fillcolor(‘red‘)
????t.circle(70)
????t.end_fill()
def?lip():
????t.penup()
????t.seth(135)
????t.fd(250)
????t.pendown()
????t.seth(-300)
????t.circle(30?-65)
????t.begin_fill()
????t.fillcolor(‘Firebrick
評論
共有 條評論