Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part B: CafeWall This image has several levels of structure. Black and white squares are used to form rows and rows are combined to form

Part B: CafeWall

This image has several levels of structure. Black and white squares are used to form rows and rows are combined to form grids. The output has two free-standing rows and four grids. The overall drawing panel is size 650 x 400. Its background is grey and the squares are black and white. A blue X covers each black square. The six figures on the grid should have the following properties:

Description (x, y) position Number of pairs Size of each box 2nd row offset
upper-left (0, 0) 4 20 N/A
mid-left (50, 70) 5 30 N/A
lower left (10, 150) 4 25 0
lower middle (250, 200) 3 25 10
lower right (425, 180) 5 20 10
upper right (400, 20) 2 35 35

Lab2_functions.py

from turtle import * # Draw a line from (x1, y1) to (x2, y2) # Make line color def draw_line(x1, y1, x2, y2, color): # Save current location and state # current_position = pos() pen_state = pen() # Draw line pencolor(color) up() goto(x1, y1) down() goto(x2, y2) up() # Reset position, color, and state # goto(current_position) pen(pen_state) # Draw a draw_rect with the upper left corner at x,y # and with dimensions x_size by y_size. Use color for # background def draw_rect(x, y, x_size, y_size, color): # Save current location and state # current_position = pos() pen_state = pen() # Set rectangle colors fillcolor(color) pencolor(color) # Move Turtle to x,y without drawing a line up() goto(x,y) # Draw the rectangle and fill it down() setheading(90) begin_fill() forward(x_size) right(90) forward(y_size) right(90) forward(x_size) right(90) forward(y_size) end_fill() up() # Reset position, color, and state # goto(current_position) pen(pen_state)

Learner_Template.py

from turtle import * from Lab2_functions import * # set mortar joints between rows MORTAR = 2 def main(): setworldcoordinates(0,400,650,0) clear() shape('turtle') pencolor('olive drab') fillcolor('sienna') bgcolor('grey') #### YOUR CODE GOES HERE ################# ########################################## main() 

image text in transcribed

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

Advances In Databases And Information Systems Uropean Conference Adbis 2020 Lyon France August 25 27 2020 Proceedings Lncs 12245

Authors: Jerome Darmont ,Boris Novikov ,Robert Wrembel

1st Edition

3030548317, 978-3030548315

More Books

Students also viewed these Databases questions

Question

4. Who should be invited to attend?

Answered: 1 week ago

Question

7. How will you encourage her to report back on the findings?

Answered: 1 week ago

Question

Were the decisions based on appropriate facts?

Answered: 1 week ago