示例#1
0
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
示例#2
0
 def test_spiral(self):
     shape = Shape('#...:.#..:..#.:...#')
     rotated = shape.rotate()
     assert rotated == '.#..:..#.:...#:#...'