-- sort.ada -- This is just the package body, Sort.ada or Sort.adb but you -- also need Sort_.ada or Sort.ads , the specification. -- Add additional "tag along" arrays as Arr2, Arr2, etc as desired -- change types of arrays as desired. -- Note: "Size" not needed, user can pass in a slice of an array. -- Later, this will be a Generic Package and types will not be hard coded. -- This is the simplest and slowest N**2 sort. package body Sort is procedure NNSort ( Size : Integer ; Arr1 : in out Int_Array ) is Temp : Integer ; begin for I in 1 .. Size - 1 loop for J in I + 1 .. Size loop if Arr1 ( I ) > Arr1 ( J ) then Temp := Arr1 ( I ) ; Arr1 ( I ) := Arr1 ( J ) ; Arr1 ( J ) := Temp ; end if ; end loop ; end loop ; end NNSort ; end Sort ;