suits['♣️', '♠️', '❤️', '♦️']
We will be using numbers to represent playing card suits and ranks. The suits are:
For instance the suit at index 0 is:
The ranks are:
For instance the rank at index 1 (note that there is not aplyaing card at position 0, since we want the ranks to match the indices where possible):
Card (suit:int, rank:int)
A playing card
| Type | Details | |
|---|---|---|
| suit | int | An index into suits |
| rank | int | An index into ranks |
Here is an example creating an displaying card:
Equality between two card is given by same suit and rank
Card.__eq__ (other:__main__.Card)
Return self==value.
Card.__lt__ (other:__main__.Card)
Return self<value.
Card.__gt__ (other:__main__.Card)
Return self>value.