pub enum PokerHand {
HighCard = 0,
Pair = 1,
TwoPair = 2,
ThreeOfAKind = 3,
Straight = 4,
Flush = 5,
FullHouse = 6,
FourOfAKind = 7,
StraightFlush = 8,
FiveOfAKind = 9,
FlushHouse = 10,
FlushFive = 11,
}
Expand description
Poker Hands are sets of between one and five cards that can be played in Ortalab to obtain Chips and Mult for scoring.
This includes all of the standard poker hands, along with three “illegal” poker hands. These hands are possible in Ortalab because players can have duplicate cards, enabling hands that aren’t typically possible in poker.
Higher tier hands take precedence over lower tier hands regardless of their level or scoring. e.g., if your hand is K♦ K♦ K♦ K♦ 2♦, the hand will always be a Four of a Kind and never a Flush.
PokerHand
is declared in ascending tier order. You can read the tier numerically as follows:
assert_eq!(PokerHand::HighCard as u8, 0);
assert_eq!(PokerHand::Pair as u8, 1);
// ...
assert_eq!(PokerHand::Flush as u8, 5);
// ...
assert_eq!(PokerHand::FlushHouse as u8, 10);
assert_eq!(PokerHand::FlushFive as u8, 11);
Poker hands also include a base score,
which provides initial values for the round’s Chips and Mult.
These base scores can be accessed with PokerHand::hand_value
as follows:
let (chips, mult) = PokerHand::Flush.hand_value();
assert_eq!(chips, 35.0);
assert_eq!(mult, 4.0);
Only the card relevant to the hand are scored. All others are unscored.
Example 1: You play an ace high with 4 other cards. Only the High card base amount and the aces values are used for this hands score. The other cards are ignored.
Example 2: You play a pair of 3s and A K Q. Only the pair cards are scored. The other cards ignored.
Variants§
HighCard = 0
When no other hand is possible, the one highest card in your hand. Aces are considered the highest card.
e.g. Q♦ 9♥ A♠ 3♥ 4♠ (Q♦ 9♥ 3♥ 4♠ not counted)
Pair = 1
Two cards with a matching rank. Suits may differ.
e.g. K♠ 9♠ 9♦ 6♥ 3♥ (K♠ 6♥ 3♥ not counted)
TwoPair = 2
Two cards with a matching rank, and two cards with any other matching rank. Suits may differ.
e.g. Q♣ Q♦ A♠ 4♦ 4♠ (A♠ not counted)
ThreeOfAKind = 3
Three cards with a matching rank. Suits may differ.
e.g. 9♣ 9♦ 9♠ A♠ 3♦ (A♠ 3♦ not counted)
Straight = 4
Five cards in consecutive order which are not all from the same suit. Aces can be counted high or low, but not both at once.
e.g. A♠ 2♦ 3♣ 4♠ 5♥ and 10♦ J♠ Q♦ K♣ A♠ are straights, but Q♦ K♣ A♠ 2♣ 3♠ is not.
Flush = 5
Five cards of any rank, all from a single suit.
e.g. A♥ K♥ 9♥ 5♥ 4♥
FullHouse = 6
Three cards with a matching rank, and two cards with any other matching rank, with cards from two or more suits.
e.g. K♥ K♦ K♣ 2♥ 2♣
FourOfAKind = 7
Four cards with a matching rank. Suits may differ.
e.g. J♠ J♣ J♥ J♦ 3♣ (3♣ not counted)
StraightFlush = 8
Five cards in consecutive order, all from a single suit.
e.g. Q♠ J♠ 10♠ 9♠ 8♠
FiveOfAKind = 9
An “illegal” hand.
Five cards with the same rank which are not all the same suit.
e.g. A♠ A♥ A♥ A♣ A♠
FlushHouse = 10
An “illegal” hand.
Three cards with the same rank, and two cards with the same rank, all from a single suit.
e.g. 7♦ 7♦ 7♦ 4♦ 4♦
FlushFive = 11
An “illegal” hand.
Five cards with the same rank and same suit.
e.g. A♠ A♠ A♠ A♠ A♠