Skip to main content
1 of 3
badatgolf
  • 1.5k
  • 4
  • 7

Print the notes of an increasing octave-repeating scale.

Challange

To quote Wikipedia:

An octave-repeating scale can be represented as a circular arrangement of pitch classes, ordered by increasing (or decreasing) pitch class. For instance, the increasing C major scale is C–D–E–F–G–A–B–[C], with the bracket indicating that the last note is an octave higher than the first note.

So, your job today, is given a major or minor scale, print the notes.

Input/Output

Input/Output can be taken in any reasonable format for taking the name of the scale and returning the set of the increasing octave-repeating notes of that scale.

Input -> Output
C -> [C, D, E, F, G, A, B]
Cm -> [C, D, Eb (D#), F, G, Ab (G#), Bb (A#)]
G -> [G, A, B, C, D, E, F# (Gb)]

This is , so the shortest answer (in bytes) wins!

badatgolf
  • 1.5k
  • 4
  • 7