Hacker News new | past | comments | ask | show | jobs | submit login

Funny example in regards of a card-deck. How would you have unique keys for the 3 jokers in the deck ?



A joker does not have a suit, nor a number, so it would not fit in the example table anyway.


Arguably Joker is the number, and like Ace is 1 you might use 0 or 14 depending on math preferences as a surrogate number (or stick to the character designations like A, K, Q, J).

Decks with four jokers typically have suited jokers. Decks with two are typically (though not always) red/black and could be given arbitrary suits (say hearts/spades).


Represent the suit as J and number them sequentially? Also not all games use jokers.


Decks with four jokers are often suited (just as the most common decks with two jokers are red/black), so a deck with three jokers you could treat as suited jokers that are missing a suit.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: