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


Run tests

dart test/five_hand_test.dart

Run benchmarks

dart benchmark/five_hand_benchmark.dart


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