New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

hoyle

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hoyle

Javascript Poker Hand Evaluator

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

Build
Status

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" for a deeper dive into speedy poker hand evaluators.

Keywords

poker

FAQs

Package last updated on 29 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts