Expand description
§Deck
Building on the previous card definition, let’s look at the value table for a standard 52-card deck
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | J | Q | K | A | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Clubs | 98306 | 164099 | 295429 | 557831 | 1082379 | 2131213 | 4228625 | 8423187 | 16812055 | 33589533 | 67144223 | 134253349 | 268471337 |
Diamonds | 81986 | 147779 | 279109 | 541511 | 1066059 | 2114893 | 4212305 | 8406867 | 16795735 | 33573213 | 67127903 | 134237029 | 268455017 |
Hearts | 73858 | 139651 | 270981 | 533383 | 1057931 | 2106765 | 4204177 | 8398739 | 16787607 | 33565085 | 67119775 | 134228901 | 268446889 |
Spades | 69826 | 135619 | 266949 | 529351 | 1053899 | 2102733 | 4200145 | 8394707 | 16783575 | 33561053 | 67115743 | 134224869 | 268442857 |
Functions§
- arrange
- Given the deck of cards and the new position of each cards, return the new deck with new arrangement.
- create
- Create the deck of 52 cards
- deal
- Deal cards from the deck to each hand in a certain number
- is_
flush - Check if the deck is a flush
- is_
straight - Returns true if the cards are a straight (include
wheel straight
). - unique5
- This function takes a deck of cards with up to five cards and generates a unique identifier that is independent of the card order