Last active
December 18, 2016 01:18
-
-
Save aeshthetic/8ee097a8145a8484a49aa6d1b8f5ef53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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