probably any sort algorithm you want, but there are limits to the arrays, only 1d. Can use loops and swap values to sort.
something like this should swap:
if arr[x]<arr[y] then (
temp := arr[y];
arr[y] := arr[x];
arr[x] := temp;
);
look up loops, and you will probably want a flag that a swap has occurred, so when none are performed, you know that you are done.
HTH