I want to ask a function to check Full House combination in Poker.
So far i have this code :
for (a=0 ; a<2 ; a++)
{
for (b=a+1 ; b<7 ; b++)
{
if (pValue[a] == pValue[b])
{
pair++;
for (c=b+1 ; c<7 ; c++)
{
if (pValue[b] == pValue[c])
{
thrice++;
}
}
}
}
}
So i checking :
if (pair >= 1 && thrice >= 2 || pair >=2 && thrice >= 1)
{
nameComb = "Full House";
}
But if i have 3 cards with same value, the result is pair = 2
and thrice = 1
So when the Full House condition will met.
How can i check if pair is the same value with thrice ?