title: Printing asterisks using recursion
body: <p>A method, <code>printStars(j)</code>, is available that returns a string -- a row of <code>j</code> asterisks. I need to write a method that recursively prints a triangle of <code>n</code> rows of asterisks. The first row needs to have one *, the second have two *s, etc. No iterative loops can be used (so no while, do-while, or for).</p>
  
  <p>The code to do it backwards is simple enough:</p>
  
  <pre><code>public void printTriangle(int n) {
      if(n &gt;= 1) {
          printStars(n));
          printTriangle(n - 1);
      }
  }
  </code></pre>
  
  <p>My code thus far for the above but reversed is below. It is incorrect as <code>i</code> is reset to 1 in each loop. I'm just not sure how to go about it. I can only use a one-parameter function.</p>
  
  <pre><code>public void printTriangle(int n) {
      int i = 1;
  
      if(i &lt;= n) {
          printStars(i);
          printTriangle(i + 1);
      }
  }
  </code></pre>