Exemplo n.º 1
0
        public void Part1LongTest()
        {
            // Given
            var game = new CupGame("389125467".Select(c => int.Parse(c.ToString())).ToList());

            // When
            for (var i = 0; i < 100; i++)
            {
                game.Move();
            }

            // Then
            Assert.Equal("67384529", game.ToString(1)[1..]);
Exemplo n.º 2
0
        public void Part1Test()
        {
            // Given
            var game = new CupGame("389125467".Select(c => int.Parse(c.ToString())).ToList());

            Assert.Equal("389125467", game.ToString(3));

            game.Move();
            Assert.Equal("328915467", game.ToString(3));

            game.Move();
            Assert.Equal("325467891", game.ToString(3));

            game.Move();
            Assert.Equal("725891346", game.ToString(7));

            game.Move();
            Assert.Equal("325846791", game.ToString(3));

            game.Move();
            Assert.Equal("925841367", game.ToString(9));

            game.Move();
            Assert.Equal("725841936", game.ToString(7));

            game.Move();
            Assert.Equal("836741925", game.ToString(8));

            game.Move();
            Assert.Equal("741583926", game.ToString(7));

            game.Move();
            Assert.Equal("574183926", game.ToString(5));

            game.Move();
            Assert.Equal("583741926", game.ToString(5));
        }