Oct 16 2013 | 7:00 pm

Ok so the challenge is this.
i need to create a bubble sort algorithm that can get a string of numbers

eg. 1 3 2 4 6 5

and convert it to

1 2 3 4 5 6

as the algorithm is designed for. i.e putting the numbers in ascending order.

now my problem goes like this. i dont want to use any fancy sorting objects. what i have in my head is a patch that starts with the string of jumbled numbers of any length in a message box. the numbers would then be funneled into a coll object with listfunnel putting them in the coll as follows:-

0, 1;
1, 3;
2, 2;
3, 4;
4, 6;
5, 5;

now at this point is where i run into problems......

what i need is a way to reference each 'symbol/register' and perform the sums on its contents.

now i dont know what i need here and iv scoured the web but here is my imaginary object that may or may not exist under a different name.

eg.

[GetVariableFromColl @Symbol 4]

using the [coll] from above, this "object" would return a value of 6 which is the number stored in the register/symbol referenced by the 4.

in this way i can process my numbers easily, using the registers which will not change meaning i can do it for any string not just this one.

now if anybody can help me with this it sure would help me out with all the headaches its giving me! im open to anything to help. i just really want to be able to do this at a very low level as apposed to just plugging my string into a [zl sort] box and it being done straight away i really want to get down and dirty with the algorithm.

that being said if anybody does know a way of organising a set of numbers into numerical order without using [zl sort] i would also be very interested in hearing about it.

i can add my patch so far if anybody wants to have a look but unfortunately the hurdle i am faced with is quite early in my chain so the patch doesent consist of much. :/

Many Many thanks in advance for any help you can offer i look forward to any responses!

MiRAGE