title: Trying to assign card pictures, but it gives me wrong cards
body: <p>I have this method:<br>
  I am trying to assign picture of a card into their <code>iconCards[][]</code> profiles. Pictures are located in images/ folder as e.g. <code>images/AS.gif (Ace of Spades), images/AD.gif (Ace of Diamonds)</code> etc.</p>
  
  <pre><code>static void loadCardIcons(){
      int l =0;
      int k =0;
  
      while (k &lt; 14){
          for (l = 0; l &lt; 4; l++){
              String card = "images/" + Character.toString(valueRanks[k]) + "C.gif";
              iconCards[k][l] = new ImageIcon(card);
              System.out.println(k + " " + l + "   " + card);
              card = "images/" + Character.toString(valueRanks[k]) + "D.gif";
              iconCards[k][l++] = new ImageIcon(card);
              System.out.println(k + " " + l + "   " + card);
              card = "images/" + Character.toString(valueRanks[k]) + "H.gif";
              iconCards[k][l++] = new ImageIcon(card);
              System.out.println(k + " " + l + "   " + card);
              card = "images/" + Character.toString(valueRanks[k]) + "S.gif";
              iconCards[k][l++] = new ImageIcon(card);
              System.out.println(k + " " + l + "   " + card);
              k++;
          }
      }
      iconBack = new ImageIcon("images/BK.gif");
  }
  
  
  ...12 3   images/KS.gif
  13 0   images/XC.gif
  13 1   images/XD.gif
  13 2   images/XH.gif
  13 3   images/XS.gif
  
  *13
  2
  images/XS.gif*
  </code></pre>
  
  <p>You can see that <code>value = 13 and suit = 2</code>. According to output above the card should be <code>images/XH (JokerHearts)</code>, but it prints me XS. Why? Here's the method that runs it. Can't find out what's going on for weeks.</p>
  
  <pre><code>static public Icon getIcon(Card card){
      loadCardIcons();
  
      return iconCards[valueAsInt(card)][suitAsInt(card)];
  }
  </code></pre>