Ulam spiral

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

output the Ulam's spiral with a given spiral size
http://en.wikipedia.org/wiki/Ulam_spiral

Options

exec is denied

no deadline, the server will not save your submission

Sample input:_

10

Sample output:

*   *       *     *  
         *   * *   * 
  *     *         * *
   *   * *           
          * *     *  
   * *   *       *   
          * *   *    
 *   * *     * * *   
* * * * *   *       *
         * * *       
    *   *  ** * * *  
     * * *           
      *   *          
 *   * *   *   * *   
  *   *     *     * *
       *           * 
  * *     *   *   *  
   *           *     
*     *   * *        
     * *   *     *   
*         * *     *  

Sample input:_

30

Sample output:

        *         * *         *           * *         *     *
     * *           *   *           * *     *   *     *     * 
  *               * *         *                   *     *   *
   *       *     *     *         *       *                   
          *     *   * *   *     *     *       *   * *     *  
                             *   *     *       *         *   
*   *         *   *     *     *       *   * *                
 *   *     * *           *         * *   * *               * 
            * *                 *     *     *               *
 *             *     *     *     *       *         * * * * * 
    * *   *   *             *   *       *   *           *    
                 *     *   * *   *             *   *         
*   * *     *     * *     *   * *                 * * *     *
   *       *     * *                     *     *             
                  * *     *   *           *     *           *
                             *   * *   *             * * *   
*         * *               *   *       *   * *           *  
           *     *   *           * *     *                   
    *     * *   * *     * *     *     *           *          
       *   * *           *           *   *     * *     *     
        *     *     *   *       *     *               *      
       * *     *   *         *   * *   * * *                 
*       * * * *       *     *         * *   *     * *     *  
                 *     *   * *               *     *     *   
                              * *     *   *   * *   * * *   *
 * * *     *   *   *   * *   *       *   * *         *       
                              * *   *                 *      
 *     * *   *       *   * *     * * *     * * *             
  * *     *   * * * * * * * *   *       *         * *        
                             * * *           *           *   
*   *     *             *   *  ** * * *   * * *     *       *
       * *       *       * * *                               
  *                       *   *                              
       * *     *   * *   * *   *   * *   *   * *   *   * *   
  *   *     *     *   *   *     *     * *   *       *     *  
     *                     *           *           *         
*         * *         * *     *   *   *       * *       *    
           * *     *   *           *       *     *         * 
              *     *     *   * *                            
   *                     * *   *     *   *     *   * * *     
    * *       * * * *         * *     *     * *   * *   *    
                 *   *           * *                         
*     *     *   * *     *     *   * *           *     *   * *
 * * * *     * *       *         *       *     *             
        *               * *   * *         *     *            
         *           *   *     *     *         * *     *     
  *       *       * *     *                 *             *  
     *     *   *       *           *   *     *           *   
    * *                                 *     *   *     *    
 * *       *   * *   *     *           *             *     * 
        *                 *     *   * *               *     *
       *     *           *       *               *   *     * 
  * * *       *     *   * *   *       *     *                
     *                 *                       *   *         
          *             *     *   * *     *   *     *        
   * *     *                     *           * *           * 
  *           *         *           * *     *   * *          
   *                           * *         *       *   *   * 
*           *     *       *   *       *                      
           *               *       *   * *   * *             
          * *   *             *     *   *       *         *  

Ranking

Python _

RankUserSizeTimeDateStatistics
1hallvabo1520.46902013/01/28 20:59:340B / 71B / 67B
2g33k1770.35812013/01/28 02:08:184B / ?B / ?B
3rolf1980.80802013/01/30 04:24:300B / 98B / 83B

Lua _

RankUserSizeTimeDateStatistics
1aze3110.11962013/01/28 18:39:020B / ?B / ?B

J _

RankUserSizeTimeDateStatistics
1I., S.440.09412013/01/30 07:41:060B / 10B / 32B

C _

RankUserSizeTimeDateStatistics
1g33k1860.02682013/01/28 01:53:510B / ?B / ?B

Language Ranking_

RankLangUserSizeScore
1JI., S.4410000
2Pythonhallvabo1522894
3Cg33k1862365
4Luaaze3111414

return top