suits['♣️', '♦️', '❤️', '♠️']
We will be using numbers to represent playing card clubs and ranks. These are the suits:
For instance the suit at index 0:
These are the ranks:
For instance the rank at index 1 (note that there isn’t a playing card at position 0, since we want the ranks to match the indicies where possible):
A playing card
Here’s an example of creating and displaying a card:
Equality, less than, and greater than work on the rank and suit indices.
Return self>value.
Return self<value.
Return self==value.
For instance, here’s a test of equality…
…and a test of <…
…and finally of >: