title: Implementing Rock, Paper, Scissors tournament in Ruby
body: <p>I'm new to Ruby and am trying to implement a rock-paper-scissors tournament using the language, as an exercise.</p>
  
  <p>The rps_game_winner method that's called within the code below returns the winner in a pair of competitors.</p>
  
  <p>Here is my attempt so far:</p>
  
  <pre><code>def rps_tournament_winner(tournament)
    qualifying_round_winners = []
    for i in 0..0
    tournament.each_with_index do |x, xi|
      x.each_with_index do |y, yi|
        winner = rps_game_winner(y)
        qualifying_round_winners.push(winner) 
        qualifying_round_winners = qualifying_round_winners.each_slice(2).to_a
      end
    end
    tournament = qualifying_round_winners.each_slice(2).to_a
    end
    return tournament 
  end
  </code></pre>
  
  <p>This is the input I provide:</p>
  
  <pre><code>puts rps_tournament_winner([
   [
     [ ["Armando", "P"], ["David", "S"] ],
     [ ["Richard", "R"],  ["Michael", "S"] ]
   ]
  
  ])
  </code></pre>
  
  <p>The output I get is:</p>
  
  <pre><code>David
  S
  Richard
  R
  </code></pre>
  
  <p>This is where I get stuck. I'm unable to get these two compete against each other, and declare the final winner.</p>
  
  <p>As you can see in the code above, the terminating condition of the for loop needs attention.</p>
  
  <p>Any help? </p>