Random Tag Call Script [C#]

I’m looking for a way to randomly call 0 to 51 Tags (Prefabs that i have Tagged from 0 to 51). These prefabs are Card textures (clubs,spades,hearts and diamonds) and i want a button that you can click to randomly call a card… I also need to have cards that are called to be removed from the list, so they don’t come up twice in one game… (I’l be adding a RESET button).

private List deck = new List();

... add your cards to the list ...

Card GetCard()
{
    int idx = Random.Range(0, deck.Count);
    Card theCard = deck[idx];
    deck.RemoveAt(idx);
    return theCard;
}

void OnGUI()
{
... call GetCard() here ...
}

Syclamoth has a good point in the comments. For reference, here’s a generic shuffle algorithm for a C# list that I’ve used for a while:

 // From http://stackoverflow.com/questions/273313/randomize-a-listt-in-c
    public static void Shuffle<T>(this IList<T> list)
        {
        Random rng = new Random();
        int n = list.Count;
        while (n > 1)
            {
            n--;
            int k = rng.Next(n + 1);
            T value = list[k];
            list[k] = list[n];
            list[n] = value;
            }
        }

Thanks guys for the replys , i didn’t realise my post actually made it. i started a new one here …

@Matthias , i’ve seen similar scripts “Fisher Yates” n such … but i am a complete noob, this is my first EVER project and im confused on how to set my card prefabs (textures) to run with this posted scripts.