title: How to solve argument out of range exceptions
body: <p>So I've been looking around for quite a while to try and find a solution to this.
  I've been trying to make a card game and am stuck at a section in which I create a cad along with its properties. i decided to make it in the form of an array. The code looks like:</p>
  
  <p>(not sure what happened with these first ones)</p>
  
  <pre><code>string[] dogs = System.IO.File.ReadAllLines(@"C:\Users\corin\Documents\C# coding\dogs.txt");
  
  int individual = totalCards / 2;
  
  Random r = new Random();
  int Cards = totalCards / 2;
  
  List&lt;List&lt;int&gt;&gt; playerCards = new List&lt;List&lt;int&gt;&gt;(Cards);
  
  for (int x = 0; x &lt; (Cards-2); x++)
  {
      playerCards[0].Add(Int32.Parse(dogs[x]));//Cards
      playerCards[1].Add(r.Next(1, 6));//Drool
      playerCards[2].Add(r.Next(1, 101));//Exercise
      playerCards[3].Add(r.Next(1, 11));//Intelligence
      playerCards[4].Add(r.Next(1, 11));//Friendliness
  }
  </code></pre>
  
  <p>No errors are raised before I run the code but when I try it an Argument out of range exception occurs for the line: playerCards[0].Add(Int32.Parse(dogs[x]));
  I tried removing it and the same error occured for the next line. I'm not sure what I've done wrong and have tried to find a solution for quite some time. If anyone has any tips or answers that would be great.
  Thanks</p>