Joined March 2012
·
Posted to
Order by Random in C#
over 1 year
ago
This is much better: http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm
There's a discussion about it on SO: stackoverflow.com/questions/1287567/is-using-random-and-orderby-a-good-shuffle-algorithm/1287572
Achievements
38 Karma
0 Total ProTip Views
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
Forked
Have a project valued enough to be forked by someone else
Charity
Fork and commit to someone's open source project in need
Lab
Have at least one original repo where C# is the dominant language
Anyways, I prefer my implementation because it catches argument errors earlier.
Here it is: https://bitbucket.org/jpbochi/jplabscode/src/025d97301e69600f046c65281a009733be5deed9/Extensions/EnumerableExt.cs?at=default#cl-309