Skip to content Skip to sidebar Skip to footer

Turtle Graphics Drawing Over Itself

This should be a very simple question, however, it is proving difficult for me. I'm rather new to turtle graphics, and so, I am trying to get a simple drawing done. My turtle wil

Solution 1:

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.

Post a Comment for "Turtle Graphics Drawing Over Itself"