代码改变世界

绘制玫瑰(结对作业)(闫佳蔓 文茜)

2017-10-30 17:33  闫佳蔓  阅读(260)  评论(0编辑  收藏  举报

import turtle as t
#新建画布
t.setup(1000,600,0,0)

#花外轮廓
t.speed(10)
t.begin_fill()
t.fillcolor("red")

t.penup()
t.goto(-90,180)
t.pendown()
t.circle(-90,4)
t.circle(9,180)
t.circle(30,60)
t.circle(10,130)
t.right(15)
t.circle(200,10)
t.circle(22,180)
t.right(10)
t.circle(50,20)
t.fd(30)

t.circle(50,40)
t.left(45)
t.fd(55)
t.right(130)
t.fd(20)
t.left(130)

t.circle(120,80)
t.left(45)
t.circle(120,80)



t.left(120)
t.circle(24,30)
t.right(160)
t.circle(50,45)


t.penup()
t.goto(-90,180)
t.pendown()


t.end_fill()



#内部线条
t.penup()
t.goto(-20,177)
t.pendown()
t.left(120)
t.circle(-60,75)
t.circle(40,160)

t.circle(120,2)
t.left(50)
t.circle(60,160)
t.right(47)
t.circle(-60,35)


#花茎
t.penup()
t.goto(-43,37)
t.pendown()


t.left(150)
t.circle(300,34)
t.circle(-300,34)

#花枝1
t.penup()
t.goto(-10,-50)
t.pendown()

t.left(120)
t.circle(300,15)



#花叶1
t.begin_fill()
t.fillcolor("green")
t.penup()
t.goto(18,-20)
t.pendown()
t.left(40)
t.circle(-60,75)
t.circle(40,50)
t.right(152)
t.circle(-80,90)
t.penup()
t.goto(18,-20)
t.pendown()
t.end_fill()

#花枝2
t.penup()
t.goto(87,-180)
t.pendown()


t.circle(-300,15)


#花叶2
t.begin_fill()
t.fillcolor("green")
t.penup()
t.goto(40,-185)
t.pendown()
t.left(40)
t.circle(-60,75)
t.circle(40,50)
t.right(152)
t.circle(-80,90)
t.penup()
t.goto(40,-185)
t.pendown()
t.end_fill()




t.penup()
t.goto(200,200)
t.pendown()