true-shuffle-solver
v0.1.1
Published
trueShuffle poker hand solver extending Pokersolver
Maintainers
Readme
true-shuffle-solver
A modernized TypeScript wrapper around the battle-tested pokersolver engine, published under the true-shuffle-solver package. Provides deterministic poker hand evaluation and Pai Gow helper logic for trueShuffle applications.
Installation
npm install true-shuffle-solverUsage
import { Hand, Game, Hand as TrueShuffleHand } from "true-shuffle-solver";
const standard = new Game("standard");
const hand = Hand.solve(["Kh", "Tc", "5d", "As", "3c", "3s", "2h"], standard);
console.log(hand.name); // "Pair"
console.log(hand.descr); // "Pair, 3's"
console.log(hand.toString()); // "As, Kh, 10c, 5d, 3c"Pai Gow Poker helpers
import { PaiGowPokerHelper } from "true-shuffle-solver";
const helper = PaiGowPokerHelper.solve([
"Kh",
"Or",
"Qs",
"Td",
"5s",
"7c",
"2h",
]);
console.log(helper.hiHand.descr); // "A High"
console.log(helper.loHand.descr); // "K High"API
All original pokersolver classes are exported:
Card,Hand,Game- Hand rank classes:
RoyalFlush,StraightFlush,FourOfAKind,FullHouse,Flush,Straight,ThreeOfAKind,TwoPair,OnePair,HighCard - Extended classes for video poker and Pai Gow variants
PaiGowPokerHelper
The module also exports a TrueShuffleSolver default containing the same properties for compatibility.
Refer to the upstream documentation for in-depth API reference.
Development
npm install
npm run build
npm testLicense
Released under the MIT License. Portions of the solver originate from pokersolver by James Simpson / GoldFire Studios.
