I have this algorithm which is used for a deck with 52 cards, let's say i=10
:
int suit = i / 13;
int cardValue = i % 13;
suit
isfrom 0 to 3
for Hearts, Diamonds, Spades, ClubscardValue
isfrom 0 to 12
for Ace, 2, 3, ... ,Jack, King, Queen
How do I deduce from known suit
and cardValue
to get back i
?