Use a bitbased approach.
Let x be an integer variable. For each of the 7 cards, set x = x  (1 << card_value)
Now we need to check if the bit representation of x has 5 consecutive '1' bits.
Check if the expression x & (x << 1) & (x << 2) & (x << 3) & (x << 4) is nonzero. If so, it has 5 consecutive 1's.
Last fiddled with by axn on 20120208 at 11:24
