oggy22 / MusicTools

Various musical tools including music hearing, machine composer and Chomsky music analyzer.
4 stars 2 forks source link

All paths #19

Open oggy22 opened 7 years ago

oggy22 commented 7 years ago

Write a method which enumerates all the paths starting and ending at designated tones. For example paths from 3 to 4, in increasing length order are: 3-4, 3-4-5-4, 3-4-3-4, 3-2-3-4, 3-4-5-6-5-4, 3-4-5-4-5-4, 3-4-5-4-3-4, etc. Optionally a flag is passed to control repetitions, if its on there is even more paths. Repetition of the same tone e.g. 3-2-2-3-4-4