Cody Bable

Generation

generate functionFri, 28 Apr 2023

create a function to store the mouse clicks and redraw from the mouse clicks in turtle.

def mouse_click(): x, y = t.pos() t.ondrag(None) t.goto(x, y) t.stamp() t.ondrag(t.goto) def on_click(x, y): red_turtle.goto(x, y) mouse_click() def on_drag(x, y): red_turtle.goto(x, y) mouse_click() red_turtle.ondrag(on_drag) red_turtle.onclick(on_click)

Questions about programming?Chat with your personal AI assistant