title: Recursive string modification in Ruby
body: <p>I have a string. I need to make every other line reversed. If count is 2, it should display:</p>
  
  <pre><code>"Hola mi amigo \nogima im aloH"
  </code></pre>
  
  <p>If count is 3, it should display:</p>
  
  <pre><code>"Hola mi amigo \nogima im aloH \nHola mi amigo"
  </code></pre>
  
  <p>and so on. What is the shortest way to perform string modification between every other <code>"\n"</code>? </p>
  
  <p>My hunch is to use regex. In addition to regex solution, is there any non-regex solution? I would like to see both for comparison.</p>
  
  <pre><code>def hola(count) 
    if COUNT IS LESS THAN 2
      return false
    elsif ODD
      (("Hola mi amigo ")*((count-1)/2) + "\n") * count 
    elsif EVEN
      (("Hola mi amigo ")*(count/2) + "\n") * count 
    end 
  end
  </code></pre>