Rank - lcrocker/ojpoker GitHub Wiki

Rank

The rank class is a simple enumeration class representing the rank of a playing card. I require (and enforce) specific numeric values for the ranks so that we can share data easily between languages. To accommodate most European and American types of playing cards, I assign the following numeric values:

Value Rank
1 Ace (low)
2 Deuce
3 Trey
4 Four
5 Five
6 Six
7 Seven
8 Eight
9 Nine
10 Ten
11 Jack / Under
12 Knight / Cavalier
13 Queen / Ober
14 King
15 Ace (high)

Aces are high by default; hands being read from text files, for example, will put aces into the 15 rank. But many games play aces low, so I reserve the 1 rank for those games and put aces there to make comparisons faster. The library makes this nearly automatic for most games.

Jokers do not have a rank. See Card for their representation.

Source files

Dart  ยท  Rust

Questions, commentary?