Shuffle

Sean Kelly sean at f4.ca
Fri Jan 25 10:15:25 PST 2008


Walter Bright wrote:
> Roberto Mariottini wrote:
>> I've found players that implement the shuffle function this way: the
>> pseudo random generator always "prefers" a certain subset of the songs
>> and will play them frequently, while other songs are rarely selected
>> (if ever).
>> A real "shuffle" function should generate the same list of songs that
>> the source contains, changing only the order.
> 
> I agree, a much better algorithm would be to shuffle the files[] array,
> then sequentially write the shuffled result.

Strangely, I added a shuffle routine to tango.core.Array just yesterday.


Sean


More information about the Digitalmars-d-announce mailing list