On 22/10/26 at 17:43, Greg Wooledge wrote:
> If you want a playlist that's as long as your entire library, you should
> use a shuffling algorithm instead. Load up the array, and then make a
> single pass through the array, swapping items. The code to do this is
> in my previous message in this thread.
Just for the record: and it is also very efficient, I tested it measuring the time it takes with my files and it takes half time than my code, maybe because it uses a single array to store the filenames and then shuffle them.
Save that code or archive the email if you need, in the future, to shuffle a playlist or an array of values.
Kind regards,
--
Franco Martelli