tracks/python/exercises/scale-generator/example.py in trackler-2.2.1.13 vs tracks/python/exercises/scale-generator/example.py in trackler-2.2.1.14
- old
+ new
@@ -24,9 +24,11 @@
pitches = []
scale = self._reorder_chromatic_scale()
for i, interval in enumerate(self.pattern):
pitches.append(scale[last_index])
last_index += self.ASCENDING_INTERVALS.index(interval) + 1
+ if pitches[0] != scale[last_index % len(scale)]:
+ raise ValueError()
return pitches
def _reorder_chromatic_scale(self):
index = self.chromatic_scale.index(self.tonic)
return self.chromatic_scale[index:] + self.chromatic_scale[:index]