Question: In a turtle graphics application, there is a bounding rectangle such that coordinates of bottom left corner are (-300, -300) and those of top right

In a turtle graphics application, there is a bounding rectangle such that coordinates of bottom left corner are (-300, -300) and those of top right corner are (450, 200).

Write code snippet that determines if the turtle is currently inside or outside of the rectangle. Then the code should draw one of the two shapes at the turtle's current position.

A. If inside, draw a square with a side length of 50 pixels. Square should be filled with green color.

B. If outside, draw a circle with radius 75 pixels using a thick blue pen. You do not need to change the turtle heading.

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 Programming Questions!