JohnBaek
6/28/2016 - 7:44 AM

C#_Make_Random_ListOrder.cs

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;
}