コード例 #1
0
 private SudokuGroup[] GatherColumns()
 {
     SudokuGroup[] columns = new SudokuGroup[9];
     for (int columnIndex = 0; columnIndex < 9; columnIndex++)
     {
         columns[columnIndex] = new SudokuGroup(
             MatrixIterator.AsParallel().Where(cell => cell.Column == columnIndex));
     }
     return(columns);
 }
コード例 #2
0
 private SudokuGroup[] GatherRows()
 {
     SudokuGroup[] rows = new SudokuGroup[9];
     for (int rowIndex = 0; rowIndex < 9; rowIndex++)
     {
         rows[rowIndex] = new SudokuGroup(
             MatrixIterator.AsParallel().Where(cell => cell.Row == rowIndex));
     }
     return(rows);
 }
コード例 #3
0
 private SudokuGroup[,] GatherTiles()
 {
     SudokuGroup[,] tiles = new SudokuGroup[3, 3];
     for (int tileVIndex = 0; tileVIndex < 3; tileVIndex++)
     {
         for (int tileHIndex = 0; tileHIndex < 3; tileHIndex++)
         {
             tiles[tileVIndex, tileHIndex] = new SudokuGroup(
                 MatrixIterator.AsParallel().Where(cell =>
                                                   (cell.Row >= tileVIndex * 3 && cell.Row < (tileVIndex + 1) * 3) &&
                                                   (cell.Column >= tileHIndex * 3 && cell.Column < (tileHIndex + 1) * 3)
                                                   )
                 );
         }
     }
     return(tiles);
 }