Had to implement a sorting algorithm today for the first time in my entire career, so i guess finally learning about them decades ago paid off
Unfortunately since then, I've also learned about test-driven development, and forgotten everything I learned back then. So just went with
1. First implement a test routine "IsSorted(list)" to check the algorithm is right
Sort(list):
While(!IsSorted(list))
SwapRandomEntries(list);
return