public static void createDeck(String[] myDeck)
{
String[] num={"Ace","2","3","4","5","6","7","8","9","10","Jack","Queen","King"};
int count=0; // count starts at zero
for(int x=0; x<13; x++)
myDeck[x]=num[x]+" of Diamonds";
count++; // count is now 1
for(int x=13; x<26; x++)
myDeck[count]=num[count]+" of Spades"; // this always accesses myDeck[1] and num[1]
count++; // count is now 2
for(int x=26; x<39; x++)
myDeck[count]=num[count]+" of Hearts"; // this always accesses myDeck[2] and num[2]
count++; // count is now 3
for(int x=39; x<52; x++)
myDeck[count]=num[count]+" of Clubs"; // this always accesses myDeck[3] and num[3]
} // end createDeck
What you need to do is keep track of the total number of cards generated, and use that to index through the deck:
public static void createDeck(String[] myDeck)
{
String[] num={"Ace","2","3","4","5","6","7","8","9","10","Jack","Queen","King"};
int count=0;
for(int x=0; x<13; x++, count++)
myDeck[count]=num[x]+" of Diamonds";
for(int x=0; x<13; x++, count++)
myDeck[count]=num[x]+" of Spades";
for(int x=0; x<13; x++, count++)
myDeck[count]=num[x]+" of Hearts";
for(int x=0; x<13; x++, count++)
myDeck[count]=num[x]+" of Clubs";
} // end createDeck
Or you could add another array to store the suits as suggested above (although that solution does not conform to the requirements).
Edit: My initial post was incorrect -- I appologise if anyone saw it before I had a chance to correct.