title: Creating a simple jQuery game to predict a winner
body: <p>I am trying to create this game, right now it shows 8 teams and the user has to click on them and selected teams comes to next zone until there is one winner. I have created teams in pair from an array but not able to build a logic to select team which goes to next level. I will share the code written so far.</p>
  
  <p>It’s a coin toss code where it picks between 0 and 1 which determines the winner.</p>
  
  <p>Code - <a href="http://plnkr.co/edit/sTzLPlSbyXPCA0mpWkdC?p=preview" rel="nofollow">http://plnkr.co/edit/sTzLPlSbyXPCA0mpWkdC?p=preview</a></p>
  
  <p>This is the code that I have attempted so far.</p>
  
  <pre><code>$(document).ready(function() {
  
    var btTeams = ['Team A', 'Team B', 'Team C', 'Team D', 'Team E', 'Team F', 'Team G', 'Team H'],
      _html = "";
  
    $.each(btTeams, function(intIndex, objValue) {
  
      if ((intIndex + 1) % 2 !== 0) {
        _html += '&lt;ul class="bt-zone-pair" data-team="team' + intIndex + '"&gt;';
      }
  
      // Add li for all cases
      _html += '&lt;li class="bt-zone"&gt;&lt;a href="javscript:void(0)"&gt;' +
        objValue + "&lt;/a&gt;&lt;/li&gt;";
  
      if ((intIndex + 1) % 2 === 0) {
        _html += "&lt;/ul&gt;"
      }
    });
  
    $('.bt-col1').append(_html);
  
  }); 
  </code></pre>
  
  <p>The greatest difficulty I'm having at the moment is creating a common logic to map teams to next level to choose winner.</p>
  
  <p>Any help or advice is greatly appreciated!!</p>