ranks
[None, 'A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
We’ll be using numbers to represent ranks. Those are ranks:
For instance, ranks at index 1
For instance, suits at index 0
Here’s an example of creating and displaying a card:
Card (suit:int, rank:int)
A playing card
Type | Details | |
---|---|---|
suit | int | An index into suits |
rank | int | An index into ranks |
Equality, less than, and greater than work on the rank and suit indices:
There are some instances: