ToArray() within a differnt method
<p>I have an array named <code>mainDeck</code> which holds the values for a deck of playing cards. What I have to do next is distribute the cards within that array to two separate arrays named <code>playerDeck</code> and <code>computerDeck</code> and each deck must contain a unique card. The problem I have is distributing the cards with a unique value - 26 cards per deck. I have tried a few different approaches and the coding at the bottom in comments is the last remnant of what I was trying to do before I had to leave for class which isn't finished.</p>

<p>To Note: My programming skills are limited to please explain your answer rather then just give a solution as that doesn't further my understanding.</p>

<pre><code>static void Main(string[] args)
    {
        // 1 = Ace , 13 = King : 0 = Hearts, 1 = Diamonds, 2 = Clubs, 3 = Spades
        int[] mainDeck = new int[52];
        FillDeck(mainDeck);

        int[] playerDeck = new int[26];
        int[] computerDeck = new int[26];
        // Check mainDeck elements
        foreach (int number in mainDeck)
        {
            Console.WriteLine(number);
        }

    }
    public static void FillDeck(int [] mainDeck)
    {
        int cardType = 1;
        List&lt;int&gt; deck = new List&lt;int&gt;();            

        // Add cards to a list
        for (int x = 0; x &lt; 13; x++)
        for(int y = 0; y &lt; 4; y++)
        {
            deck.Add(cardType);
            if (y == 3)
                ++cardType;
        }

        // Insert deck list into a new Array
        int[] cards = deck.GetRange(0, 52).ToArray();

        // Add cards array to mainDeck
        for (int x = 0; x &lt; 52; ++x)
        {
            mainDeck[x] = cards[x];
        }
    }
    //public static void Distribute()
    //{
    //    RandomNumber number = new RandomNumber();
    //    int value = number.RandomNum;

    //    List&lt;int&gt; playerCards = new List&lt;int&gt;();
    //    for (int x = 0; x &lt; 2; ++x)
    //    {
    //        Console.WriteLine(number.RandomNum);
    //    }
    //}
}
//class RandomNumber
//{
//    private int randomNum;
//    Random ranNumberGenerator;

//    public RandomNumber()
//    {
//        ranNumberGenerator = new Random();
//    }

//    public int RandomNum
//    {
//        get
//        {
//            randomNum = ranNumberGenerator.Next(1, 26);
//            return randomNum;
//        }
//    }
//}
</code></pre>

<p>}</p>
