コード例 #1
0
ファイル: CGrid.cs プロジェクト: HowardRoark96/Sudoku
        private void SwapCells(int row1, int column1, int row2, int column2)
        {
            //Cells[row1, column1] = Cells[row1, column1] ^ Cells[row2, column2];
            //Cells[row2, column2] = Cells[row1, column1] ^ Cells[row2, column2];
            //Cells[row1, column1] = Cells[row1, column1] ^ Cells[row2, column2];

            CCell temp_cell = Cells[row1, column1];

            Cells[row1, column1] = Cells[row2, column2];
            Cells[row2, column2] = temp_cell;
        }
コード例 #2
0
 public CGridClassic()
 {
     Cells = new CCell[, ]
     {
         { new CCell(1), new CCell(2), new CCell(3), new CCell(4), new CCell(5), new CCell(6), new CCell(7), new CCell(8), new CCell(9) },
         { new CCell(4), new CCell(5), new CCell(6), new CCell(7), new CCell(8), new CCell(9), new CCell(1), new CCell(2), new CCell(3) },
         { new CCell(7), new CCell(8), new CCell(9), new CCell(1), new CCell(2), new CCell(3), new CCell(4), new CCell(5), new CCell(6) },
         { new CCell(2), new CCell(3), new CCell(4), new CCell(5), new CCell(6), new CCell(7), new CCell(8), new CCell(9), new CCell(1) },
         { new CCell(5), new CCell(6), new CCell(7), new CCell(8), new CCell(9), new CCell(1), new CCell(2), new CCell(3), new CCell(4) },
         { new CCell(8), new CCell(9), new CCell(1), new CCell(2), new CCell(3), new CCell(4), new CCell(5), new CCell(6), new CCell(7) },
         { new CCell(3), new CCell(4), new CCell(5), new CCell(6), new CCell(7), new CCell(8), new CCell(9), new CCell(1), new CCell(2) },
         { new CCell(6), new CCell(7), new CCell(8), new CCell(9), new CCell(1), new CCell(2), new CCell(3), new CCell(4), new CCell(5) },
         { new CCell(9), new CCell(1), new CCell(2), new CCell(3), new CCell(4), new CCell(5), new CCell(6), new CCell(7), new CCell(8) },
     };
 }