
28 Aug
2010
28 Aug
'10
4:51 a.m.
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