Skip to content

Instantly share code, notes, and snippets.

@JohnBaek
Last active June 28, 2016 07:45
Show Gist options
  • Save JohnBaek/96e1db7390db3f1d85ffbfdf58e6e8ee to your computer and use it in GitHub Desktop.
Save JohnBaek/96e1db7390db3f1d85ffbfdf58e6e8ee to your computer and use it in GitHub Desktop.
C#_Make_Random_ListOrder.cs
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