I am trying to deal a deck of 52 playing cards amongst 4 players equally, meaning they will each have 13 cards each. I can only seem to deal 4 cards each and i'm not sure why. Any help would be great. I have also attached an image of the output : OUTPUT
public void deals() {
for (int i = 0; i < 4; i++) {
System.out.println("** Player " + (i + 1) + " has been dealt the following cards: **");
for (int j = 0; j <4; j++) {
//System.out.println(ranks[i + j * 4] + " of " + suits[j]);
System.out.println(ranks[i + j] + " of " + suits[j]);
}
}
}
When I change the 4 to a higher number in System.out.println(ranks[i + j * 4] + " of " + suits[j]);
I get an error.