Пример #1
0
        public void SolvePuzzle1()
        {
            var clues = new[] { 3, 2, 2, 3, 2, 1,
                                1, 2, 3, 3, 2, 2,
                                5, 1, 2, 2, 4, 3,
                                3, 2, 1, 2, 2, 4 };

            var expected = new[] { new [] { 2, 1, 4, 3, 5, 6 },
                                   new [] { 1, 6, 3, 2, 4, 5 },
                                   new [] { 4, 3, 6, 5, 1, 2 },
                                   new [] { 6, 5, 2, 1, 3, 4 },
                                   new [] { 5, 4, 1, 6, 2, 3 },
                                   new [] { 3, 2, 5, 4, 6, 1 } };

            var actual = Skyscrapers.SolvePuzzle(clues);

            Assert.Equal(expected, actual);
        }
Пример #2
0
        public void SolvePuzzle3()
        {
            var clues = new[] { 0, 3, 0, 5, 3, 4,
                                0, 0, 0, 0, 0, 1,
                                0, 3, 0, 3, 2, 3,
                                3, 2, 0, 3, 1, 0 };

            var expected = new[] { new [] { 5, 2, 6, 1, 4, 3 },
                                   new [] { 6, 4, 3, 2, 5, 1 },
                                   new [] { 3, 1, 5, 4, 6, 2 },
                                   new [] { 2, 6, 1, 5, 3, 4 },
                                   new [] { 4, 3, 2, 6, 1, 5 },
                                   new [] { 1, 5, 4, 3, 2, 6 } };

            var actual = Skyscrapers.SolvePuzzle(clues);

            Assert.Equal(expected, actual);
        }