Last active
August 29, 2015 14:17
-
-
Save mixtmeta/4019cdb33c9be277346e to your computer and use it in GitHub Desktop.
Deck of Cards
This file contains hidden or 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
| var suits = { | |
| SPADES: 'spades' | |
| ,HEARTS: 'hearts' | |
| ,CLUBS: 'clubs' | |
| ,DIAMONDS: 'diamonds' | |
| }; | |
| var ranks = { | |
| ACE: 1 | |
| ,TWO: 2 | |
| ,THREE: 3 | |
| ,FOUR: 4 | |
| ,FIVE: 5 | |
| ,SIX: 6 | |
| ,SEVEN: 7 | |
| ,EIGHT: 8 | |
| ,NINE: 9 | |
| ,TEN: 10 | |
| ,JACK: 10 | |
| ,QUEEN: 10 | |
| ,KING: 10 | |
| }; | |
| var deck = {}; | |
| Object.keys(suits).forEach(function(suit) { | |
| deck[suit] = ranks; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment