コード例 #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 DevelopmentalBug()
        {
            int[] cluesForTest = { 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 3, 0, 3 };
            int[] upClues;
            int[] rightClues;
            int[] bottomClues;
            int[] leftClues;
            SkyScrapersAll.SetClues(cluesForTest, out upClues, out rightClues, out bottomClues, out leftClues);

            string[][] board =
            {
                new [] { "1", "2",  "4", "3"  },
                new [] { "3", "4",  "1", "2"  },
                new [] { "2", "13", "3", "14" },
                new [] { "4", "13", "2", "1"  },
            };
            Assert.AreEqual(true, SkyScrapersAll.IsBoardDevelopmental(board, upClues, rightClues, bottomClues, leftClues, 4));
        }
コード例 #3
0
        public void DevelopmentalTree()
        {
            int[] cluesForTest = { 0, 0, 4, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 0, 0, 3, 4, 0, 0, 3, 2, 0, 0, 5 };
            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);
            expected = RotateLeft(expected);
            Assert.AreEqual(true, SkyScrapersAll.IsBoardDevelopmental(expected, upClues, rightClues, bottomClues, leftClues, 6));
        }