Skip to content

Instantly share code, notes, and snippets.

@aeshthetic
Last active December 18, 2016 01:18
Show Gist options
  • Save aeshthetic/8ee097a8145a8484a49aa6d1b8f5ef53 to your computer and use it in GitHub Desktop.
Save aeshthetic/8ee097a8145a8484a49aa6d1b8f5ef53 to your computer and use it in GitHub Desktop.
this.printHand = function() {
var handCards = [];
function checkName(card) {
switch (card.getNumber()){
case 12:
return "Queen";
break;
case 13:
return "King";
break;
case 11:
return "Ace";
break;
default:
return card.getNumber();
break;
}
}
function printCard(card) {
switch (card.getSuit()){
case 1:
handCards.push(checkName(card) + " of Spades");
break;
case 2:
handCards.push(checkName(card) + " of Diamonds");
break;
case 3:
handCards.push(checkName(card) + " of Clubs");
break;
case 4:
handCards.push(checkName(card) + " of Hearts");
break;
}
}
return handCards.join('\n');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment