Oceas Anderson wrote:However I'm not entirely sure on how to make sure I get to distinct pairs and not a three of a kind.
You don't have to separate four of a kind, three of a kind, pairs, and straight into different loops. In fact, they can all be determined with one loop (and without any nested loops).
Here's what I did:
As I loop through the cards, when I encounter a new number, I assign it to a currentValue variable. I have a counter variable that counts the number of cards matching currentValue. Once I arrive at a number that is not equal to the current value, I check my counter to see how many times the number appeared. If it is 2, I increment a numberOfPairs variable, if it is three, I set threeOfAKind variable to true, and if it is four, I set fourOfAKind to true. Then I reset currentValue to the new number and reset my counter to 1. Remember: this is all assuming that equivalent values are adjacent (as they should be after you've sorted your array). You can also handle straights in the same loop by comparing Hand[i] to Hand[i-1]. The straights are easier, but you'll also have to account for the fact that straights can loop (i.e. 1, 2, 3, 13, 14).
Once you're out of your loop, you can analyze your variables to determine your result.
Also, your array should only be of length 5. You won't be able to find straights properly with that empty index at the beginning of your array.