turtle哆啦A梦的实现

7次阅读

共计 895 个字符,预计需要花费 3 分钟才能阅读完成。

图案如下

python 代码如下

# 彩色版本
import turtle
t=turtle.Turtle()
t.speed(0)
t.color('black','blue')
t.begin_fill()
t.circle(60)
t.end_fill()
t.color('black','white')
t.begin_fill()
t.circle(50,steps=30)
t.end_fill()
# 黑色大眼睛
t.up()
t.circle(50,120)
t.left(90)
t.fd(3)
t.down()
t.color('black','white')
t.begin_fill()
t.circle(-10)
t.end_fill()
# 黑色眼珠
t.color('black','black')
t.begin_fill()
t.circle(-5,steps=10)
t.end_fill()
t.right(90)
t.fd(3)
#eye2
t.up()
t.circle(50,90)
t.left(90)
t.fd(3)
t.down()
t.color('black','white')
t.begin_fill()
t.circle(-10)
t.end_fill()
#黑色眼珠子
t.up()
t.circle(-10,90)
t.down()
t.color('black','black')
t.begin_fill()
t.circle(-5,steps=10)
t.end_fill()
#黑色眼珠子
t.right(120)
t.fd(3)
#eye2
# 鼻子
t.up()
t.right(90)
t.fd(25)
t.right(90)
t.fd(10)
#
t.color('black','red')
t.begin_fill()
t.circle(5)
t.end_fill()
#
t.left(90)
t.up()
t.fd(5)
t.right(90)
t.fd(5)
t.down()
t.fd(40)
#mouse
t.left(90)
t.circle(20,90)
t.left(180)
t.circle(-20,180)
#移除画笔
t.up()
t.fd(600)

正文完
 0