private Board()

in Sudoku/Board.cs [14:33]


    private Board(IReadOnlyList<int[]> boardData)
    {
      _emptyCellsCount = 9 * 9;
      Cells = new Cell[9,9];
      for (var row = 0; row < 9; row++)
      for (var col = 0; col < 9; col++)
        Cell(row, col) = new Cell(boardData[row][col]);

      // update all board with impossible options based on the initial numbers
      for (var row = 0; row < 9; row++)
      for (var col = 0; col < 9; col++)
      {
        var cell = Cell(row, col);
        if (cell.IsFilled) // update other affected by filled
        {
          _emptyCellsCount--;
          UpdateCellsAffectedBy(row, col, cell.Number);
        }
      }
    }