title: Loops inside loops
body: <p>I'd like to find easier way to write loops inside loops.<br>
  Here is example code of 3 levels of 'for' loops:</p>
  
  <pre><code>int level = 0;
  int value = 0;
  bool next = false;
  
  for (int i0 = 0; i0 &lt; 6; i0++)
  {
      level = 0;
      value = i0;
      method();
      if (next)
      for (int i1 = 0; i1 &lt; 6; i1++)
          {
              level = 1;
              value = i1;
              method();
              if (next)
              for (int i2 = 0; i2 &lt; 6; i2++)
                  {
                      level = 2;
                      value = i2;
                      method();
                      if (next)
                      {
                          //Do somethnig
                      }   
                  }
          }
  }
  
  
  
  private void method()
      {
          //use int 'level' and 'value'
          //determine bool 'next'
      }
  </code></pre>
  
  <p>I wonder if it's possible to write the same thing different way. To set number of levels(number of loops) and loop repeats. In this case levels = 3; repeats = 6;. I need it because I am using more than 20 loops inside themselves and than the code is not comprehensible.</p>
  
  <p>I hope my explanation was ok and thanks for help.</p>