title: Dealing Cards game: x cards per y over z Amount of Players Algorithm in C#
body: <p>I've been trying to come up with an algorithm which deals, as the title states,
  X amount of Cards, per Y amount of Cards, over Z amount of Players of a normal (52 piece) Deck of Cards which is sorted or unsorted. I've been walking into a wall for the past few hours to come up with a working solution, while also Googling to find similar problems. Unfortunately without success, hence this question.</p>
  
  <p>An example would be: dealing 2 Cards, per 1, over 2 Players would result in</p>
  
  <ol>
  <li>Player 1 receiving 1 card</li>
  <li>Player 2 receiving 1 card</li>
  <li>Player 1 receiving 1 card</li>
  <li>Player 2 receiving 1 card</li>
  </ol>
  
  <p>Until now I have a solution with which I'm able to run my application, although the actual dealing algorithm isn't keeping the 'per' parameter into account. It will deal the right amount of cards to the Y amount of players, although each player will receive the total amount to be dealed in 1 go..</p>
  
  <p>I was wondering if anyone here had to handle a similar problem in the past? Or could guide me into the right direction? :/</p>
  
  <pre><code>public List&lt;Card&gt;[] Deel(int per, int players, int cards)
      {
          _currentCard= 0;
          List&lt;Card&gt;[] output = new List&lt;Card&gt;[players];
          if (_cardsDistributed &lt; _deck.Count)
          {
              for (int i = 0; i &lt; players; i++)
              {
                  List&lt;Card&gt; hand = new List&lt;Card&gt;();
                  for (int j = 0; j &lt; cards; j++)
                  {
                      _currentCard= 0;
                      hand.Add(_deck[_currentCard]);
                      _deck.Remove(_deck[_currentCard]);
                      _cardsDistributed++;
                  }
                  output[i] = hand;
  
              }
              return output;
          }
          else
              return null;
      }
  </code></pre>