core.plugins.holdem.sh_cards
Deck generation and 7-card Texas Hold'em hand evaluation. Evaluates the best 5-card hand from up to 7 cards (hole + community).
- Sharedholdem.generateDeck() → string[]Source ☍
-
Build a fresh 52-card deck and Fisher-Yates shuffle it.
Returns
- string[]
- Sharedholdem.getBestHand(cardIds) → table|nilSource ☍
-
Find the best 5-card hand among all combinations of the given cards.
Parameters
- cardIdsstring[]2 to 7 card ids
Returns
- table|nil
- Sharedholdem.getHandText(hand) → stringSource ☍
-
Human-readable hand description.
Parameters
- handtable
Returns
- string
- Sharedholdem.handBeats(a, b) → booleanSource ☍
-
Compare two hand results. Returns true if a beats b.
Parameters
- atable
- btable
Returns
- boolean
- Sharedholdem.handsEqual(a, b) → booleanSource ☍
-
Returns true if hands are equal in rank.
Parameters
- atable
- btable
Returns
- boolean
- Sharedholdem.parseCard(id) → number|nil, string|nilSource ☍
-
Parse "HA" / "C10" style card ids into rank value + suit.
Parameters
- idstring
Returns
- 1number|nil
- 2string|nil
- Sharedholdem.pickWinners(entries) → table[]Source ☍
-
Pick winners from a list of {ply=, hand=} entries.
Parameters
- entriestable[]
Returns
- table[]