Need help with poker-evaluator?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

chenosaurus
216 Stars 56 Forks 47 Commits 9 Opened issues

Description

poker hand evaluator

Services available

!
?

Need anything else?

Contributors list

# 383,584
JavaScr...
CSS
14 commits
# 64,106
HTML
Bitcoin
IPFS
Electro...
8 commits
# 73,839
repl
TypeScr...
HTML
Angular
4 commits
# 153,057
JavaScr...
HTML
Shell
1 commit
# 420,163
JavaScr...
1 commit
# 547,487
JavaScr...
HTML
1 commit
# 1,449
image-f...
assembl...
netfram...
residua...
1 commit

Poker Hand Evaluator

Poker hand evaluator using the Two Plus Two alogorithm and lookup table. The lookup table HandRanks.dat is included in the module.

It is capable of evaluating 7, 6, 5, and 3 card hands. The highest hand possible in a 3 card hand is 3 of a kind, straights & flushes do not apply to 3 cards.

Hands can be evaluated by comparing the handType then the handRank to determine the better hand.

This can evaluate about 22MM hands per second on a quad-core 2.7GHz Macbook Pro. Run the speedtest.js file under /test to try it.

to install:

npm install poker-evaluator

Usage:

var PokerEvaluator = require("poker-evaluator");

PokerEvaluator.evalHand(["As", "Ks", "Qs", "Js", "Ts", "3c", "5h"]);

//{ handType: 9, // handRank: 10, // value: 36874, // handName: 'straight flush' }

PokerEvaluator.evalHand(["As", "Ac", "Ad", "5d", "5s"]);

//{ handType: 7, // handRank: 148, // value: 28820, // handName: 'full house' }

PokerEvaluator.evalHand(["As", "Ac", "Qs"]);

//{ handType: 2, // handRank: 2761, // value: 10953, // handName: 'one pair' }

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.