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
Step: 1
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