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

Screw you computer science, computer go brrr.

Also fun fact, qsort() in your libc is likely only *sometimes* quicksort. And it's not quicksort based on a threshold that made sense for a Sun machine.

Anyway, in summary, lol computers

@Pwnallthethings how hard can sorting be anyway??

*checks notes* oh... oh no.