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

绘制玫瑰

时间:2017-10-23 21:47:10      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:goto   color   log   col   gre   rtl   分享   range   pen   

import turtle
turtle.setup(0.35,0.75)
turtle.seth(90)
turtle.penup()
turtle.fd(200)
turtle.seth(0)
turtle.pendown()
turtle.fillcolor("red")
turtle.begin_fill()
for i in range(1,4):
    turtle.circle(20*i,200)
turtle.circle(20,30)
turtle.seth(-90)
turtle.fd(40)
turtle.fd(60)
turtle.seth(120)
turtle.fd(10)
turtle.fd(10)
turtle.left(180)
turtle.seth(-135)
turtle.seth(-120)
turtle.circle(100,45)
turtle.circle(100,45)
turtle.circle(100,10)
turtle.circle(100,10)
turtle.seth(30)
turtle.circle(180,80)
turtle.seth(-100)
turtle.circle(-180,10)
turtle.seth(120)
turtle.circle(50,30)
turtle.end_fill()
turtle.seth(-30)
turtle.circle(-50,30)
turtle.seth(-100)
turtle.circle(-180,30)
turtle.circle(138,46)
turtle.seth(45)
turtle.circle(50,45)
turtle.circle(50,45)
turtle.circle(50,10)
turtle.circle(-145,32)
turtle.penup()
turtle.goto(30,200)
turtle.seth(45)
turtle.fd(32)
turtle.seth(-90)
turtle.pendown()
turtle.fd(80)
turtle.penup()
turtle.goto(0,15)
turtle.pendown()
turtle.circle(180,30)
turtle.seth(10)
turtle.circle(180,20)
turtle.penup()
turtle.left(180)
turtle.fd(30)
turtle.seth(180)
turtle.fd(20)
turtle.seth(-90)
turtle.fd(2)
turtle.pendown()
turtle.fillcolor("green")
turtle.begin_fill()
turtle.seth(75)
turtle.circle(-80,80)
turtle.seth(-100)
turtle.circle(-75,90)
turtle.end_fill()
turtle.seth(20)
turtle.circle(100,40)
turtle.left(180)
turtle.circle(-100,40)
turtle.seth(200)
turtle.fd(10)
turtle.seth(-60)
turtle.fd(100)
turtle.seth(180)
turtle.circle(100,10)
turtle.seth(150)
turtle.begin_fill()
turtle.circle(80,80)
turtle.seth(150)
turtle.fd(5)
turtle.seth(-30)
turtle.circle(90,75)
turtle.end_fill()
turtle.seth(-160)
turtle.circle(-100,30)
turtle.left(180)
turtle.circle(100,30)
turtle.seth(15)
turtle.fd(15)
turtle.seth(-60)
turtle.fd(100)
turtle.exitonclick()

  技术分享

绘制玫瑰

标签:goto   color   log   col   gre   rtl   分享   range   pen   

原文地址:http://www.cnblogs.com/syl-777/p/7718797.html

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