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; }
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) }, }; }