core

Fill in a module description here

We will be using numbers to represent playing card clubs and ranks. These are the suits

suits
['♣', '♦', '♥', '♠']
suits[0]
'♣'
ranks
[None, 'A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
c = Card(suit=1, rank=3)
c
3♦

Comparison operators

equality, less than, and greater than work on the rank and suit indices:


source

Card

 Card (suit:int, rank:int)

A playing card

test_eq(Card(suit=1, rank=3), Card(suit=1, rank=3))
test_ne(Card(suit=2, rank=3), Card(suit=1, rank=3))
test_ne(Card(suit=1, rank=2), Card(suit=1, rank=3))
assert Card(suit=1, rank=3)<Card(suit=2, rank=3)

source

foo

 foo ()