pokr

1.2.3 • Public • Published

pokr

Coverage Status npm version Build Status

description

This library simulates poker hands being played and gives the winner, for instance :

const pokr = require("pokr");
 
const deck = pokr.createDeck();
const hand = pokr.dealHand(deck);
const hand2 = pokr.dealHand(deck);
 
console.log(hand.hand); // [ 'Jd', 'Th' ]
console.log(hand2.hand); // [ 'Qd', '5h' ]
 
console.log(pokr.winningPlayer(hand.hand, hand2.hand, deck.splice(0, 5))); // { winner: 'player2', hand: { cards: [ '2c', '2s', '2h', '2d', 'Qd' ], hand: 'fourOfAKind' } }

Readme

Keywords

none

Package Sidebar

Install

npm i pokr

Weekly Downloads

5

Version

1.2.3

License

ISC

Unpacked Size

17.1 kB

Total Files

9

Last publish

Collaborators

  • alexbrbr