The Cards
companion object provides function that operate on cards and hands.
Attributes
Members list
Value members
Concrete methods
Classify the Poker Hand from highest to lowest:
Classify the Poker Hand from highest to lowest:
Value parameters
- hand
-
the card hand
Attributes
Turn the hand into a map of face-value -> frequency in hand, e.g., 3 Kings.
Turn the hand into a map of face-value -> frequency in hand, e.g., 3 Kings.
Value parameters
- hand
-
the card hand
Attributes
Determine whether the hand is a flush (all cards have the same suit).
Determine whether the hand is a flush (all cards have the same suit).
Value parameters
- hand
-
the card hand
Attributes
Determine whether the hand is a straight (consecutive cards). An Ace (1) can be on either end, e.g., (A, 2, 3, 4, 5) or (10, J, Q, K, A).
Determine whether the hand is a straight (consecutive cards). An Ace (1) can be on either end, e.g., (A, 2, 3, 4, 5) or (10, J, Q, K, A).
Value parameters
- hand
-
the card hand
Attributes
Convert the integer card number c (0 to 51) to the face value: 1(A), 2, 3, ..., 10, 11(J), 12(Q), 13(K) and suit: 0(C), 1(D), 2(H), 3(S).
Convert the integer card number c (0 to 51) to the face value: 1(A), 2, 3, ..., 10, 11(J), 12(Q), 13(K) and suit: 0(C), 1(D), 2(H), 3(S).
Value parameters
- c
-
the card number