Code/RandomExtensions.cs
using System;
using System.Collections.Generic;

namespace ExtendedCollections;

public static class RandomExtensions
{
    public static void Shuffle<T>(this Random random, IList<T> values)
    {
        int count = values.Count;
        for(int i = 0; i < count - 1; i++)
        {
            int j = random.Next(i, count);
            if(j != i)
            {
                T temp = values[i];
                values[i] = values[j];
                values[j] = temp;
            }
        }
    }
}