Spiral Number pattern in java
<p>I need to create these patterns in java according to how-many  numbers the user enters:
like this if user enters 3:</p>

<pre><code>1  2  3   ------------&gt;
8  9  4   |-------&gt;   |
7  6  5   &lt;-----------|
</code></pre>

<p>if user enters 4:</p>

<pre><code> 1   2   3  4
12  13  14  5
11  16  15  6
10   9   8  7 
</code></pre>

<p>if user enters 5:</p>

<pre><code> 1   2   3   4  5
16  17  18  19  6
15  24  25  20  7
14  23  22  21  8
13  12  11  10  9
</code></pre>

<p>and so on..</p>
