Beispiel #1
0
        public void CalculateSolutionForSecondPuzzle()
        {
            var map = new string[]
            {
                "..##.......",
                "#...#...#..",
                ".#....#..#.",
                "..#.#...#.#",
                ".#...##..#.",
                "..#.##.....",
                ".#.#.#....#",
                ".#........#",
                "#.##...#...",
                "#...##....#",
                ".#..#...#.#"
            };

            var sut = new MultiplierFinder(map);

            Assert.Equal(336, sut.CalculateSolution());
        }
Beispiel #2
0
        public void SolveSecondPuzzle()
        {
            var map = new string[]
            {
                "....#............#.###...#.#.#.",
                ".#.#....##.........#.....##.#..",
                ".#..#.#...####.##..#......#..##",
                "......#...#...#.......#........",
                "........#...###..#.#....#....#.",
                "..##.....#.....#.#.........#.#.",
                ".##.......#.#.#...#..#...##...#",
                "...##.....#....##....#...###.#.",
                "..#...#......##.#.##.....#.#..#",
                ".#....#.###.........#..........",
                ".#.#..##.....###.....###....#.#",
                "....###....#......#...#......##",
                "......##...#.##.........#.#..#.",
                "##.#....##...#..##....#.#..#.##",
                ".#...#..#.....#.#.......#...#..",
                "..........#..###.###......##..#",
                "..#.##.#..#......#.......###.#.",
                "...#...#.#.#..#...#.#..........",
                "#........#..#..#.#....#.##..###",
                "#...#.....#..####.........####.",
                ".....###..........#.#...##...#.",
                ".....#...#..#.......#....##.#..",
                "...........#..##.....#...#..#..",
                "......##..#........#...........",
                "#.#..#.#.#..#.....#....#.....#.",
                "..#....##....##...#.....#......",
                ".#.#....#..#.#......#..###...#.",
                ".......#...#.#....##..#..#..#..",
                ".#.#.#.......#....#.#.#.......#",
                ".#..........#.##.#...#..#.#.##.",
                "..#.#..........#.#....##.#.##..",
                "###..#..#.#...##.#.#..#........",
                "##....#...#....#....#...#.#....",
                "#...#.#....#.##..##...#.#......",
                "......#...#.###......##....#...",
                ".................#.###......#..",
                "##..#....#....##...###.#.#..###",
                "..#..........#..####..##..#...#",
                ".#......#..#.#...........##.#..",
                ".#..#......#...#.#.#..#.#.#.#.#",
                ".#......###.....#.#.#......##..",
                "#..........#.##...#...........#",
                "..#....#.##....#.........#.....",
                ".#..##....#...##.........#..#..",
                "....##..#.###..#.#...#..###..#.",
                "..#......#........#...#.#......",
                "........#..#..#..#...#.##......",
                ".##.#.#......#...#.........#...",
                "#..###.#...#....###.##..###....",
                "........##.............#....#..",
                "...#...............#....#.#....",
                "#..........#..#..#.#.....#...#.",
                ".#.............#...#.......#..#",
                ".#..#..#...#........##.........",
                ".....#.#..#.#..#..##.........#.",
                "..#..##...#....#.#...#.###..#..",
                "#...........##.....#...#.##....",
                "#.#.#.#........##......#...#.#.",
                "......#..#.###.#...#.##.##....#",
                ".#....#...#....#........#....#.",
                "..#.#..........#..##.......#..#",
                ".....#...##..#................#",
                ".#...............##...#.##...##",
                "#.####....##.....#.......#.##..",
                "......#.##.#...##..###..#.#....",
                ".#.##.#...##..#.......#.#..#...",
                "#...#.##..........##..........#",
                "#.###...#...#..#.....#.#.##..##",
                ".##.....#....#...##.....##.....",
                "...#........#..###.###...#.....",
                "##..#....#.....#...#.#....#.#..",
                "#....#....#.#..........#...#..#",
                "...##..#......#..#..#..#..#....",
                ".....##...#..####..##.........#",
                ".....#..#.#...#..#....##..##...",
                "..#.......##.#..#.##...#.#....#",
                ".#..#.#...##..##....#..#......#",
                "..##.##..##...###..#....#...#..",
                "........##.......##...##.....##",
                ".#....###...#..#..#..#.......#.",
                "#.###............#....##.....#.",
                "..........#...#...##..#...#....",
                "..#......#.##.......#....##..##",
                "..#..###.....#...#.......#.....",
                "#.#...##.....#...#....#.......#",
                "....##.##.#....#.....#.#....#..",
                "...#....#.###............#..###",
                "#..##..#.........##.....#.#...#",
                "....#.......##......#....#...#.",
                "....#..##.#..........#.........",
                "....#...#.###.......#...#.#....",
                "#..#..#...#.......##...#..#.##.",
                "#.......#...##.##......#.......",
                "##..##...##...#......#...#...##",
                "..#...#.#.####.#...##.....##...",
                "#...#..#..#...##......#.#..#..#",
                "..##..##.#.#..#...####.....###.",
                ".#........#..##.###...#.##.#...",
                "........#..#...##......#.#....#",
                "..#...###.......##..##..#....#.",
                ".##...#.#..#.##.......##.###...",
                "#....#.#.#........#....#..#.##.",
                "....#.##.#.##..#.#####.....###.",
                "#.#..#..#...#.#..#.......#.#...",
                "....#...#....###...............",
                ".###.#.....#.#.......###......#",
                "##...#.#.###....##..#...##.....",
                "...#.#..#.###.#.......#...#.#..",
                ".#...#....#...#..####....###...",
                "..#....##.....##.#.#.##....#...",
                "#....#..##.......#...##.##....#",
                ".##..#.......#..#....###.......",
                "#.##.....##.#.........#......##",
                ".####.#...#.....#..#...#.##..#.",
                "....#...........#.....#........",
                ".#............##...#.......#.#.",
                "#....#.##........#....#.#..#..#",
                "#....#.##....#...##...#..#..#..",
                "...#..#.####.#....#............",
                "....#......#.........#.........",
                "#....##....###.....#......#.#..",
                "...#..#....#........###..#...#.",
                "..#.#........#.#.#.###..#.#.#..",
                ".....###.....##.#....###.#.....",
                "##.#....#....##...##.###.#.##..",
                ".###.#..#.......##...#...##....",
                ".#...###........#.......##.##..",
                "#......####...#...##.#.######..",
                "....##.............#..##.##...#",
                "...........#..##.#...#.#.#...#.",
                "###.......#.##..#....#...#....#",
                ".........#.....#.#.#..##.#.....",
                "#...##..#....#..#.............#",
                "...#.......#.##.............#.#",
                ".....#..#...##......####..#....",
                ".#.#.#.....#...####..#...##...#",
                "#...#.#..#..#.#..#.##..........",
                ".....#.##..#.#.##..#.#.#....#.#",
                "...##..#...#...#..#....#.......",
                "........#.#..#...#...#.#...#...",
                "##..#........#..#.....#......##",
                ".........#..#...#......#......#",
                "..#.#.#........##...#.##.....##",
                ".###....##....#...#....#..#....",
                ".#.............###...#..##..###",
                ".##.##.##.......###.........#.#",
                "..#..###...#...#....#..#.#..#.#",
                "......#..#.#..#.....#.#........",
                "......#...####...#.#.....#.....",
                ".#...##.......#..#......#...#..",
                "#..#...#.......###..#..#.#.#.#.",
                ".....#.....###.##....#.#.##.#.#",
                "#........#....##...#..#.##..#..",
                "...#.#........##....#.#..###.#.",
                "#...#...##.........#........###",
                "##...#.##..##...#.....#.###.#..",
                "#.###.#.#..#...........##..#...",
                "........#.......#..#..#.###....",
                "#........#....#......###.......",
                "..#.###.######...#.###..#......",
                "...#...######..#.....#....#.#..",
                "..#.......#..#..#.........#...#",
                ".#...#..##.##.........##.......",
                ".........#.#.##.#..#....#.#...#",
                "#.......#....#......#.....###.#",
                "##..............#.###........#.",
                "..#.##..#.##.....#...#.#.#..###",
                "..#.#......#..#..##.#........#.",
                "..#.....#...#.#...#...###..#.#.",
                ".......#...........#..#..#.#.##",
                ".......#...##..#.###...........",
                ".#........#.###.#..#..#..#..#..",
                "##.#.##....#..###..#.##.##...#.",
                ".....#....##.#........#.#.#....",
                "....##....#..#..#....##....#.#.",
                "#.....##....#.....#.###.#....#.",
                ".#.##.##..#..#...#...........##",
                "...#..###..#.....##....#.......",
                "...#..##..###.#..#..#.#........",
                "......##..#.......#..##.....###",
                ".#...##.#.#.#......#...#.#.#.##",
                "....#.#....#...#........#...#..",
                "....#.#......#.#.###.#.#.##.#..",
                "#..#........###..#..#..#.....#.",
                "...#....#...##...#........##.##",
                ".....#..#..#.....#....#.#...#..",
                "..#.###....#.#..##......#.##.#.",
                "..####......#..#.#.#..#.#####..",
                ".......##..#..###.#............",
                "..###.#........#..........##.##",
                "#.#.........#.##.#......#..#...",
                "...#.....#.....##..#..##.##..#.",
                "#.#.##....#.......###....##....",
                "...##.#..#...##.#..#......#..#.",
                "..##.........#.##.#####...#.#..",
                ".#....#...#....#.#.....##...###",
                "##.....#..####............###.#",
                "......#...........#....#.......",
                ".#......#.....##...........###.",
                "#......##.......#.#.#..##.....#",
                "...###.#.....##.#...#.#....#.#.",
                "...###.......#...#.............",
                "..#..#.#....#.#.###.#.#.##..##.",
                "..##...#..#.#..##.#.##....##...",
                "..#...........#..#....#....#...",
                "#.##...........#..#.#..##.#.#..",
                "...##...##................#..#.",
                ".#...#.##......#.#......#.####.",
                "#.##....#....#.........#....###",
                ".....###........#.#.#.##...#.##",
                ".....#....#.#....#.........#..#",
                "..#...#.#.#.#...#...#...##.#..#",
                "###.......#.....#.............#",
                "#.####.#.......#.#.#.#..#.#....",
                "#..#..#####......#....#..##....",
                "...............#.....#.#....###",
                ".###.....#...#.##..#.#..#.#####",
                "#.##.....#......##.......##....",
                "..........###.......#...#.#....",
                "..#.#..#...##.....#........#.#.",
                "........##.##....#####.#.#..##.",
                "..##.#.#...#####..........#.#.#",
                "#.........#......##...#.....#..",
                ".##.#........#...#..##...#...#.",
                ".......##..#...#.....#.##......",
                "....#.#...##..##..#....##......",
                "#........#..........##..####.#.",
                "...###...#.#.###.#...#....#.#.#",
                ".....##.#.....#........#.#....#",
                "#.......#....#...##..#......#..",
                "...#..........#.#.#...#.#.###.#",
                "....##.....#.##..#.#.#.........",
                "#.##..##..#....#.........#...#.",
                ".###..........#...##.#..#......",
                ".....####.............##...###.",
                ".#..#....#..#...#..#...........",
                "#..#..##..#...#.##..#.###.#...#",
                "......#.#..###...#..#.....#..#.",
                "##.##......#...#.#...#.........",
                "....##.#.......#.#..##....#.#.#",
                "#..##..#...###.#....##.........",
                ".............#.#....#...##..#..",
                "..#....#...#.....#.##.#..##..##",
                "##.#..##.#..##.#.#.##.#...#.#..",
                ".##.#..#.#........##.#...##....",
                "#.........##....##..#......#...",
                ".#.#.......##...#..#......###.#",
                "........#.#.#.#......#....#..#.",
                "...##..#...#...#.##..#....#.#..",
                "...#.#.#.#.......#.......###..#",
                "...#..##..#####.#.....##.#..#..",
                ".......#.#.....#.....#...#...##",
                "#...#...#......##.#....##......",
                "#.....#.#.#.....#....#......#..",
                "..#..#.##.#......##..#.#..#..##",
                "####...#.....#....#.#..........",
                "....#.....###...#...##......#..",
                ".....#....#...#............#...",
                "...#...#..##.........#...#...##",
                "#.#..#.#...##.#.......#..#.#...",
                ".#.....#...##.............#...#",
                ".....#..##..#....#......#.##..#",
                "....#...###.................#..",
                "...###...#....#...#...#........",
                "....#.##.#.......#..#..........",
                "...#..#......#.#...###...#.#...",
                "..#.#..#...#.......#.......#.#.",
                ".#.#...#.#.##........#.........",
                "...#..#...#....#.#.#.#.#..###..",
                ".#..##......#.#.##..#.##....#..",
                "#....#.......##.....#.#........",
                "..###..#.#.#.......##....#.....",
                "........#.#.#....##...##..#....",
                "#....##.#....#...##..##...#....",
                "...#..##.#.....#...#.....##....",
                ".#.#..#..#...#....#..##.#....#.",
                "##.#.##....#.....#....#....#.#.",
                ".##......#............##...#...",
                "#..##.#.####.#.#....#..#..#.#.#",
                "#...##...#......##....###.....#",
                "..#.##.....#....#....#......#..",
                ".##.#...#.....#.#.#.#........##",
                ".#..#....#.#...........#...#...",
                "#.....#..#.....#.#.##.#.....#..",
                "....#.....#..#.#....###........",
                ".....###...........#.#..##.#.#.",
                "....###....#.......###..#...#.#",
                ".###.....#...##.#...##........#",
                "..#..#.#..#...#.#...#.#..#...#.",
                "#.####.......#....##.#..#.#..#.",
                "....#.#.##.#..###.........##.#.",
                "..#..#.#....#....#.##..........",
                "..##.###..#.#..#.#......#....#.",
                ".#..#.....##...#.#......##.#..#",
                "#.#....#..#.#.#........#.###...",
                "...#....##....##..###.###.#.#..",
                "..#....#.....#....##.#.........",
                "#.......#....#.........##..#...",
                ".#..#...#.#..#.#....#.#........",
                "...#..###...#.....#......##....",
                "..#...........#.....#..........",
                "....###.#...#......#...#..#....",
                ".....#.##..#..#....#.......#..#",
                "....##..#.#.#..............#.#.",
                ".#.#..#..#.#......#...#.#......",
                "....#.......#.##....##.#.#.#..#",
                "............#.#.#.....##.......",
                "........#...##.#..#......#...##",
                ".........#...#...#....#...#.##.",
                "..#.....#......#......#.....#..",
                "#....#...##..#.#....#.#...#.###",
                ".......#..#..#..#.#...#.....#.#",
                "...#.#...#......##.....#..#....",
                "...#.#.####..##.#..#...........",
                "..##..##....#.....####...#....#",
                "###.......#...##.#...#...#...#.",
                ".##..#.....#..####......#....#.",
                "#.....#..#..##..##...#..#..#...",
                ".#....#.....#...####..####.....",
                "..#....#...#......#........#.#.",
                "##.#.......#..#.....#..##..##..",
                ".#..#..#.#.#...#....##...#.##.#",
                "##...#..#....#.........##......"
            };

            var sut = new MultiplierFinder(map);

            Assert.Equal(7560370818, sut.CalculateSolution());
        }