Example #1
0
        public void Generate(int value)
        {
            // create maze in this method using depth first search
            //Init(value);
            _maze.MazePen.Dispose();
            _maze.MazePen = _maze.X < 5 ? new Pen(Brushes.WhiteSmoke, 1) : new Pen(Brushes.WhiteSmoke, 3);
            SearchAlgorithm algo = new SearchAlgorithm(_maze);

            algo.DepthFirstSearch();
        }
Example #2
0
        public void Solve()
        {
            _maze.Solving = true;
            // use this method to solve Maze
            _maze.FoundPath.Clear();
            this.unvisitAll();
            SearchAlgorithm algo = new SearchAlgorithm(_maze);

            //algo.BreadthFirstSearch();
            algo.AStarSearch();
            _maze.Solving = false;
        }