Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Code default_pos_of_shape(shape): This function will return the four positions of a given shape (one for each square) if the shape was placed at the

Python Code

default_pos_of_shape(shape): This function will return the four positions of a given shape (one for each square) if the shape was placed at the top left corner. If you look at the Table of Tetrominoes on page 2, the yellow/orange squares shown in the Default column are the positions you need to return. For example, for the I-tetromino, the first coordinate is (0,0), the second is (1,0), etc. ? Return value: A list containing the four positions of the tetromino parts (remember, positions are represented using tuples of (x,y) coordinates). ? Assumption: shape will be a capital letter from the list of tetromino abbreviations (e.g. "O") ? Notes: o The order of the positions does not matter as long as you return all four correctly. o Hint: It is ok to hard code this function, but only this function. ? Example: o default_pos_of_shape("I") ? [(0,0),(1,0),(2,0),(3,0)]

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions