Lets start out with an simple 16 x 16 array of ints.
How would I insert the 'SomeValue' into the array in a 90 degree clockwise order.
int[] image = new int[16 * 16];
for (int x = 0; x < 16; x++)
{
for (int y = 0; y < 16; y++)
{
int someValue = x * y;
// This is the line I think is wrong
image[x + (y * 16)] = someValue;
}
}
The result should be like the Rotated Array below.
Normal order:
0, 1, 2,
3, 4, 5,
6, 7, 8,Rotated Clockwise:
6, 3, 0,
7, 4, 1,
8, 5, 2,