title: League fixture algorithm explanation
body: <p>this works for me but I don't understand how it works at all. Could anyone explain?</p>
  
  <pre><code>for(int round = 0; round &lt; rounds_count; round++)
  {
      for(int match = 0; match &lt; matches_per_round; match++)
      {
          int home = (round + match) % (teams_count - 1);
          int away = (teams_count - 1 - match + round) % (teams_count - 1);
  
          if(match == 0)
              away = teams_count - 1;
  
          matches.push_back(Match(&amp;teams[home], &amp;teams[away], round));
      }
  }
  </code></pre>
  
  <p>What's the trick with modulo?</p>