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