Exemplo n.º 1
0
 def test_rotate_piece_clockwise_through_all_rotations(self):
     p = Piece(Piece.T_SHAPE)
     
     rotations = [((0, 2), (1, 1), (1, 2), (2, 2)),
                  ((0, 2), (1, 1), (1, 2), (1, 3)),
                  ((0, 2), (1, 2), (1, 3), (2, 2)),
                  ((1, 1), (1, 2), (1, 3), (2, 2)),
                  ((0, 2), (1, 1), (1, 2), (2, 2))]
     for all_points in rotations:
         for point in all_points:
             self.assertEqual(p.value_at(point[0], point[1]), 2)
         p.rotate_clockwise()