Exemplo n.º 1
0
        public static void Main()
        {
            // We are given a matrix of passable and non-passable cells.
            // Write a recursive program for finding all paths between two cells in the matrix.

            // Modify the above program to check whether a path exists between two cells without finding all possible paths.
            // Test it over an empty 100 x 100 matrix.
            char[,] matrix =
            {
                { ' ', ' ', ' ', '*', ' ', ' ', ' ' },
                { '*', '*', ' ', '*', ' ', '*', ' ' },
                { ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
                { ' ', '*', '*', '*', '*', '*', ' ' },
                { ' ', ' ', ' ', ' ', ' ', ' ', 'e' },
            };

            char[,] matrix1 =
            {
                { ' ', ' ', ' ' },
                { ' ', ' ', ' ' },
                { ' ', ' ', 'e' },
            };

            char[,] matrix2 = new char[100, 100];
            matrix2[99, 99] = 'e';

            var lab = new Labyrinth(matrix2);

            lab.FindPaths(0, 0, 'S');
        }
        public static void Main()
        {
            char[,] matrix =
            {
                { ' ', ' ', ' ', '*', ' ', ' ', ' ' },
                { '*', '*', ' ', '*', ' ', '*', ' ' },
                { ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
                { ' ', '*', '*', '*', '*', '*', ' ' },
                { ' ', ' ', ' ', ' ', ' ', ' ', 'e' },
            };

            char[,] matrix1 =
            {
                { ' ', ' ', ' ' },
                { ' ', ' ', ' ' },
                { ' ', ' ', 'e' },
            };

            char[,] matrix2 = new char[100, 100];
            matrix2[99, 99] = 'e';

            var lab = new Labyrinth(matrix2);

            lab.FindPaths(0, 0, 'S');
        }
Exemplo n.º 3
0
        public static void Main()
        {
            // We are given a matrix of passable and non-passable cells.
            // Write a recursive program for finding all paths between two cells in the matrix.

            // Modify the above program to check whether a path exists between two cells without finding all possible paths.
            // Test it over an empty 100 x 100 matrix.
            char[,] matrix =
               {
                {' ', ' ', ' ', '*', ' ', ' ', ' '},
                {'*', '*', ' ', '*', ' ', '*', ' '},
                {' ', ' ', ' ', ' ', ' ', ' ', ' '},
                {' ', '*', '*', '*', '*', '*', ' '},
                {' ', ' ', ' ', ' ', ' ', ' ', 'e'},
            };

            char[,] matrix1 =
            {
                {' ', ' ', ' '},
                {' ', ' ', ' '},
                {' ', ' ', 'e'},
            };

            char[,] matrix2 = new char[100, 100];
            matrix2[99, 99] = 'e';

            var lab = new Labyrinth(matrix2);
            lab.FindPaths(0, 0, 'S');
        }
        public static void Main()
        {
            var secondMatrix = new char[100, 100];
            secondMatrix[99, 99] = 'e';

            var lab = new Labyrinth(secondMatrix);
            lab.FindPaths(0, 0, 'S');
        }
        public static void Main()
        {
            char[,] matrix =
            {
                { ' ', ' ', ' ', '*', ' ', ' ', ' ' },
                { '*', '*', ' ', '*', ' ', '*', ' ' },
                { ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
                { ' ', '*', '*', '*', '*', '*', ' ' },
                { ' ', ' ', ' ', ' ', ' ', ' ', 'e' },
            };

            var labyrinth = new Labyrinth(matrix);

            labyrinth.FindPaths(0, 0);
        }
Exemplo n.º 6
0
        public static void Main()
        {
            // We are given a matrix of passable and non-passable cells.
            // Write a recursive program for finding all paths between two cells in the matrix.

            char[,] matrix =
               {
                {' ', ' ', ' ', '*', ' ', ' ', ' '},
                {'*', '*', ' ', '*', ' ', '*', ' '},
                {' ', ' ', ' ', ' ', ' ', ' ', ' '},
                {' ', '*', '*', '*', '*', '*', ' '},
                {' ', ' ', ' ', ' ', ' ', ' ', 'e'},
            };

            var lab = new Labyrinth(matrix);
            lab.FindPaths(0, 0);
        }
Exemplo n.º 7
0
        public static void Main()
        {
            // We are given a matrix of passable and non-passable cells.
            // Write a recursive program for finding all paths between two cells in the matrix.

            char[,] matrix =
            {
                { ' ', ' ', ' ', '*', ' ', ' ', ' ' },
                { '*', '*', ' ', '*', ' ', '*', ' ' },
                { ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
                { ' ', '*', '*', '*', '*', '*', ' ' },
                { ' ', ' ', ' ', ' ', ' ', ' ', 'e' },
            };

            var lab = new Labyrinth(matrix);

            lab.FindPaths(0, 0);
        }