poker_hands 1.0.0 copy "poker_hands: ^1.0.0" to clipboard
poker_hands: ^1.0.0 copied to clipboard

Dart 1 only

Simple evaluator for poker hands.

Poker Hands #

Simple evaluator for poker hands. Not the fastest, not the shortest but working. Give a set of 5 cards to poker_hands and get the highest ranking poker hand.

This package is not for hand comparison and does not resolve identical hands.

Code Example #

FiveHand fiveHand = new FiveHand([
    new Card(Face.ACE, Suite.SPADE),
    new Card(Face.KING, Suite.SPADE),
    new Card(Face.JACK, Suite.SPADE),
    new Card(Face.TEN, Suite.SPADE),
    new Card(Face.QUEEN, Suite.SPADE)
]);

Hand hand = fiveHand.evaluate();

print(hand); //Hand.ROYAL_FLUSH

Tests #

Run tests #

dart test/five_hand_test.dart

Run benchmarks #

dart benchmark/five_hand_benchmark.dart

Contribution #

Feel free to add new evaluators, improve performance of existing ones, or fix bugs. Every contribution is welcome.

0
likes
15
points
7
downloads

Publisher

unverified uploader

Weekly Downloads

Simple evaluator for poker hands.

Repository (GitHub)
View/report issues

License

GPL-3.0 (license)

More

Packages that depend on poker_hands