当前位置: 首页>>代码示例>>C#>>正文


C# PokerHandsChecker.IsHighCard方法代码示例

本文整理汇总了C#中Poker.PokerHandsChecker.IsHighCard方法的典型用法代码示例。如果您正苦于以下问题:C# PokerHandsChecker.IsHighCard方法的具体用法?C# PokerHandsChecker.IsHighCard怎么用?C# PokerHandsChecker.IsHighCard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Poker.PokerHandsChecker的用法示例。


在下文中一共展示了PokerHandsChecker.IsHighCard方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main()
        {
            ICard card = new Card(CardFace.Ace, CardSuit.Clubs);
            Console.WriteLine(card);

            IHand hand = new Hand(new List<ICard>() { 
                new Card(CardFace.Ace, CardSuit.Clubs),
                new Card(CardFace.Ace, CardSuit.Diamonds),
                new Card(CardFace.King, CardSuit.Hearts),
                new Card(CardFace.King, CardSuit.Spades),
                new Card(CardFace.Seven, CardSuit.Diamonds),
            });
            Console.WriteLine(hand);

            IPokerHandsChecker checker = new PokerHandsChecker();
            Console.WriteLine(checker.IsValidHand(hand));
            Console.WriteLine(checker.IsStraight(hand));
            Console.WriteLine(checker.IsOnePair(hand));
            Console.WriteLine(checker.IsTwoPair(hand));
            Console.WriteLine(checker.IsStraightFlush(hand));
            Console.WriteLine(checker.IsFlush(hand));
            Console.WriteLine(checker.IsFourOfAKind(hand));
            Console.WriteLine(checker.IsThreeOfAKind(hand));
            Console.WriteLine(checker.IsHighCard(hand));
            Console.WriteLine(checker.IsFullHouse(hand));
        }
开发者ID:vladislav-karamfilov,项目名称:TelerikAcademy,代码行数:26,代码来源:PokerExample.cs

示例2: HighCardTrueTest

        public void HighCardTrueTest()
        {
            var card1 = new Card(CardFace.King, CardSuit.Hearts);
            var card2 = new Card(CardFace.Five, CardSuit.Spades);
            var card3 = new Card(CardFace.Seven, CardSuit.Diamonds);
            var card4 = new Card(CardFace.Ten, CardSuit.Clubs);
            var card5 = new Card(CardFace.Two, CardSuit.Spades);

            var cards = new List<ICard>();
            cards.Add(card1);
            cards.Add(card2);
            cards.Add(card3);
            cards.Add(card4);
            cards.Add(card5);

            // ♣
            // ♦
            // ♥
            // ♠

            Hand hand = new Hand(cards);

            bool expected = true;
            PokerHandsChecker checker = new PokerHandsChecker();
            bool actual = checker.IsHighCard(hand);
            Assert.AreEqual(expected, actual);
        }
开发者ID:abaditsegay,项目名称:SVN,代码行数:27,代码来源:PokerHandsTests.cs

示例3: NotHighCardHand

        public void NotHighCardHand()
        {
            var hand = new Hand(new List<ICard>() {
                new Card(CardFace.Four, CardSuit.Clubs),
                new Card(CardFace.Jack, CardSuit.Diamonds),
                new Card(CardFace.Four, CardSuit.Spades),
                new Card(CardFace.King, CardSuit.Hearts),
                new Card(CardFace.Six, CardSuit.Spades)
            });

            var checker = new PokerHandsChecker();
            Assert.IsFalse(checker.IsHighCard(hand));
        }
开发者ID:Termininja,项目名称:TelerikAcademy,代码行数:13,代码来源:IsHighCardHandTests.cs

示例4: TestIsHighCardLessCards

 public void TestIsHighCardLessCards()
 {
     Card cardOne = new Card(CardFace.Two, CardSuit.Diamonds);
     Card cardTwo = new Card(CardFace.Four, CardSuit.Hearts);
     Card cardThree = new Card(CardFace.Jack, CardSuit.Clubs);
     IList<ICard> cards = new List<ICard>();
     cards.Add(cardOne);
     cards.Add(cardTwo);
     cards.Add(cardThree);
     Hand hand = new Hand(cards);
     PokerHandsChecker poker = new PokerHandsChecker();
     bool isHighCard = poker.IsHighCard(hand);
     Assert.AreEqual(false, isHighCard, "IsHighCard() method in class PokerHandsChecker is not working correctly.");
 }
开发者ID:theshaftman,项目名称:Telerik-Academy,代码行数:14,代码来源:IsHighCardTest.cs

