Exemplo n.º 1
0
        public void Puzzle2_NumberGame_Find30000000thNumber()
        {
            var game = new NumberGame(Input.Day15);

            do
            {
                game.Turn();
            } while (game.Numbers.Count < 30_000_000);

            game.Numbers.Last().Should().Be(883);
        }
Exemplo n.º 2
0
        public void Game_Examples_Find2020thNumber(IEnumerable <int> startingList, int expectedNumber)
        {
            var game = new NumberGame(startingList);

            do
            {
                game.Turn();
            } while (game.Numbers.Count < 2020);

            game.Numbers.Last().Should().Be(expectedNumber);
        }
Exemplo n.º 3
0
        public void Puzzle1_NumberGame_Find2020thNumber()
        {
            var game = new NumberGame(Input.Day15);

            do
            {
                game.Turn();
            } while (game.Numbers.Count < 2020);

            game.Numbers.Last().Should().Be(496);
        }
Exemplo n.º 4
0
        public void Game_WithExample_GeneratesTurnsCorrectly()
        {
            var game = new NumberGame(Example);

            game.Turn().Should().Be(0);
            game.Turn().Should().Be(3);
            game.Turn().Should().Be(3);
            game.Turn().Should().Be(1);
            game.Turn().Should().Be(0);
            game.Turn().Should().Be(4);
            game.Turn().Should().Be(0);
        }