Example #1
0
        public void DepthFirstSearch_maze_with_exit_Test()
        {
            Maze maze = new Maze(startingPoint.Row, startingPoint.Column, basicMaze);

            string mazeOutput = maze.DepthFirstSearch();

            Assert.That(mazeOutput, Is.EqualTo(depthStringPath + basicMazeDepthSearched));
        }
Example #2
0
        public void GetDepthFirstPathToFollow_on_maze_with_no_exit_returns_empty_stack_Test()
        {
            Maze maze = new Maze(startingPoint.Row, startingPoint.Column, basicMazeNoExit);

            maze.DepthFirstSearch();
            Stack <Point> path = maze.GetPathToFollow();

            Assert.That(path.IsEmpty(), Is.True);
        }
Example #3
0
        static void Main(string[] args)
        {
            Maze test = new Maze("C:\\Users\\jslns\\Desktop\\JasleenDocs\\Bitterms\\term5\\Programming\\Assignment2\\Assignment2\\bin\\Debug\\simpleWithExit.maze");

            Console.WriteLine(test.PrintMaze());
            Console.WriteLine(test.DepthFirstSearch());

            Console.WriteLine();

            Console.ReadKey();
        }
Example #4
0
        public void GetDepthFirstPathToFollow_on_maze_with_exit_returns_ordered_stack_path_Test()
        {
            Maze maze = new Maze(startingPoint.Row, startingPoint.Column, basicMaze);

            maze.DepthFirstSearch();
            Stack <Point> path = maze.GetPathToFollow();

            Assert.That(path.IsEmpty(), Is.False);

            while (!path.IsEmpty())
            {
                Assert.That(path.Pop().ToString(), Is.EqualTo(depthStackPath.Pop().ToString()));
            }
        }
        static void Main(string[] args)
        {
            String simpleWithoutExit = AppDomain.CurrentDomain.BaseDirectory + "simpleWithoutExit.maze";
            String simpleWithExit    = AppDomain.CurrentDomain.BaseDirectory + "simpleWithExit.maze";

            //Maze maze = new Maze(simpleWithoutExit);
            Maze maze = new Maze(simpleWithExit);


            Console.WriteLine("{0}", maze.PrintMaze());
            Console.WriteLine("###########################################");
            Console.WriteLine("{0}", maze.DepthFirstSearch());



            Console.ReadKey();
        }