Turtle graphics drawing over itself

核能气质少年 提交于 2019-12-02 04:42:24

I believe the problem is that you're accidentally drawing on the backstroke. Try this instead:

for y in range(height):
    turtle.sety(y)

    turtle.pendown()

    for x in range(width):
        detLand(y, x)
        turtle.setx(x)

    turtle.penup()

    turtle.setx(0)

I believe your problem is this schism:

turtle.setx(x)
turtle.sety(y)

Think about what happens at end of line, you just set Y and then you come around with X = 0 and over draw the line you just finished before Y gets positioned correctly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!