title: print matrix in spiral order recursively
body: <p>All the answers I find are proposing iterative solutions. Is there a recursive way of solving this problem? I have an attempt that seems quite close but is not quite correct yet.</p>
  
  <p>Suppose I have this matrix:</p>
  
  <pre><code>matrix = [
      ["H", "E", "L", "L"], 
      ["N", "I", "E", "I"], 
      ["O", "G", "R", "F"], 
      ["T", "S", "A", "E"]
      ]
  </code></pre>
  
  <p>My function should print...</p>
  
  <pre><code> HELLIFEASTTONIERG
  </code></pre>
  
  <p>This is my code...</p>
  
  <pre><code>def spiral(matrix, i, j):
  
      if i &lt; 0  or j &lt; 0 or i &gt;= len(matrix) or j &gt;= len(matrix) or matrix[i][j] == False:
          return False
  
      print(matrix[i][j])
      matrix[i][j] = False
  
      if j &lt; len(matrix) and j &gt;= i:
          spiral(matrix, i, j+1)
  
      if i &lt; len(matrix) and i &lt;= j:
          spiral(matrix, i+1, j)
  
      if j &gt;= 0 and j &lt;= i:
          spiral(matrix, i , j-1)
  
      if i &gt;= 0 and i &gt;= j:   
          spiral(matrix, i-1, j)
  
  spiral(matrix, 0, 0)
  </code></pre>
  
  <p>It prints somewhat spirally...</p>
  
  <pre><code>HELLIFEASTONGIER
  </code></pre>
  
  <p>but it is incorrect. Is it possible to alter my function somehow to get the right output because I feel as if I'm close. Or is there any other recursive solution?</p>