Advertisement

Python daily practice with Turtle drawing

阅读量:
复制代码
    import turtle
    startx, starty = -350, 300
    def locate(x,y):
    turtle.penup()
    turtle.goto(startx+x,starty-y)
    turtle.pendown()
    
    
    def draw(angle, lenth):
    turtle.seth(angle)
    turtle.forward(lenth)
    
    def curvemove():
    for i in range(25):
        turtle.right(8)
        turtle.forward(4)
    
    def main():
    turtle.pensize(4)
    turtle.speed(6)
    turtle.pencolor("red")
    # turtle.endfill()
    
    # turtle.screensize(500, 500, "blue")
    # 王
    locate(10,90)  # 定位画笔位置
    draw(0,90)     # 0度 向右画
    locate(25,146)
    draw(0,40)
    lo

全部评论 (0)

还没有任何评论哟~