"Dynamic" if statement c++
<p>I want to make a program which can generate football matches depending on the team. The conditions:</p>

<ul>
<li>everyone have to play with everyone </li>
<li>must have to be in rounds.</li>
</ul>

<p>For example: we have 4 team: a,b,c and d.</p>

<p>So an example solution:</p>

<pre><code>Round 1:
a-b
c-d

Round 2:
a-c
b-d

Round 3:
a-d
c-b
</code></pre>

<p>I have function which can generate an array when everyone play with everyone.</p>

<p>For example:</p>

<pre><code>a-b
a-c
a-d
b-c
b-d
c-d
</code></pre>

<p>But I have to sort this for rounds. I sort the function on that way I put the first on in each round:</p>

<pre><code>Round 1:
a-b
x-x

Round 2:
a-c
x-x

Round 3:
a-d
x-x
</code></pre>

<p>I can arrange the missing ones in this case with a simple if statement. I check in each round that the two x can't be a and b. And in this way it can sort. But the problem is when I got at least 3 team in a round.</p>

<pre><code>Round 1:
a-b
x-x
y-y
</code></pre>

<p>I have 3 loop in each other so it could be sort with any team if I had a "dynamic" if statement. </p>

<p>I mean in this way I don't need only check the two x that can't be a and b because I got two y-y which can't be a,b,c and d.</p>

<p>So is there any way to do this if statement dynamical?</p>

<p>Because this:</p>

<pre><code>if (iTR[x][0] != iT[i][0] &amp;&amp; iTR[x][0] != iT[i][1])
</code></pre>

<p>only can't check one place but I need to check always more and more places.</p>

<p>Sorry for write this so complicated but I couldn't write it easier. And thank you in advance!</p>
