Draw squares at different positions accepts incorrect results.
So my code is this:
func run(): position.x = 100 position.y = 100 draw_rectangle(100, 100) jump(200,0) draw_rectangle(100, 100) jump(200,0) draw_rectangle(100, 100)
Which gives the output
which is incorrect. I'm assuming draw_rectangle() essentially starts from position.x and position.y, resetting to that position, and then adding given dimensions to where it originally was. Or is there something else going on?
Your function is actually correct. when you finish an equal-side rectangle, a square, you are at the left-top corner. and when you jump, you are moving to the first corner of the next square in the correct position. (100 + 200 + 200). sometimes, there is no single solution.
the problem is with jumping visuals. when the turtle jumps, its visuals do not follow what it should do. it should stop drawing and must end up at that location. but instead, it leaves a trail behind.
I am guessing this is because the screen window is also moving when the turtle moves to the next drawing next square.