1. Poker is the game...
2. Checking for the best of hands to determine winner.
3. Ties are possible...but I do not think my code handes the tie (ie. two straights of the same rank- different suits)
Here is determine hands if needed...
public static void displayHand(int[] hand)
{
// Display each card.
for (int card = 0; card < HAND_SIZE; card++) {
System.out.print(" " + (card+1) + ": ");
// Display the card's numerical value.
switch (hand[card] / 4) {
case 14 : System.out.print("Ace");
break;
case 13 : System.out.print("King");
break;
case 12 : System.out.print("Queen");
break;
case 11 : System.out.print("Jack");
break;
default: System.out.print(hand[card] / 4);
}
System.out.print(" of ");
// Display the card's suit.
switch (hand[card] % 4) {
case 0 : System.out.println("hearts");
break;
case 1 : System.out.println("clubs");
break;
case 2 : System.out.println("diamonds");
break;
case 3 : System.out.println("spades");
break;
}
}
System.out.println();
}
Thanks