「已注销」 2021-10-13 18:33 采纳率: 75%
浏览 218
已结题

用Python画名字,用turtle

颖字坐标算不明白,求救命
import turtle

def run(angle, lenth):
turtle.seth(angle)
turtle.fd(lenth)

def change(x, y):
turtle.penup()
turtle.goto(x, y)
turtle.pendown()
def init():
turtle.pensize(10)
turtle.pencolor("purple")

turtle.setup(800, 400, 200, 200)
init()

  • 写回答

1条回答 默认 最新

  • 关注
    import turtle
    
    def run(angle, lenth):
        turtle.seth(angle)
        turtle.fd(lenth)
    
    def change(x, y):
        turtle.penup()
        turtle.goto(x, y)
        turtle.pendown()
    
    change(-200, 150)
    run(-90, 100)
    run(0, 100)
    run(90, 50)
    
    change(-150, 120)
    run(-120, 85)
    
    change(-200, 20)
    run(0, 100)
    change(-200, 0)
    run(0, 100)
    change(-150, 20)
    run(-90, 120)
    
    change(-150, 0)
    run(-120, 120)
    
    change(-150, 0)
    run(-60, 120)
    #右:
    change(-40, 150)
    run(0, 100)
    change(30, 150)
    run(-110, 70)
    
    change(-40, -10)
    run(90, 100)
    run(0, 100)
    run(-90, 100)
    
    change(10, 90)
    run(-90, 80)
    
    change(10, 10)
    run(-120, 100)
    
    change(10, 0)
    run(-60, 100)
    

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 10月13日
  • 已采纳回答 10月13日
  • 创建了问题 10月13日