Exemple #1
0
        /// <summary>
        /// 스도쿠 보드 (Grid)에 마지막으로 생성된 스도쿠를 채웁니다.
        /// </summary>
        public void RestartSudoku()
        {
            playerActions.Push(new RestartAction(currentSudokuGrid.ToArray()));

            var restartedSudokuGrid = new SudokuRow[9];

            SudokuUtils.CopySudokuGrid(initialSudokuGrid, restartedSudokuGrid);

            UpdateSudokuGridItems(restartedSudokuGrid);
            IsUnvalidCellValueAdded = false;

            InitiallyFilledSudokuCellsCount = SudokuUtils.GetFilledSudokuCellsCount(initialSudokuGrid, false);
        }
Exemple #2
0
        /// <summary>
        /// 스도쿠 보드 (Grid)에 새로운 스도쿠를 채웁니다.
        /// </summary>
        public void GenerateAndPopulateSudoku()
        {
            var newSudokuGrid = sudokuGenerator.GenerateSudoku(SudokuDifficulty);

            initialSudokuGrid = new SudokuRow[9];
            SudokuUtils.CopySudokuGrid(newSudokuGrid, initialSudokuGrid);
            InitiallyFilledSudokuCellsCount = SudokuUtils.GetFilledSudokuCellsCount(initialSudokuGrid, false);

            UpdateSudokuGridItems(newSudokuGrid);
            IsUnvalidCellValueAdded = false;

            playerActions       = new Stack <IPlayerAction>();
            undonePlayerActions = new Stack <IPlayerAction>();
        }