mrowdy / poker_hands

Simple evaluator for poker hands.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Poker Hands

Build Status

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

pub run test

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.

About

Simple evaluator for poker hands.

License:GNU General Public License v3.0


Languages

Language:Dart 100.0%