https://github.com/mdp/hoyle
A javascript poker hand evaluator
https://github.com/mdp/hoyle
Last synced: about 1 year ago
JSON representation
A javascript poker hand evaluator
- Host: GitHub
- URL: https://github.com/mdp/hoyle
- Owner: mdp
- Created: 2012-09-15T23:03:34.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:44:26.000Z (over 3 years ago)
- Last Synced: 2025-03-18T06:51:26.068Z (over 1 year ago)
- Language: CoffeeScript
- Size: 92.8 KB
- Stars: 27
- Watchers: 3
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](http://travis-ci.org/mdp/hoyle)

# Hoyle
## A Javascript poker hand evaluator (Written in Coffeescript)
### Example
Hand = require('hoyle').Hand
describe "Finding winning hands", ->
it "should detect the winning hand from a list", ->
gary = Hand.make(["2s","3s","4h","5c","As","Ts","8d"])
mike = Hand.make(["5s","Ts","3h","Ac","2s","Ts","8d"])
steve = Hand.make(["5s","5h","3s","3c","2s","Ts","3d"])
winners = Hand.pickWinners([gary, mike, steve])
winners.length.should.equal 1
winners[0].should.equal steve
winners[0].name.should.equal "Full house"
### Install
npm install hoyle
### Install and use locally
git clone git://github.com/mdp/hoyle.git
cd hoyle
npm install
npm run-script prepublish
npm link
### Testing
npm install
npm test
### Notes
- Handles making the best poker hand out of 5-7 cards
- Written for code clarity, not speed (But still plenty fast for many
uses) See
["The Great Poker Hand Evaluator
Roundup"](http://web.archive.org/web/20140625212722/http://codingthewheel.com/archives/poker-hand-evaluator-roundup/)
for a deeper dive into speedy poker hand evaluators.