I am programming a Tetris clone and in my game I store my tetromino blocks as 4x4 arrays of blocks. I now need to be able to rotate the integer positions in the arrays so th
If they're a 2D array, you can implement rotation by copying with different array access orders.
i.e., for a clockwise rotation, try:
int [,] newArray = new int[4,4]; for (int i=3;i>=0;--i) { for (int j=0;j<4;++j) { newArray[j,3-i] = array[i,j]; } }
Counter-clockwise is similar.