示例5: IsHighCardTest

        public void IsHighCardTest()
        {
            Hand hand = new Hand(new List<ICard>() 
            { 
                new Card(CardFace.Ace, CardSuit.Spades),
                new Card(CardFace.Eight, CardSuit.Clubs),
                new Card(CardFace.Ten, CardSuit.Diamonds),
                new Card(CardFace.Jack, CardSuit.Hearts),
                new Card(CardFace.Two, CardSuit.Spades)
            });

            PokerHandsChecker checker = new PokerHandsChecker();
            bool actual = checker.IsHighCard(hand);
            bool expected = true; 
            Assert.AreEqual(expected, actual);
        }
开发者ID:NikolayKostadinov,项目名称:Homeworks,代码行数:16,代码来源:PokerHandsCheckerTest.cs

示例6: TestHighCard1

        public void TestHighCard1()
        {
            ICard[] cards = new ICard[5]
            {
                new Card(CardFace.Ace, CardSuit.Diamonds),
                new Card(CardFace.King, CardSuit.Hearts),
                new Card(CardFace.Two, CardSuit.Hearts),
                new Card(CardFace.Eight, CardSuit.Spades),
                new Card(CardFace.Nine, CardSuit.Clubs)
            };

            IHand hand = new Hand(cards);

            PokerHandsChecker checker = new PokerHandsChecker();

            Assert.IsTrue(checker.IsHighCard(hand), "High card is not identified correctly.");
        }
开发者ID:niki-funky,项目名称:Telerik_Academy,代码行数:17,代码来源:PokerHandsCheckerTest.cs

示例7: IsHighCard_AceAsHightCard

        public void IsHighCard_AceAsHightCard()
        {
            IList<ICard> cards = new List<ICard>
            {
                new Card(CardFace.Ace, CardSuit.Diamonds),
                new Card(CardFace.Two, CardSuit.Diamonds),
                new Card(CardFace.Eight, CardSuit.Clubs),
                new Card(CardFace.Six, CardSuit.Hearts),
                new Card(CardFace.Queen, CardSuit.Spades),
            };

            Hand hand = new Hand(cards);

            PokerHandsChecker checker = new PokerHandsChecker();

            Assert.IsTrue(checker.IsHighCard(hand));
        }
开发者ID:Nottyy,项目名称:TelerikAcademy,代码行数:17,代码来源:PokerHandsCheckerTestMethodIsHighCard.cs

示例8: IsHighCard_ThreeOfAces

        public void IsHighCard_ThreeOfAces()
        {
            IList<ICard> cards = new List<ICard>
            {
                new Card(CardFace.Ace, CardSuit.Diamonds),
                new Card(CardFace.Ace, CardSuit.Spades),
                new Card(CardFace.Ace, CardSuit.Hearts),
                new Card(CardFace.Eight, CardSuit.Clubs),
                new Card(CardFace.Six, CardSuit.Hearts),
            };

            Hand hand = new Hand(cards);

            PokerHandsChecker checker = new PokerHandsChecker();

            Assert.IsFalse(checker.IsHighCard(hand));
        }
开发者ID:Nottyy,项目名称:TelerikAcademy,代码行数:17,代码来源:PokerHandsCheckerTestMethodIsHighCard.cs

示例9: PairOfAces

        public void PairOfAces()
        {
            IList<ICard> cards = new List<ICard>();
            cards.Add(new Card(CardFace.Ace, CardSuit.Hearts));
            cards.Add(new Card(CardFace.Nine, CardSuit.Clubs));
            cards.Add(new Card(CardFace.Ten, CardSuit.Diamonds));
            cards.Add(new Card(CardFace.Five, CardSuit.Clubs));
            cards.Add(new Card(CardFace.Ace, CardSuit.Spades));

            Hand hand = new Hand(cards);

            PokerHandsChecker checker = new PokerHandsChecker();

            bool result = checker.IsHighCard(hand);
            bool expected = false;

            Assert.AreEqual(expected, result);
        }
开发者ID:bahtev,项目名称:TelerikAcademy,代码行数:18,代码来源:PokerHandsCheckerIsHighCard.cs

示例10: HighCardTen

        public void HighCardTen()
        {
            IList<ICard> cards = new List<ICard>();
            cards.Add(new Card(CardFace.Two, CardSuit.Hearts));
            cards.Add(new Card(CardFace.Ten, CardSuit.Clubs));
            cards.Add(new Card(CardFace.Seven, CardSuit.Diamonds));
            cards.Add(new Card(CardFace.Four, CardSuit.Clubs));
            cards.Add(new Card(CardFace.Five, CardSuit.Spades));

            Hand hand = new Hand(cards);

            PokerHandsChecker checker = new PokerHandsChecker();

            bool result = checker.IsHighCard(hand);
            bool expected = true;

            Assert.AreEqual(expected, result);
        }
