예제 #1
0
        public static IList<TwoCards> GetAllCombinationsOfTwoCards(IList<Card> deck)
        {
            IList<TwoCards> combinations = new List<TwoCards>();
            for (var i = 0; i < deck.Count - 1; i++)
            {
                for (var j = i + 1; j < deck.Count; j++)
                {
                    var twoCards = new TwoCards(deck[i], deck[j]);
                    combinations.Add(twoCards);
                }
            }

            return combinations;
        }
예제 #2
0
        public static IList <TwoCards> GetAllCombinationsOfTwoCards(IList <Card> deck)
        {
            IList <TwoCards> combinations = new List <TwoCards>();

            for (var i = 0; i < deck.Count - 1; i++)
            {
                for (var j = i + 1; j < deck.Count; j++)
                {
                    var twoCards = new TwoCards(deck[i], deck[j]);
                    combinations.Add(twoCards);
                }
            }

            return(combinations);
        }