for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
ret[i, j] = matrix[n – j – 1, i];
}
}

http://stackoverflow.com/questions/42519/how-do-you-rotate-a-two-dimensional-array

Advertisements