Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a function house that takes three parameters: the width w of the house (a float), the height h of the house (a float),
Write a function house that takes three parameters: the width w of the house (a float), the height h of the house (a float), and the bottom left corner c of the house (a tuple of two floats). The corner is represented in turtle coordinates (so the origin (0,0) is the center of the screen). You may assume that c will be chosen to lie on the screen, and that the house will fit on the screen. You may interpret height as either the height to the bottom of the roof or to the top of the roof. The structure and style of the house is up to you, but, for full credit, it must contain the following elements, each of which will be drawn using a helper function, called from the main house function: - a roof - windows (at least 4) - a front door - a chimney - a lawn in front of the house - a path to the front door - a sun or moon in the sky If you are so inspired, feel free to add other elements. The parameters of these functions are up to you. Each element (door, window, sun, ...) must be a different colour. The background colour of the house walls must be a different colour than the elements. (Each window can be the same colour as the other windows.) You may choose the parameters you pass to each function that draws an element. You must use turtle graphics, so you must use the turtle module. If you wish, you may use any other module that we have covered in class (random, math, numpy).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Creating a function to draw a house with the specified elements using the Turtle graphics library is ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started