Exemple #1
0
        public void Resolve()
        {
            var map      = Map.Parse(File.ReadAllLines("./input/input3.txt"));
            var toboggan = new Toboggan(map, 3);
            var squares  = toboggan.SlideDown();

            squares.Count(s => s == Square.Tree).Should().Be(247);
        }
Exemple #2
0
        public void TobogganSlideDown()
        {
            var map      = Map.Parse(new[] { ".#", "#." });
            var toboggan = new Toboggan(map, 1);
            var squares  = toboggan.SlideDown();

            squares.Should().BeEquivalentTo(new[] { Square.Open, Square.Open });
        }
Exemple #3
0
        public void TobogganSlideDownSlopeOfMultipleRows()
        {
            var map      = Map.Parse(new[] { ".#", ".#", ".#", ".#", ".#" });
            var toboggan = new Toboggan(map, new Slope(1, 2));
            var squares  = toboggan.SlideDown();

            squares.Count().Should().Be(3);
            squares.Should().BeEquivalentTo(new[] { Square.Open, Square.Tree, Square.Open });
        }