Evaluating Card for a hand of Video Poker
<p>I sorted the cards by rank to make things easier. I sort of need to be guilded in the right direction on how I can set up these checks. </p>

<p>For example, to check for a straight, I know I just need to iterate through the sorted cards and see if each rank is one more than the previous card. Below is what I have for a straight.</p>

<p>For two pair, I'm not sure how to check for two successive cards that have the same rank, twice.</p>

<p>A full house is basically the same as a two pair, but the second (or first) pair is actually a triplet.</p>

<p>Four of a kind can be done the same way as three of a kind I'm pretty sure.</p>

<p>Straight flush is just a combination of straight and flush. A royal flush is a straight flush that begins with a 10 when sorted.</p>

<p>Here is my code. Any help would be appreciated and please supply examples (I also have a SortBySuit function if that helps).</p>

<pre><code>NewGame.SortByValue();
for( int i = 0; i &lt; 5; i++ )
    tempHand[ i ] = NewGame.SetArray( i );

if( tempHand[ 0 ].GetValue() == tempHand[ 1 ].GetValue() + 1 &amp;&amp; tempHand[ 0 ].GetValue() == tempHand[ 2 ].GetValue() + 2 &amp;&amp; 
    tempHand[ 0 ].GetValue() == tempHand[ 3 ].GetValue() + 3 &amp;&amp; tempHand[ 0 ].GetValue() == tempHand[ 4 ].GetValue() + 4 )
    winType = 4;
    //straight

//for( int i = 0; i &lt; 5; i++ )
//  for( tempHand[ i ].GetValue() == tempHand[ i + 1 ].GetValue() ||

for( int i = 0; i &lt; 5; i++ )
{
    if( tempHand[ i ].GetValue() &gt;= 11 || tempHand[ i ].GetValue() == 1 )
    {
        if( tempHand[ 0 ].GetValue() == tempHand[ 1 ].GetValue() || tempHand[ 1 ].GetValue() == tempHand[ 2 ].GetValue() || 
            tempHand[ 2 ].GetValue() == tempHand[ 3 ].GetValue() || tempHand[ 3 ].GetValue() == tempHand[ 4 ].GetValue() )
            winType = 1;
    }
}//jack or better
</code></pre>
