コード例 #1
0
        public void DevelopmentalTwo()
        {
            int[] cluesForTest = { 0, 3, 2, 0, 0, 5, 0, 0, 4, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 0, 0, 3, 4, 0 };
            int[] upClues;
            int[] rightClues;
            int[] bottomClues;
            int[] leftClues;
            SkyScrapersAll.SetClues(cluesForTest, out upClues, out rightClues, out bottomClues, out leftClues);

            string[][] expected =
            {
                new [] { "6", "1", "2", "3", "5", "4" },
                new [] { "5", "3", "4", "1", "6", "2" },
                new [] { "4", "6", "3", "2", "1", "5" },
                new [] { "1", "2", "5", "6", "4", "3" },
                new [] { "3", "5", "6", "4", "2", "1" },
                new [] { "2", "4", "1", "5", "3", "6" }
            };
            expected = RotateLeft(expected);
            expected = RotateLeft(expected);
            Assert.AreEqual(true, SkyScrapersAll.IsBoardDevelopmental(expected, upClues, rightClues, bottomClues, leftClues, 6));
            var dictFortest = new Dictionary <int[], string>();

            Assert.AreEqual(true, SkyScrapersAll.SolvePuzzle(cluesForTest, true, dictFortest).Length != 1);
        }
コード例 #2
0
 public void WholeBoard4x4_6()
 {
     int[]   cluesForTest = { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 2, 0, 0, 0, 2 };
     int[][] expected     =
     {
         new [] { 3, 4, 1, 2 },
         new [] { 4, 1, 2, 3 },
         new [] { 1, 2, 3, 4 },
         new [] { 2, 3, 4, 1 }
     };
     Assert.AreEqual(expected, SkyScrapersAll.SolvePuzzle(cluesForTest));
 }
コード例 #3
0
 public void WholeBoard6x6_ScanAllStepFive1()
 {
     int[]   cluesForTest = { 0, 0, 0, 2, 2, 0, 0, 0, 0, 6, 3, 0, 0, 4, 0, 0, 0, 0, 4, 4, 0, 3, 0, 0 };
     int[][] expected     =
     {
         new [] { 5, 6, 1, 4, 3, 2 },
         new [] { 4, 1, 3, 2, 6, 5 },
         new [] { 2, 3, 6, 1, 5, 4 },
         new [] { 6, 5, 4, 3, 2, 1 },
         new [] { 1, 2, 5, 6, 4, 3 },
         new [] { 3, 4, 2, 5, 1, 6 }
     };
     Assert.AreEqual(expected, SkyScrapersAll.SolvePuzzle(cluesForTest));
 }
コード例 #4
0
 public void WholeBoard6x6_ScanAllStepTwo()
 {
     int[]   cluesForTest = { 0, 0, 0, 6, 3, 0, 0, 4, 0, 0, 0, 0, 4, 4, 0, 3, 0, 0, 0, 0, 0, 2, 2, 0 }; //todo <--- good
     int[][] expected     =
     {
         new [] {  1235, 1236, 1236,  4,   135,  235 },
         new [] { 12345, 1236, 1236, 12,  1346, 2345 },
         new [] {  1234,  123, 1236, 12, 13456, 2345 },
         new [] {     6,    5,    4,  3,     2,    1 },
         new [] {   123,  123,    5,  6,   134,  234 },
         new [] {   123,    4,  123,  5,    13,    6 }
     };
     expected = RotateLeft(expected);
     Assert.AreEqual(expected, SkyScrapersAll.SolvePuzzle(cluesForTest, false));
 }
コード例 #5
0
        public void WholeBoard6x6_WithReadySetsLeftTwoZero()
        {
            int[] cluesForTest = { 0, 0, 0, 2, 0, 3, 0, 0, 0, 3, 4, 0, 0, 3, 2, 0, 0, 5, 0, 0, 4, 0, 0, 0 };
            var   dictFortest  = new Dictionary <int[], string>();

            dictFortest.Add(new int[] { 1, 1 }, "3");


            int[][] expected =
            {
                new [] { 6, 1, 2, 3, 5, 4 },
                new [] { 5, 3, 4, 1, 6, 2 },
                new [] { 4, 6, 3, 2, 1, 5 },
                new [] { 1, 2, 5, 6, 4, 3 },
                new [] { 3, 5, 6, 4, 2, 1 },
                new [] { 2, 4, 1, 5, 3, 6 }
            };
            Assert.AreEqual(expected, SkyScrapersAll.SolvePuzzle(cluesForTest, true, dictFortest));
        }