Mixing several techniques in Swift to evaluate a Holdem poker hand.
-
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
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.
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.