小哆啦(Turtle绘图大赛)

懵懂的女人 提交于 2019-12-25 11:57:13

(a)20181004098   曾尚朝

         20181305041   冯晓晴

(b)

import turtle

turtle.showturtle()
turtle.pensize(4)
turtle.speed(4)
turtle.hideturtle()#隐藏指针

turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.circle(-100,50)#弧底
turtle.right(180)
turtle.circle(100,100)

turtle.penup()
turtle.home()
turtle.pendown()

turtle.left(90)
turtle.forward(60)

turtle.fillcolor("red")
turtle.begin_fill()
turtle.right(90)
turtle.circle(20)
turtle.end_fill()

turtle.penup()
turtle.left(90)
turtle.forward(70)
turtle.pendown()
turtle.circle(48)
turtle.circle(-48)

turtle.penup() #眼睛前奏
turtle.left(90)
turtle.forward(33)
turtle.pendown()

turtle.fillcolor("black")
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()

turtle.penup()
turtle.left(180)
turtle.forward(66)
turtle.pendown()

turtle.fillcolor("black")
turtle.begin_fill()
turtle.circle(-10)
turtle.end_fill()

turtle.penup()
turtle.left(180)
turtle.forward(33+48*2)
turtle.pendown()

turtle.left(26)
turtle.circle(115,125)

turtle.penup()
turtle.left(180)
turtle.circle(-115,125)
turtle.setheading(0)
turtle.forward(48*4)
turtle.pendown()

turtle.right(26)
turtle.circle(-115,125)
turtle.setheading(180)
turtle.forward(206+30)

turtle.right(46)
for i in range(1,5):
    turtle.circle(-175,32.5)
    turtle.right(1)
turtle.circle(-175,5)

turtle.penup()
turtle.left(180)
turtle.circle(175,5)
for i in range(1,5):
    turtle.left(1)
    turtle.circle(175,32.5)
turtle.setheading(0)
turtle.pendown()
turtle.forward(206+30*2)

turtle.left(46)
for i in range(1,5):
    turtle.circle(175,32.5)
    turtle.left(1)
turtle.circle(175,5)
#
turtle.pensize(2)
#
turtle.penup()
turtle.home()
turtle.forward(130)
turtle.right(90)
turtle.forward(20)
turtle.pendown()
turtle.left(90+160)
turtle.forward(60)

turtle.penup()
turtle.setheading(90)
turtle.forward(10)
turtle.pendown()

turtle.right(90)
turtle.forward(58)

turtle.penup()
turtle.right(180)
turtle.forward(58)
turtle.right(90)
turtle.forward(10)
turtle.right(70)
turtle.pendown()
turtle.forward(60)
#左右分割线
turtle.penup()
turtle.home()
turtle.backward(130)
turtle.right(90)
turtle.forward(20)
turtle.pendown()
turtle.right(90+160)
turtle.forward(60)

turtle.penup()
turtle.setheading(90)
turtle.forward(10)
turtle.pendown()

turtle.left(90)
turtle.forward(58)

turtle.penup()
turtle.left(180)
turtle.forward(58)
turtle.left(90)
turtle.forward(10)
turtle.left(70)
turtle.pendown()
turtle.forward(60)
#
turtle.pensize(4)
#
turtle.penup()
turtle.home()
turtle.right(90)
turtle.forward(73.6)
turtle.left(90)
turtle.pendown()

turtle.fillcolor("red")
turtle.begin_fill()
turtle.forward(103+30+5)
turtle.circle(-9,180)
turtle.forward((103+30+5)*2)
turtle.circle(-9,180)
turtle.forward(103+30+5)
turtle.end_fill()

turtle.penup()
turtle.setheading(270)
turtle.forward(9)
turtle.right(90)
turtle.pendown()

turtle.fillcolor("yellow")
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()

#
turtle.pensize(1)
#
turtle.left(90)
turtle.penup()
turtle.forward(9)
turtle.left(90)
turtle.forward(25)
turtle.left(180)
turtle.pendown()
turtle.forward(50)

turtle.penup()
turtle.home()
turtle.right(90)
turtle.forward(73.6+9+40)
turtle.right(180)
turtle.pendown()
#
turtle.pensize(4)
#
turtle.forward(15)
turtle.right(90)
turtle.fillcolor("black")
turtle.begin_fill()
turtle.circle(5)
turtle.end_fill()

turtle.penup()
turtle.home()
turtle.pendown()

 (c)    http://www.bilibili.com/video/av52523587?share_medium=android&share_source=qq&bbid=XY0E8E7015D854E7AEC2B5AD60883AD5F086E&ts=1557899006859

 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!