string[] values = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A" };
string[] suits = { "♠", "♦", "♣", "♥" };
string[] draw = { "A ♠", "A ♦", "K ♦", "K ♥", "A ♥" };
Boolean threeOf = false;
Boolean twoOf = false;
Boolean fullHouse = false;
// full house, 3 cards of one value, 2 cards of another value
foreach (string value in values)
{
int cardCount = draw.Count(card => card.StartsWith(value));//NOT WORKING
if (cardCount == 3)
{ threeOf = true; }
if (cardCount == 2)
{ twoOf = true; }
}
if (threeOf && twoOf)
{ fullHouse = true; }
This post has been edited by ni44ko: 14 December 2010 - 09:37 PM

New Topic/Question
Reply




MultiQuote




|