poker hand evaluator
JavaScript
Latest commit e2c4abf May 8, 2015 @chenosaurus Merge pull request #14 from zj8487/master
Evaluator 6 cards
Permalink
Failed to load latest commit information.
data update 3 card evaluator to match 5 card hands Sep 15, 2013
lib Evaluator 6 cards Jun 3, 2014
test add tests, fix typos Feb 28, 2013
.gitignore bump version Sep 15, 2013
.travis.yml add travis Feb 28, 2013
package.json bump version and fix readme Feb 13, 2015
readme.md bump version and fix readme Feb 13, 2015

readme.md

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' }