Ejemplo n.º 1
0
        public void Example1Test()
        {
            var map = @"
.#..#
.....
#####
....#
...##";

            MonitoringStation.CalculateBestStation(map).maxNumberOfVisible.ShouldBe(8);
        }
Ejemplo n.º 2
0
        public void Part2Example1Test()
        {
            var map = @"
.#....#####...#..
##...##.#####..##
##...#...#.#####.
..#.....#...###..
..#.#.....#....##
";

            MonitoringStation.DoGiantLaserStuff(map, (8, 3));
        }
Ejemplo n.º 3
0
        public void Day10()
        {
            var map = @"
.............#..#.#......##........#..#
.#...##....#........##.#......#......#.
..#.#.#...#...#...##.#...#.............
.....##.................#.....##..#.#.#
......##...#.##......#..#.......#......
......#.....#....#.#..#..##....#.......
...................##.#..#.....#.....#.
#.....#.##.....#...##....#####....#.#..
..#.#..........#..##.......#.#...#....#
...#.#..#...#......#..........###.#....
##..##...#.#.......##....#.#..#...##...
..........#.#....#.#.#......#.....#....
....#.........#..#..##..#.##........#..
........#......###..............#.#....
...##.#...#.#.#......#........#........
......##.#.....#.#.....#..#.....#.#....
..#....#.###..#...##.#..##............#
...##..#...#.##.#.#....#.#.....#...#..#
......#............#.##..#..#....##....
.#.#.......#..#...###...........#.#.##.
........##........#.#...#.#......##....
.#.#........#......#..........#....#...
...............#...#........##..#.#....
.#......#....#.......#..#......#.......
.....#...#.#...#...#..###......#.##....
.#...#..##................##.#.........
..###...#.......#.##.#....#....#....#.#
...#..#.......###.............##.#.....
#..##....###.......##........#..#...#.#
.#......#...#...#.##......#..#.........
#...#.....#......#..##.............#...
...###.........###.###.#.....###.#.#...
#......#......#.#..#....#..#.....##.#..
.##....#.....#...#.##..#.#..##.......#.
..#........#.......##.##....#......#...
##............#....#.#.....#...........
........###.............##...#........#
#.........#.....#..##.#.#.#..#....#....
..............##.#.#.#...........#.....";


            var station = MonitoringStation.CalculateBestStation(map);

            Console.WriteLine($"Placing laser at {station.bestAsteroid}, where {station.maxNumberOfVisible} asteroids are visible.");
            Console.WriteLine(MonitoringStation.DoGiantLaserStuff(map, station.bestAsteroid));
        }