Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool IsThreeOfAKind(IHand hand)
- {
- if (!IsValidHand(hand))
- {
- return false;
- }
- bool result = hand.Cards
- .GroupBy(x => x.Face)
- .Any(x => x.Count() == ValidIsThreeOfAKindGroupCount);
- return result;
- }
- public bool IsTwoPair(IHand hand)
- {
- if (!IsValidHand(hand))
- {
- return false;
- }
- int differentCardsFacesCount = hand.Cards.GroupBy(x => x.Face).Count();
- bool result = differentCardsFacesCount == ValidIsTwoPairGroupCount;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement