Random Sort/Shuffle a List
I'm trying to figure out an efficient method to randomly shuffle a list. Basically an implementation of Fisher/Yates/Knuth algorithm. In order to do this efficiently the best way is to repeatedly swap two elements in a list (or even a map). The built in functions do not seem to allow you directly write to elements in lists. So I end up having to repeatedly create temporary lists. Which is obviously very inefficient and slow.
Can anyone think of a better way to easily swap two elements within the same list.
Any tips or advice much appreciated.