def get_all_orientations(shape): all_orientations = [] for _ in range(0, 4): key = shape.rotate() all_orientations.append(key) shape = Shape(key) shape = Shape(shape.flip()) for _ in range(0, 4): key = shape.rotate() all_orientations.append(key) shape = Shape(key) return all_orientations
def test_spiral(self): shape = Shape('#...:.#..:..#.:...#') rotated = shape.rotate() assert rotated == '.#..:..#.:...#:#...'