suits['♣️', '♦️', '❤️', '♠️']
The suits are displayed with a nice emoji
For instance the suit at index 0:
The ranks are mostly what one would expect. Note the None at index 0 this is because we want the rank of a valid card to match it’s index.
Card (suit:int, rank:int)
A playing card
| Type | Details | |
|---|---|---|
| suit | int | An index into suits |
| rank | int | An index into ranks |
Here’s an example of creating and displaying a card:
Equality, less than, and greater than work on the rank and suit indices.
For instance, here is a test for equality
and a test for <
and finally for >