Question: 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

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