Last active
June 28, 2016 07:45
-
-
Save JohnBaek/96e1db7390db3f1d85ffbfdf58e6e8ee to your computer and use it in GitHub Desktop.
C#_Make_Random_ListOrder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private List<string> GetShuffledArray(List<string> array) | |
{ | |
List<string> result = | |
new List<string>(); | |
Random r = new Random(); | |
while (array.Count > 0) | |
{ | |
int i = r.Next(array.Count); | |
result.Add(array[i]); | |
array.RemoveAt(i); | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment