poker-odds
A lightweight command line tool for calculating poker hand probabilities. No dependencies. No huge data files.
Installation
yarn global add poker-odds
npm install -g poker-odds
Usage
poker-odds AcKh KdQs
-b, --board Td7s8d
-i, --iterations 1000
-e, --exhaustive
-p, --possibilities
-n, --no-color
-v, --version
-h, --help
Use --board
or -b
to define community cards.
Use --exhaustive
or -e
to run all preflop simulations. Note that this will take some time.
Use --possibilities
or -p
to show all possible hand outcomes. Hand possibilities are shown by default if only one hand is defined.
API
The method used to calculate probabilities can be imported and used directly in a JS/node project:
import { calculateEquity } from 'poker-odds'
const hands = [['As', 'Kh'], ['Kd', 'Qs']]
const board = ['Td', '7s', '8d']
const iterations = 100000
const exhaustive = false
calculateEquity(hands, board, iterations, exhaustive)
calculateEquity()
returns an array of hands with the results of the simulations:
[
{
"hand": [
"Ac",
"Kh"
],
"count": 990,
"wins": 803,
"ties": 15,
"handChances": [
{ "name": "high card", "count": 376 },
{ "name": "one pair", "count": 479 },
{ "name": "two pair", "count": 78 },
{ "name": "three of a kind", "count": 13 },
{ "name": "straight", "count": 44 },
{ "name": "flush", "count": 0 },
{ "name": "full house", "count": 0 },
{ "name": "four of a kind", "count": 0 },
{ "name": "straight flush", "count": 0 },
{ "name": "royal flush", "count": 0 }
],
"favourite": true
},
{
"hand": [
"Kd",
"Qs"
],
"count": 990,
"wins": 172,
"ties": 15,
"handChances": [
{ "name": "high card", "count": 351 },
{ "name": "one pair", "count": 463 },
{ "name": "two pair", "count": 77 },
{ "name": "three of a kind", "count": 13 },
{ "name": "straight", "count": 41 },
{ "name": "flush", "count": 45 },
{ "name": "full house", "count": 0 },
{ "name": "four of a kind", "count": 0 },
{ "name": "straight flush", "count": 0 },
{ "name": "royal flush", "count": 0 }
],
"favourite": false
}
]