public class Num2Card { public static String num2Card( int n ) { /* -------------------------------------------------- Help arrays to translate the card code (0 - 51) to their English names -------------------------------------------------- */ String[] suits = {"Spades", "Hearts", "Diamonds", "Clubs"}; String[] ranks = {"Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"}; int cardSuit = n/13; int cardRank = n%13; return ranks[cardRank] + " of " + suits[cardSuit]; } }