src/Kingdom.OrTools.Samples.Sudoku/Extensions/SudokuExtensionMethods.cs
/// <summary>
/// Returns a Sudoku SudokuPuzzle based on the <paramref name="values"/>. Values are
/// treated in row major manner. Each value is validated first and foremost.
/// </summary>
/// <param name="values"></param>
/// <returns></returns>
Returns a Sudoku SudokuPuzzle based on the . Values are
treated in row major manner. Each value is validated first and foremost.
Returns a Sudoku SudokuPuzzle based on the . Values are treated in row major manner . Each value is validated first and foremost .
public static SudokuPuzzle ToSudokuPuzzle(this int[] values)
        {
            foreach (var value in values)
            {
                value.VerifyValue();
            }
            var result = new SudokuPuzzle();
            for (var row = MinimumValue; row < MaximumValue; row++)
            {
                for (var column = MinimumValue; column < MaximumValue; column++)
                {
                    result[new Address(row, column)] = values[row * MaximumValue + column];
                }
            }
            return result;
        }
public static SudokuPuzzle ToSudokuPuzzle ( this int [ ] values ) { foreach ( var value in values ) { value . VerifyValue ( ) ; } var result = new SudokuPuzzle ( ) ; for ( var row = MinimumValue ; row < MaximumValue ; row ++ ) { for ( var column = MinimumValue ; column < MaximumValue ; column ++ ) { result [ new Address ( row , column ) ] = values [ row * MaximumValue + column ] ; } } return result ; }
Returns a Sudoku SudokuPuzzle based on the .
Returns a Sudoku SudokuPuzzle based on the .
None
int[]
this
values
None