Skip to content
/ pokr Public

JS library to simulate Poker (Texas Holdem)

Notifications You must be signed in to change notification settings

alexbrbr/pokr

Repository files navigation

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

About

JS library to simulate Poker (Texas Holdem)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published