コード例 #1
0
ファイル: Program.cs プロジェクト: gubenkoved/project-euler
        public int Straight(Hand h)
        {
            if (h.Consecutive())
            {
                return (int)h.Cards.OrderByDescending(c => (int)c.Value).First().Value;
            }

            return 0;
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: gubenkoved/project-euler
        public int StraightFlush(Hand h)
        {
            if (h.SameSuit()
                && h.Consecutive())
            {
                return (int)h.Cards.Select(c => c.Value).OrderByDescending(c => c).First();
            }

            return 0;
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: gubenkoved/project-euler
        public int RoyalFlush(Hand h)
        {
            bool ss = h.SameSuit();
            bool cs = h.Consecutive();

            if (ss)
            {
                if (cs)
                {
                    if (h.ThereIs(CardValue.Ace))
                    {
                        return 1;
                    }
                }
            }

            return 0;
        }