Beispiel #1
0
        /// <summary>
        /// Modify a cell, returning true if the cell's value was changed.
        /// Updates known conflicts and jump forward if the cell had none.
        /// </summary>
        /// <param name="value">new value for the cell</param>
        /// <returns>true if the cell's value was changed, false otherwise</returns>
        public void ModifyCell(int value)
        {
            // Value changed, don't check conflicts when value=0.
            if (activeCell.SetValue(value))
            {
                // Find and add new conflicts.
                CheckConflicts();

                // Check validity to jump forward.
                if (activeCell.IsValid)
                {
                    Shift(Direction.JumpForward);
                }
            }
        }
        public void loadGrid(GameGrid grid, int row, int column, int value)
        {
            SudokuCell sCell = (SudokuCell)grid.Cells[row, column];

            sCell.SetValue(value);
        }