title: How to do a loop to check all the variables at the same time for C#?
body: <p>I want to loop all blueBallPosition[i] and greenBallPosition[i] except blueBallPosition[0] and greenBallPosition[0]. And also, I want to do an if else statement if all the variables except [0], are > 360. Whereas, [0] are &lt; 360. I have tried to do a loop. However, if blueBallPosition[1] > 360 and greenBallPosition[1] > 360, pause will be set to true already. I want to loop through all the variables to make sure they are > 360, then pause set to true.</p>
  
  <pre><code>for (int i = 1; i &lt; levelBall; i++)
  {
      if ((blueBallPosition[0]  &lt; 360) &amp;&amp; 
          (greenBallPosition[0] &lt; 360) &amp;&amp; 
          (blueBallPosition[i]  &gt; 360) &amp;&amp; 
          (greenBallPosition[i] &gt; 360))
              {
                  pause = true;
              }
  }
  </code></pre>
  
  <p>For your information, levelBall is set as 4.</p>
  
  <p>I have solved it. I just have to add a counter to it.</p>
  
  <pre><code>for (int i = 1; i &lt; levelBall; i++)
          {
              if ((blueBallPosition[0] &lt; 360) &amp;&amp; (greenBallPosition[0] &lt; 360) &amp;&amp; (blueBallPosition[i] &gt; 360) &amp;&amp; (greenBallPosition[i] &gt; 360))
              {
                  count++;
              }
          }
  
          if (count == (levelBall))
          {
              pause = true;
          }
          else
          {
              count = 0;
          }
  </code></pre>