Help with poker function

Hey guys, I have spent days scanning through forums and other sites. I can't seem to find the the answer to my issue.

It is for that Deitel textbook poker program exercise.

My issue is that I apparently do not understand how to find two pair. I have two separate functions but no matter how I modify the twoPair part it either errors out or just does both the pair and two pair function regardless if there is only one pair or two.

I am at a loss here. A point in the right direction would be great since I seem to be in a loop.

I put the twoPair function back as a copy of the pair function since that is how I started.

I think I have to set up something like an if else in the main body or combine the two functions into one, maybe add a pair counter in the function and ==1 is one pair and ==2 is two.

I have spent like 10 hours solid on this and think I am just missing something simple because I have worked on it so long. thanks in advance.

If I was doing this, I would actually just generate a list of all possible options the hand could be (pair, two pair, flush, etc) then just pick the best one at the end.

I can't really help you with your function if you don't show me any code though.
Topic archived. No new replies allowed.