Hand Evaluation, Kickers, and Ties
Learning objectiveCompare five-card hands and understand best-five-of-seven selection.
Understand the idea
From strongest to weakest: straight flush, four of a kind, full house, flush, straight, three of a kind, two pair, one pair, high card. Texas Hold'em evaluates the best five cards from two private cards and five community cards; a bot may use zero, one, or two hole cards. A seven-card evaluator can enumerate 21 five-card combinations and keep the strongest rank tuple.
Within a category, compare the made rank first, then kickers in descending order. If both players' best five cards tie, the pot is split according to the engine's rules. A board-only straight can therefore tie even if one player holds a high unrelated card.
At the poker table
On A♠ A♦ K♣ 7♥ 2♠, A♥ Q♥ beats A♣ J♣ because both have three aces but the remaining kickers differ. Check the exact best five; a paired board changes comparisons.
Code and decision sketch
Pseudocodebest = max(rank_five(combo) for combo in combinations(hole + board, 5))
# rank_five returns (category, primary ranks, kickers).
# Compare tuples; enumerate exactly 21 combinations for seven cards.Common mistake
Do not rank a seven-card hand by its first five cards or forget that the board alone can form the best hand.
Try it yourself
Write down the best five cards for two players on a board with a shared straight. Decide whether a hole card changes either hand.
