sort a list in ascending order without [zl sort]

so here is what im trying to do.
i want to understand what [zl sort] does.
to do this i want to make a patch that does the same but without shortcuts :). now iv been racking my brain but i cant for the life of me work out what to do. All i need is a patch that will do the following conversion to any list of numbers:-

the way i need it to work is it takes the string from a [Message] box load it into a [coll] object then the string needs to be sorted into order and printed in the empty message box at the bottom of the process.

this should work for any set of numbers so it just needs to be in size order smallest to largest.

while these are comical videos . how can i impliment the algorithms in max without using jit.bsort or suchlike
?
i understand the bubble sort algorythm so i will use that one but i just cant work out how to impliment it in max :/

This is all about working with lists. Familiarize yourself with the entire set of zl objects. Make use of simple storage objects such as f, i, zl reg, bag, etc. Make extensive use of the trigger object to direct and sequence events in your patch. Learn to store and edit list elements in indexible objects such as coll, multislider, table, etc. Simplify your goal into a series of sequential steps and implement it one piece at a time.

sure i’d do it without coll too, but it has a text editor, so you can see how the algorithm works for each iteration, so it’s a worthwhile from a diagnostic/prototyping /pedagogical perspective. it also preserves the original order if you don’t renumber the indices, if that’s necessary, and you can easily attach other data to it, like text strings so it’s extensible. but this thread is probably dead anyway, as far as the op is concerned :O

I tried removing them and using triggers to control the order of events, but without them, it looks like coll isn’t finished sorting yet when it dumps. Is there a way to know when coll is finished sorting? (I’d rather not use delays for this sort of thing.)

-- Pasted Max Patch, click to expand. --

Copy all of the following text. Then, in Max, select New From Clipboard.