title: convert nested loops to recursive
body: <p>i want to create a minimax tree which has 9 depth. I used 9 nested loop and too many        variable. Now i want to convert this loops to recursive. Thank you for answers. This my code.</p>
  
  <pre><code>int a,b,c,d,e,f,g,h;
  for(a=0;a&lt;9;a++) 
  {
    y=y-&gt;branch[a];
    yap(y,8);           
    for(b=0;b&lt;8;b++) 
    {
      y=y-&gt;branch[b];
      yap(y,7);                            
      for(c=0;c&lt;7;c++) 
      {         
        y=y-&gt;branch[c];
        yap(y,6);                 
        for(d=0;d&lt;6;d++) 
        {
          y=y-&gt;branch[d];
          yap(y,5);                        
          for(e=0;e&lt;5;e++) 
          {                 
            y=y-&gt;branch[e];
            yap(y,4);                 
            for(f=0;f&lt;4;f++) 
            {
              y=y-&gt;branch[f];
              yap(y,3);
              for(g=0;g&lt;3;g++) 
              {
                y=y-&gt;branch[g];
                yap(y,2);
                for(h=0;h&lt;2;h++) 
                {
                  y=y-&gt;brancg[h];
                  yap(y,1);         
                }
              }
            }
          }
        }
      }
    }
  }         
  </code></pre>