djmSorter BubbleSort
Bubble Sort that will sort table data of arbitrary length; also permute or reverse order
DESCRIPTION
This a demo for a macro that will sort data in table. The macro should work with any length of data, but is set up at the moment for a table with max length of 40. Increase this by following tooltips in the macro.
The demo has a random intializer, a permuter for scrambling order of the data, and a sorter; also a function for reversing the order of data. After each operation, the data is displayed in CList's event watcher so you can check it. It looks to me like it's working; if you find bugs, report them. Don't know how this will work re. CPU in an CPU intensive instrument.
Done in response to Rolix's thread in the Forum; based on the Permute macro in my ToneRow macro. This version fixes a bug with the permute function and adds a reverse function.
COMMENTS (1)