Пример #1
0
 def test_rotate(self):
     n1 = [0, 1, 3, 7]
     self.assertEqual(music.rotate(n1, 0), n1)
     self.assertEqual(music.rotate(n1, 1), [1, 3, 7, 0])
     self.assertEqual(music.rotate(n1, 2), [3, 7, 0, 1])
     self.assertEqual(music.rotate(n1, 3), [7, 0, 1, 3])
     self.assertEqual(music.rotate(n1, 4), [0, 1, 3, 7])
Пример #2
0
 def test_rotate(self):
     n1 = [0, 1, 3, 7]
     self.assertEqual(music.rotate(n1, 0), n1)
     self.assertEqual(music.rotate(n1, 1), [1, 3, 7, 0])
     self.assertEqual(music.rotate(n1, 2), [3, 7, 0, 1])
     self.assertEqual(music.rotate(n1, 3), [7, 0, 1, 3])
     self.assertEqual(music.rotate(n1, 4), [0, 1, 3, 7])
Пример #3
0
def set_sizes(pset):
    return [interval(x, y) for x, y in zip(rotate(pset, len(pset) - 1), pset)]
Пример #4
0
def set_sizes(pset):
    return [interval(x, y) for x,y in zip(rotate(pset, len(pset) - 1), pset)]