Re: Programming - Ranking Hands (C#)
The function
private void EvaluateHand(Hand h)
in PokerGames5Cards.cs appears to be the relevant one, it takes a hand object as an argument and sets the type property to one of the type enums.
Nothing too earth-shattering about the approach, just works down from Royal Flush to High Card stopping at the first match. It looks like the hand object can hold more than five cards, but the way of selecting the best 5-card hand from them is rubbish - it just tries every combination.
|