2 of clubs, 3 of clubs, 4 of clubs, 5 of clubs, 6 of clubs, Jack of Clubs.
public static bool HasStraightFlush( List<Card> sortedCards, out List<Card> straightFlushCards )
{
straightFlushCards = new List<Card>();
if ( sortedCards.Count < 5 )
return false;
List<Card> flushCards;
if ( !HasFlush( sortedCards, out flushCards ) )
return false;
if ( HasStraight( flushCards, out straightFlushCards ) )
return true;
return false;
}
public static bool HasStraightFlush(List<Card> sortedCards, out List<Card> straightFlushCards)
{
straightFlushCards = new List<Card>();
if (sortedCards.Count < 5)
return false;
List<Card> flushCards;
if (!HasFlush(sortedCards, out flushCards))
return false;
var suit = flushCards[0].Suit;
flushCards = sortedCards.Where(x => x.Suit == suit).ToList();
flushCards.Sort();
if (HasStraight(flushCards, out straightFlushCards))
return true;
return false;
}
using System.Linq;
We use essential cookies to make this site work, and optional cookies to enhance your experience.