[Haskell-beginners] Re: randomize the order of a list
Heinrich Apfelmus
apfelmus at quantentunnel.de
Sat Aug 28 04:51:47 EDT 2010
Gaius Hammond wrote:
> I am trying to randomly reorder a list (e.g. shuffle a deck of cards) .
> My initial approach is to treat it as an array, generate a list of
> unique random numbers between 0 and n - 1, then use those numbers as new
> indexes.
For another approach, see also
http://apfelmus.nfshost.com/articles/random-permutations.html
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
More information about the Beginners
mailing list