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

            var sut = new MultiplierFinder(map);

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

            var sut = new MultiplierFinder(map);

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