Question: Connect the dots In this assignment, you will write a Python script that generates a turtle connecting dots. You will need two turtles in this

 Connect the dots In this assignment, you will write a Python

Connect the dots In this assignment, you will write a Python script that generates a turtle connecting dots. You will need two turtles in this assignment: 1. Turtle 1: For placing dots on screen. Its shape should be a dot, color should be red, and pensize should be 5. This turtle is hidden until the user clicks on the screen with left button of the mouse. When user clicks a location on screen, this turtle should go to that location, becomes visible and stamps that location with a dot. Afterwards, it should hide itself again until the next button click. If user presses 's' (or S) on the keyboard, Turtle 1 do not put dots on screen anymore. 2. Turtle 2: For connecting dots. Its shape should be a turtle, color should be blue, and pensize should be 2. This turtle is visible and it should wait until the user presses 's' or 'S') on the keyboard. When user presses for 'S) on the keyboard, it draws line between the dots on screen in their correct order (from 1st placed dot to 2nd placed dot, from 2nd placed dot to 3rd placed dot etc). If there is no dots or a single dot on screen, Turtle 2 does nothing If user presses''r' (or "R") on keyboard for reset, all lines and dots on screen should be cleared, Turtle 2 should go to the home position. In addition, Turtle 1 and Turtle 2 should again perform as described above (Turtle 1 putting dots and Turtle 2 waiting for keypress and connect-dots)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!