poker-sim
Node library that simulates a poker game and calculates winning percentages
npm install poker-sim
Dependencies
poker-evaluator
moment (not really needed, could be removed in future)
USAGE:
var pokerSim = ; var game = ; //add "Hands" or playersgame; //Deal two cards (getting fancy with this and trying to add more or less than 2 will probably get you in trouble)game; //call evalHands() to process win percentages using the current state of the gamegame //output the status of the game to the consolegame; //flop (3 cards)game; //eval and printgame; //turngame; //eval and printgame; //rivergame; //eval and printgame; //at any time you can return the JSON of the game statusconsole;
Extras:
poker-sim.getGame (useful to send to the client) poker-sim.getSave (useful to save the game state, returns the options you need to feed into constructor to resume)
Notes:
Fairly untested, use at own risk or modify and make it better!