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

第一次作业

时间:2018-03-22 19:13:43      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:turtle   gre   imp   from   port   div   let   pen   ons   

import turtle as t
t.setup(600, 600, None,None)
t.pu()
t.fd(-120)
t.pensize(5)
t.width(5)
t.pencolor("darkgreen")
t.pd()
t.fd(250)
t.seth(120)
t.pencolor("black")
t.fd(250)
t.seth(-120)
t.pencolor("blue")
t.fd(250)
t.pencolor("purple")
t.fd(250)
t.seth(0)
t.pencolor("green")
t.fd(250)
t.pencolor("gold")
t.fd(250)
t.seth(120)
t.pencolor("red")
t.fd(250)
t.seth(-120)
t.pencolor("grey")
t.fd(250)
t.seth(120)
t.pencolor("violet")
t.fd(250)

 

import turtle
from turtle import done
 
t = turtle.Pen()
turtle.bgcolor("black")
t.pencolor("white")
i=0
while i<=5:
    t.forward(100)
    t.left(60)
    i=i+1
 
done()

 

import turtle  
  
turtle.left(30)  
turtle.forward(144)  
  
turtle.right(60)  
turtle.forward(144)  
  
turtle.right(60)  
turtle.forward(144)  
  
turtle.right(60)  
turtle.forward(144)  
  
turtle.right(60)  
turtle.forward(144)  
  
turtle.right(60)  
turtle.forward(144)  
  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.left(60)  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.left(60)  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.left(60)  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.left(60)  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.left(60)  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.exitonclick()  

 

 

import turtle 

def drawSnake(rad,angle,len,neckrad):
    for i in range (len):
        turtle.circle(rad,angle)
        turtle.circle(-rad,angle)
    turtle.circle(rad,angle/2)
    turtle.fd(rad)
    turtle.circle(neckrad+1,180)
    turtle.fd(rad*2/3)
def main():
    turtle.setup(1300,800,0,0)
    pythonsize = 30
    turtle.pensize(pythonsize)
    turtle.pencolor("blue")
    turtle.seth(-40)
    drawSnake(40,80,5,pythonsize/2)

main()

 

第一次作业

标签:turtle   gre   imp   from   port   div   let   pen   ons   

原文地址:https://www.cnblogs.com/quanyitian-199810310032/p/8625367.html

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