Question: table at https://ibb.co/dtdJjn def pos_if_rotated(shape, positions, loc, number_rotations): This function will return the positions after they have been rotated clockwise number_rotations times. The positions are

table at https://ibb.co/dtdJjn

def pos_if_rotated(shape, positions, loc, number_rotations): This function will return the positions after they have been rotated clockwise number_rotations times. The positions are those of a shape which has been offset from the default location by loc (a tuple containing dx and dy from (0,0)). Look at the rotations from the tetrominoes table in the previous section for exactly how the shape should look after a rotation.

? Return value: The positions when rotated (as a list).

? Assumptions:

o shape will be a capital letter from the list of tetromino abbreviations (e.g. "O") o positions will be a list of (any number of) position tuples (and are assumed to be part of the shape) this is to allow us to add additional shapes later if we want o loc will be a tuple with two integer values o number_rotations will be a non-negative integer

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!