Mixing several techniques in Swift to evaluate a Holdem poker hand.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Resources binary Jun 9, 2018
SwiftyPokerHands.xcodeproj binary Jun 9, 2018
SwiftyPokerHands version Jun 9, 2018
SwiftyPokerHandsTests Swift 3 Jun 22, 2016
.DS_Store binary Jun 9, 2018
.gitignore Swift 3 (Xcode beta 6) Aug 18, 2016
README.md swift 4.2 Jun 9, 2018

README.md

Holdem Poker Hand Simulator

Mixing several techniques in Swift to evaluate a Holdem poker hand.

Swifty Poker Hands

Techniques

  • Compute a rank for each card

  • Compute a rank for each possible 5 cards hand

  • Permutations of all possible hands of 5 cards among the 7 cards in play

  • Sort, filter, deduplicate the results

  • Compare ranks by byte matching

  • Reorder and extract results

Demo app

A table view of a two-player hands simulator. Two players, with random or custom cards, go all-in each round.

There's a binary in the Resources folder.

Credits

Original cards images are from Playing Cards iOS Assets.

The 2-cards and 5-cards hand ranking algorithms are adapted from swift-poker-hand-evaluator.

Some collection operations are adapted from ExSwift.