I have been trying to write a program to sort a list and cannot seem to get it right...:
Triliste[a_] :=
Module[{min, x, i, j}, For[i = 1, i < Length[a], min := i;
For[j = i + 1, j <= Length[a],
If[a[[j]] < a[[min]], min := j]]; x,
If[min! i, x := a[[i]]; a[[i]] = a[[min]]; a[[min]] := x]]
] a;
what is wrong?