开发者ID:bahtev,项目名称:TelerikAcademy,代码行数:18,代码来源:PokerHandsCheckerIsHighCard.cs

示例11: IsNotHighCardTest

        public void IsNotHighCardTest()
        {
            Card twoOfHearts = new Card(CardFace.Two, CardSuit.Hearts);
            Card aceOfSpades = new Card(CardFace.Ace, CardSuit.Spades);
            Card fourOfHearts = new Card(CardFace.Four, CardSuit.Hearts);
            Card aceOfClubs = new Card(CardFace.Ace, CardSuit.Clubs);
            Card tenOfHearts = new Card(CardFace.Ten, CardSuit.Hearts);

            List<ICard> cardsInHand = new List<ICard>();

            cardsInHand.Add(twoOfHearts);
            cardsInHand.Add(aceOfSpades);
            cardsInHand.Add(fourOfHearts);
            cardsInHand.Add(aceOfClubs);
            cardsInHand.Add(tenOfHearts);

            IHand hand = new Hand(cardsInHand);

            PokerHandsChecker handsChecker = new PokerHandsChecker();

            Assert.IsFalse(handsChecker.IsHighCard(hand));
        }
开发者ID:hristo-iliev,项目名称:TelerikHW,代码行数:22,代码来源:HighCardTest.cs

示例12: IsHighCardTest

        public void IsHighCardTest()
        {
            Card aceClubs = new Card(CardFace.Ace, CardSuit.Clubs);
            Card kingClubs = new Card(CardFace.King, CardSuit.Clubs);
            Card twoHearts = new Card(CardFace.Two, CardSuit.Hearts);
            Card jackClubs = new Card(CardFace.Jack, CardSuit.Clubs);
            Card tenOfClubs = new Card(CardFace.Ten, CardSuit.Clubs);

            List<ICard> cardsInHand = new List<ICard>();

            cardsInHand.Add(tenOfClubs);
            cardsInHand.Add(aceClubs);
            cardsInHand.Add(jackClubs);
            cardsInHand.Add(kingClubs);
            cardsInHand.Add(twoHearts);

            IHand hand = new Hand(cardsInHand);

            PokerHandsChecker handsChecker = new PokerHandsChecker();

            Assert.IsTrue(handsChecker.IsHighCard(hand));
        }
开发者ID:hristo-iliev,项目名称:TelerikHW,代码行数:22,代码来源:HighCardTest.cs

示例13: TestIsHighCardShoudReturnTrue

        public void TestIsHighCardShoudReturnTrue()
        {
            var checker = new PokerHandsChecker();
            var cards = new List<ICard>
            {
                new Card(CardFace.Ace, CardSuit.Diamonds),
                new Card(CardFace.King, CardSuit.Diamonds),
                new Card(CardFace.Two, CardSuit.Spades),
                new Card(CardFace.Three, CardSuit.Spades),
                new Card(CardFace.Five, CardSuit.Hearts)
            };
            var hand = new Hand(cards);

            Assert.IsTrue(checker.IsHighCard(hand));
        }
开发者ID:Hri100v,项目名称:Telerik-Academy,代码行数:15,代码来源:PockerHandsChecker_Combinations.cs

示例14: TestIsHighCardShoudReturnFalseWhenNotMatchingHandPassed_OnePair

        public void TestIsHighCardShoudReturnFalseWhenNotMatchingHandPassed_OnePair()
        {
            var checker = new PokerHandsChecker();
            var cards = new List<ICard>
            {
                new Card(CardFace.Ace, CardSuit.Diamonds),
                new Card(CardFace.King, CardSuit.Diamonds),
                new Card(CardFace.Two, CardSuit.Spades),
                new Card(CardFace.Two, CardSuit.Diamonds),
                new Card(CardFace.Five, CardSuit.Hearts)
            };
            var hand = new Hand(cards);

            Assert.IsFalse(checker.IsHighCard(hand));
        }
开发者ID:Hri100v,项目名称:Telerik-Academy,代码行数:15,代码来源:PockerHandsChecker_Combinations.cs

示例15: IsNotHighCardTest

 public void IsNotHighCardTest()
 {
     PokerHandsChecker target = new PokerHandsChecker();
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Two, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Two, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Queen, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Seven, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Six, CardSuit.Clubs));
     IHand hand = new Hand(cards);
     bool expected = false;
     bool actual;
     actual = target.IsHighCard(hand);
     Assert.AreEqual(expected, actual);
 }
开发者ID:kikooo52,项目名称:TelerikAkademy,代码行数:15,代码来源:PokerHandsCheckerTest.cs


注:本文中的Poker.PokerHandsChecker.IsHighCard方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。