Ejemplo n.º 1
0
        private static long GetDay22Part2()
        {
            var decks = GetDay22Input();

            _ = CombatHelper.TryPlayGame(decks, true, out Deck winner);
            return(CombatHelper.GetWinnerScore(winner));
        }
Ejemplo n.º 2
0
        public void GetWinnerScoreTest()
        {
            var testData = new List <Tuple <Deck, long> >()
            {
                new Tuple <Deck, long>(
                    new Deck(string.Empty, new List <int>()
                {
                    3, 2, 10, 6, 8, 5, 9, 4, 7, 1
                }),
                    306)
            };

            foreach (var testExample in testData)
            {
                var actual = CombatHelper.GetWinnerScore(testExample.Item1);
                Assert.Equal(testExample.Item2, actual);
            }
        }