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 that I get a rotated tetris block. I cannot simply rotate the texture because all my collision detection, etc has been designed to work with the 2D array. The game is written in C# using XNA.
How can i possibly rotate my 2D array of ints by 90 degrees clockwise/counter clockwise.
Here is how my 'L' block is stored as an example.
0 1 0 0
0 1 0 0
0 1 1 0
0 0 0 0
Thanks for your help.