Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions