Joker calculator is a 7-card Texas Hold'em poker odds calculator and evaluator.
The evaluator is a Java port of PokerHandEvaluator by HenryRLee,
which contains a detailed explanation of the hand evaluation algorithm.
The calculator then evaluates all combinations of cards that are left in the deck, and calculates the probability of each player winning/splitting.
To use the joker calculator from the command line, simply run mvn clean package
to build the jar and then you can use the ./joker
command in the top level directory.
Cards are specified as card aliases (two character strings), where the first character is the rank
2, 3, 4, 5, 6, 7, 8, 9, T, J, Q, K, A
and the second character is the suit c, d, h, s
for clubs, diamonds, hearts and spades respectively.
Specify the players' cards as space seperated card aliases, e.g. Ah 4d
for A2c Ts
for 2
Optionally specify the board cards as space seperated card aliases, e.g. -b 2c Ts 4d 5h
for 2
Optionally specify the dead cards (the cards that are no longer in the deck) as space
seperated card aliases, e.g. -d Tc 2c
for 10
./joker -h
Usage: joker [-ehV] [-b=<card>]... [-d=<card>]... (<card> <card>)...
(<card> <card>)... Player cards (2 cards per player, 2 to 10 players).
-b, --board=<card> Board cards - flop, turn or river (3 to 5 cards).
-d, --dead=<card> Cards that are no longer in the deck (1 to 19 cards).
-e, --emoji Display emojis for suits instead of letters.
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
Also, you can use the -e
flag to display emojis for suits instead of letters.
./joker Jh 9s Ac 2d -e
Win Tie
J♥️9♠️: 43.82% 0.43%
A♣️2♦️: 55.75% 0.43%
Player 1 has A
player 2 has Q
player 3 has 7
and the board is 3
The scenario is represented as follows: Ah Kh Qc Qd 7c 7d -b 3d 5c Kc
./joker Ah Kh Qc Qd 7c 7d -b 3d 5c Kc
Win Tie
AhKh: 76.41% 0.00%
QcQd: 13.18% 0.00%
7c7d: 10.41% 0.00%
Player 1 has A
player 2 has 5
player 3 has 7
and the dead cards are K
The scenario is represented as follows: Ac 8s 5c 8h 7d Kd -d Kh 2c
./joker Ac 8s 5c 8h 7d Kd -d Kh 2c
Win Tie
Ac8s: 45.69% 2.22%
5c8h: 16.90% 2.22%
7dKd: 35.20% 0.29%
Javadoc available HERE
Some interesting resources I found while studying the poker hand evaluation algorithms:
PokerHandEvaluator/Algorithm.md - The hand evaluation algorithm used in this project with super detailed explanation
Enumerating Five-Card Poker Hands
Cactus Kev's Poker Hand Evaluator
The Great Poker Hand Evaluator Roundup
Some GUI-based evaluators I used to check the odds:
Poker Master Tool (Github)
Texas Hold'em Odds Calculator
Other poker evaluators:
PokerHandEvaluator
TwoPlusTwoHandEvaluator
SKPokerEval
OMPEval
Java 5-card evaluator
Collection of poker evaluators