Example #1
0
        public void Example()
        {
            output.WriteLine(C18Q01_TestHelper.MazeToString(exampleGrid, withBorder: false));
            var darkenedGrid = Q03.DarkenEnclosedREegions(exampleGrid);

            output.WriteLine("");
            output.WriteLine(C18Q01_TestHelper.MazeToString(darkenedGrid, withBorder: false));
        }
Example #2
0
        public C18Q03_Tests(ITestOutputHelper output)
        {
            this.output = output;

            encodedGrid = new String[4]
            {
                "XXXX",
                ".X.X",
                "X..X",
                "XXXX",
            };
            exampleGrid = C18Q01_TestHelper.GetGridFromEncoded(encodedGrid);
        }
Example #3
0
        public void Example()
        {
            var reversePath = Q01.FindPathToExit(C18Q01_TestHelper.ExampleMaze, new Q01.Node(9, 0), new Q01.Node(0, 9));

            bool?[,] mazeCopy = new bool?[C18Q01_TestHelper.ExampleMaze.GetLength(0), C18Q01_TestHelper.ExampleMaze.GetLength(1)];
            Array.Copy(C18Q01_TestHelper.ExampleMaze, mazeCopy, C18Q01_TestHelper.ExampleMaze.Length);

            Q01.PathNode pathNode = reversePath[0];

            while (pathNode != null)
            {
                mazeCopy[pathNode.Node.X, pathNode.Node.Y] = true;
                pathNode = pathNode.Previous;
            }

            System.Console.WriteLine(C18Q01_TestHelper.MazeToString(mazeCopy));
        }