All pastes #992585 Raw Edit

Something

public text v1 · immutable
#992585 ·published 2008-04-21 22:42 UTC
rendered paste body
List<Card> cards = new List<Card>();

cards.Add(new Card("Lion" .. . .. .. . .));

// You keep doing this for all your cards and stuff!

Random rand = new Random();
Stack<Card> deck = new Stack<Card>();

while ( cards.Count != 0 )
{
    int currentCardIndex = rand.Next(0, cards.Count - 1);

    deck.Push(cards[currentCardIndex]);
    cards.Remove(currentCardIndex);
}

// The stack is now a shuffled deck
// To deal a card, simply do deck.Pop() and it will return the card you need to deal