示例#1
0
        private static void LoadNewGame()
        {
            Console.WriteLine("Starting of default game: ");
            var board = new Board();

            Console.Write("How much time do you want to shuffle thees desk: ");
            board.Shuffle(IntInputValidator());
            GameOfFifteen.Shuffler(board);
            List <Board> solution = GameOfFifteen.BreadthFirstSearch(board);

            GameOfFifteen.Solver(solution);
            Console.WriteLine($"Your mixed board is ready, it saved here: {_shuffledBoardPath}");
            Console.WriteLine($"Your solving way is ready, it saved here: {_solvedBoardPath}");
            Console.Write("Do you want to implement \"Player\" mode? (y/n): ");
            var choice = StringInputValidator();

            if (!choice)
            {
                Console.WriteLine("Exit game");
                Thread.Sleep(2000);
                Environment.Exit(0);
            }
            Console.Write("What timeout do you prefer?(sec): ");
            _timeOut = GetTimeoutMiliseconds(FloatInputValidator());
            GameOfFifteen.Solver(solution, true, _timeOut);
        }
示例#2
0
        private static void LoadOwnGame()
        {
            var          userBoard    = new Board(File.ReadAllText(_userStartPossition));
            List <Board> userSolution = GameOfFifteen.BreadthFirstSearch(userBoard);

            GameOfFifteen.Shuffler(userBoard);
            GameOfFifteen.Solver(userSolution);
            Console.WriteLine($"Your solving way is ready, it saved here: {_solvedBoardPath}");
            Console.Read();
        }