Analyse Hand Value

To start a poker program, a function is required that converts any number of cards (in texas hold-em 5 to 7 cards) into a hand value with a defined order.
This usually is represented by an integer where a higher value means a better hand (in showdown a simple compare is done, the highest value wins).

The attached hand ranking function might not be the fastest way to do so (the poker app does not have to check millions of hands per second as online poker bots do), but it does its job and is easy to understand for debugging and teaching purposes.
In case you think your code is better, feel free to email us or post it in the comments, open for discussion.

Hand Ranking

Leave a Reply