There is actually a glaring problem in the code. It has to do with how you are checking for a three of a kind.
For example if we just take one of the if statements and break it down.
if (card1 >= ACE_CARD && card2 && card3 <= ACE_CARD)
What this statement is saying is this
1.)
card1 >= 1
~ If card1 is greater then or equal to 1 return true and continue to 2.)
2.)
card2
~ Basically this is always true no matter what number it is and continues to 3.)
3.)
card3 <= 1
~ If card3 is less then or equal to 1 the if statement finally returns true since all conditions are met.
Now what happens if we entered a input something like this
9 1 1
? It will print that I have three aces when I really don't.
http://ideone.com/TrSHhh
Now how do we go about fixing this problem? There is multiple different ways to solve this problem, but the simplest one would be to just check each card with
==
. For example your three aces if statement would look like this.
if (card1 == ACE_CARD && card2 == ACE_CARD && card3 == ACE_CARD)
As I said there is different solutions for this but that is the simplest though not really the best. As for you other problem could you elaborate what you mean by "it goes wierd"? Be as detailed as you can about the results you are getting.