(Jun-09-2020, 03:44 PM)DPaul Wrote: I have this working (looks like an erratic line) but i am unsure that I understand what you need.
1) Is putting the points in a dictionary essential to the setup?
(I put them simply in a 2D list)
2) Turtle moves forward with the X value and left with the Y value?
Or do you want it to jump from x,y to x,y, that's something else.
Paul
1) yes the poinds needs to be put in a dictionnary, we don't have the right to modify it.
2) this dictionnary assembles all the displacement the turtle will do; in the end we need to have a heart.
(Jun-09-2020, 03:44 PM)DPaul Wrote: I have this working (looks like an erratic line) but i am unsure that I understand what you need.
1) Is putting the points in a dictionary essential to the setup?
(I put them simply in a 2D list)
2) Turtle moves forward with the X value and left with the Y value?
Or do you want it to jump from x,y to x,y, that's something else.
Paul
1) yes the poinds needs to be put in a dictionnary, we don't have the right to modify it.
2) this dictionnary assembles all the displacement the turtle will do; in the end we need to have a heart.
I've edited my code:
def draw_figure(x0,y0,D): tracer(True) penup() goto(x0,y0) pendown() begin_fill() for i in D: pen.right('X') #to access the index of X pen.left('Y') end_fill() print(draw_figure(10,20,D1))
Error:for i in D:
NameError: name 'D' is not defined
(Jun-09-2020, 03:44 PM)DPaul Wrote: I have this working (looks like an erratic line) but i am unsure that I understand what you need.
1) Is putting the points in a dictionary essential to the setup?
(I put them simply in a 2D list)
2) Turtle moves forward with the X value and left with the Y value?
Or do you want it to jump from x,y to x,y, that's something else.
Paul
1) yes the poinds needs to be put in a dictionnary, we don't have the right to modify it.
2) this dictionnary assembles all the displacement the turtle will do; in the end we need to have a heart.
I've edited my code:
def draw_figure(x0,y0,D): trace(True) penup() goto(x0,y0) pendown() begin_fill() for i in D: pen.right('X') #to access the index of X pen.left('Y') end_fill() print(draw_figure(10,20,D1))
Error:for i in D:
NameError: name 'D' is not defined