barebones sort algorithm
- by user309322
i have been asked to make a simple sort aglorithm to sort a random series of 6 numbers into numerical order. However i have been asked to do this using "Barebones" a theoretical language put forward in the Book Computer Science an overview.
Some information on the language can be found here http://www.brouhaha.com/~eric/software/barebones/
Just to clarify i am a student teacher and have been doing anaysis on "mini-programing languages" and their uses in a teaching environment, i suggested to my tutor that i look at barebones and asked what sort of exmaple program i should write . He suggested a simple sort algorithm. Now since looking at the language i cant understand how i can do this without using arrays and if statements.
The code to swap the value of variables would be
while a not 0 do;
incr Aux1;
decr a;
end;
while b not 0 do;
incr Aux2
decr b
end;
while Aux1 not 0 do;
incr a;
decr Aux1;
end;
while Aux2 not 0 do;
incr b;
decr Aux2;
end;
however the language does not provide < or operators