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.
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 (the language) and asked what sort of exmaple program I should write. He suggested a simple sort algorithm. Now since looking at the language I can't 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.
What could I use as a workaround?