示例#1
0
 public SudokuCell(SudokuCellCollection row, SudokuCellCollection column, SudokuCellCollection box)
 {
     Row    = row;
     Column = column;
     Box    = box;
     Value  = 0;
 }
示例#2
0
        public Sudoku Copy()
        {
            var copy = new Sudoku();

            foreach (SudokuCell cell in Cells)
            {
                SudokuCellCollection row    = copy.Rows.Find(x => x.Index == cell.Row.Index);
                SudokuCellCollection column = copy.Columns.Find(x => x.Index == cell.Column.Index);
                SudokuCellCollection box    = copy.Boxes.Find(x => x.Index == cell.Box.Index);

                var copyCell = copy.Cells.Find(x => x.Row.Index == cell.Row.Index && x.Column.Index == cell.Column.Index);
                copyCell.Value = cell.Value;
            }

            return(copy);
        }