title: Problems calling a recursive function on a multi-dimensional nested array
body: <p>I am trying to split the sub-arrays if there are more than 8. I have tried calling the rps_tournament_winner function on players if it has a flattened length longer than 16 but I get a "stack too deep error". </p>
  
  <p>Do I have to work on the players variable or tournament? I'm looking for a nudge in the right direction; not a complete solution.</p>
  
  <pre><code>def rps_tournament_winner(tournament)
    return rps_game_winner(tournament) if tournament.flatten.length == 4
    players = tournament.flatten(2)  
  
    while players.length &gt; 1
      players = players.each_slice(2).map { |x| rps_game_winner(x) }
    end
  
    players[0]
  end
  </code></pre>