First, you can, for example, copy the 5 values of the hand in an array of 5x2 values and sort them from the higher to the lower cards value.
Now, check them in this order :
Check in the array if the 5 cards have the same color value first.
- In this case, check the cards value : 14,13,12,11,10 is a Royal Flush.
- ELSE 13,12,11,10,9 or 12,11,10,9,8 or 11,10,9,8,7 are Straight Flush.
- ELSE the other case is a Flush.
ELSE If the 5 cards does not have the same color value, check the number of sames cards value in the array.
If 4 are the sames, it's Four of a Kind.
ELSE if 3 are the sames, check if the two others are the sames together, if yes, it's a FullHouse, ELSE it's Three of a Kind.
ELSE if 2 are the sames, check if the three others are the sames together, if yes, it's a FullHouse, ELSE if there is another pair, it's TWO PAIR, ELSE it's one pair.
ELSE check for a Straight.
ELSE if no cards are the same, check for the Higher Card.
If you have multiple players in your game, don't forget, in some cases, to compare others cards next.
If two players have one pair of 7, check the Higher next card to see who win.
I don't know what's happens if two players have the exact same hand... lol