title: Print 2-D Array in clockwise expanding spiral from center
body: <p>I have an guaranteed to be a <strong>perfect square matrix</strong>. I want to start at the center of the matrix in this case it would be <code>matrix[2][2]</code>, I know how to figure the center <code>(int)(dimensions / 2)</code>. I need to output the contents of the array in this following <strong>outward spiral pattern</strong>. Of course the algorithm should work with any perfect square matrix. I wasn't sure if this algorithm already existed and I didn't want to re-invent the wheel.</p>
  
  <pre><code>int dimensions / 2;
  
  21 22 23 24 25
  20 7  8  9  10
  19 6  1  2  11
  18 5  4  3  12 
  17 16 15 14 13
  </code></pre>
  
  <p>The output for this example should be </p>
  
  <pre><code>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
  </code></pre>