exactHuEquityVsRandomHand
Exact HU equity vs uniform random villain hand; board is empty (preflop) or 3–5 cards.
exactHuEquityVsRandomHand(heroHoleCards: CardInput, boardCards: CardInput): number
CardInput is string[] or Uint8Array of deck ids 0..51. See Card notation.
Import
const poker = require('poker-calculations');
ESM (Node):
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const poker = require('poker-calculations');
When to use
Use for preflop (empty boardCards) and for flop, turn, or river (3–5 board cards) when you need exact equity vs a random unknown hand—study spots, preflop tools, or feeding chubukovMaxSymmetricJamStackBinarySearch. Prefer simulateHandOutcome when the board has 1–2 cards (incomplete board) or you need multi-villain Monte Carlo sampling.
How to use
const poker = require('poker-calculations');
const preflop = poker.exactHuEquityVsRandomHand(['Ah', 'Kd'], []);
console.log(preflop);
const turn = poker.exactHuEquityVsRandomHand(
['Ah', 'Kd'],
['Qh', 'Jc', '2s', '9d'],
);
console.log(turn);
Throws if cards overlap, or board length is 1–2 or greater than 5. Valid board lengths: 0 (preflop) or 3–5.
See also
simulateHandOutcome · chubukovMaxSymmetricJamStackFromHandBinarySearch