4 ms·
This seems like a really cool project! But how are you shuffling the cards, and how are you identifying unique shuffled decks? It looks like the deck_id is 12
by gabemart 11y ago
This seems like a really cool project!
But how are you shuffling the cards, and how are you identifying unique shuffled decks?
It looks like the deck_id is 12 characters, numbers or lower-case letters. That gives a range of 36^12 or around 4.7 * 10^18. The total range of a physical deck of shuffled cards is 52! or around 8 * 10^67.
It's possible I have misunderstood what deck_id is for.
- kornish 11y agoLooks like deck_id references a persisted model: https://github.com/crobertsbmw/deckofcards/blob/master/deck/models.py#L23 https://github.com/crobertsbmw/deckofcards/blob/master/deck/... The model stores the state of the deck, including things like order and remaining cards and how many "decks" of 52 cards are in play.