码迷,mamicode.com
首页 > 其他好文 > 详细

这是一朵美丽的玫瑰花

时间:2017-10-27 15:30:34      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:port   开始   circle   努力   img   down   我的小伙伴   turtle   imp   

一开始和我的小伙伴讨论,后来又奋战到凌晨两点,其中填充颜色真是让我们煞费苦心。经过一系列努力,我们没用一次循环,全靠纯粹地画,终于完成了我们的抽象派玫瑰!!

 

#神奇的抽象派玫瑰
import turtle
turtle.setup(0.8,0.8)
turtle.pensize(3)
turtle.penup()
turtle.goto(0,200)
turtle.pendown()
#
turtle.begin_fill()
turtle.fillcolor("red")
turtle.circle(30,50)
turtle.seth(150)
turtle.circle(60,70)
turtle.seth(-30)
turtle.circle(120,60)
turtle.seth(130)
turtle.circle(120,40)
turtle.seth(180)
turtle.fd(10)
turtle.seth(200)
turtle.circle(120,40)
turtle.seth(-90)
turtle.fd(45)
turtle.penup()
turtle.goto(75,205)
turtle.pendown()
turtle.seth(-80)
turtle.fd(45)
turtle.penup()
turtle.goto(0,30)
turtle.pendown()
turtle.seth(130)
turtle.fd(180)
turtle.seth(-25)
turtle.fd(128)
turtle.goto(0,30)
turtle.seth(48)
turtle.fd(210)
turtle.seth(-160)
turtle.fd(150)
turtle.end_fill ()
#
turtle.goto(0,30)
turtle.seth(-110)
turtle.circle(180,50)
turtle.fd(200)
turtle.penup()
turtle.goto(0,-85)
turtle.pendown()
#
turtle.begin_fill()
turtle.fillcolor("green")
turtle.seth(10)
turtle.circle(200,30)
turtle.penup()
turtle.circle(200,15)
turtle.pendown()
#
turtle.seth(180)
turtle.circle(100,76)
turtle.seth(0)
turtle.circle(100,76)
turtle.end_fill ()
#
turtle.penup()
turtle.goto(50,-180)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("green")
turtle.seth(180)
turtle.circle(-200,30)
turtle.penup()
turtle.circle(200,15)
turtle.seth(90)
turtle.fd(35)
turtle.pendown()
turtle.seth(0)
turtle.circle(-100,76)
turtle.seth(180)
turtle.circle(-100,76)
turtle.end_fill ()
turtle.exitonclick()

 

 

 

技术分享

 

这是一朵美丽的玫瑰花

标签:port   开始   circle   努力   img   down   我的小伙伴   turtle   imp   

原文地址:http://www.cnblogs.com/huifeiderendaxia/p/7742585.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!