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

画国旗,画等边三角形

时间:2020-08-02 22:25:45      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:row   color   三角形   set   import   col   end   forward   red   

#画国旗
import turtle
turtle.speed(5)
turtle.setup(800,600)
turtle.pensize(6)
turtle.pencolor("brown")

turtle.penup()
turtle.goto(-350,-300)
turtle.pendown()
turtle.left(90)

turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.forward(50)

turtle.penup()
turtle.goto(-200,-250)
turtle.pendown()
turtle.left(180)
turtle.forward(50)
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(50)

turtle.penup()
turtle.goto(-160,-200)
turtle.pendown()
turtle.left(180)
turtle.forward(400)
turtle.right(90)
turtle.forward(20)
turtle.right(90)
turtle.forward(400)

turtle.penup()
turtle.goto(-140,200)
turtle.pendown()
turtle.pencolor(‘red‘)
turtle.left(90)
turtle.forward(300)
turtle.right(90)
turtle.forward(200)
turtle.right(90)
turtle.forward(300)

#画等边三角形、

import turtle
turtle.pensize(10)
turtle.pencolor("red")

turtle.right(120)
turtle.forward(200)
turtle.right(120)
turtle.forward(200)
turtle.right(120)
turtle.forward(200)

画国旗,画等边三角形

标签:row   color   三角形   set   import   col   end   forward   red   

原文地址:https://blog.51cto.com/14887662/2515946

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