Beispiel #1
0
        static void Main(string[] args)
        {
#if (!GitPart)
#else
            Puzzle_board test1 = new Puzzle_board(new BFS());
            //test1.SetNumber();
            Puzzle_board test2 = test1.Clone() as Puzzle_board;
            test2.currentAlgoritm = new A_stars();
            test2.ShowResult();
            test1.ShowResult();
            // Console.ReadLine();
            Console.WriteLine("-------------Solve------------------");
            test1.SwitchAlgoritms();
            test2.SwitchAlgoritms();
            test1.GraphConditions();
            test1.ShowResult();
            test1.GetTimeProgram();
            test1.TotalMemoryUse();
            test1.CountSteps();
            Console.WriteLine("-------------Solve------------------");
            test2.GraphConditions();
            test2.ShowResult();
            test2.GetTimeProgram();
            test2.TotalMemoryUse();
            test2.CountSteps();
            Console.WriteLine("End.");
            Console.ReadLine();
#endif
        }
Beispiel #2
0
 private Puzzle_board(Puzzle_board gh)
 {
     this.board = new int[gh.board.GetLength(0), gh.board.GetLength(1)];
     for (int i = 0; i < gh.board.GetLength(0); i++)
     {
         for (int j = 0; j < gh.board.GetLength(1); j++)
         {
             this.board[i, j] = gh.board[i, j];
         }
     }
     this.currentAlgoritm = gh.currentAlgoritm;
     this.stopwat         = new Stopwatch();
 }