title: ASCII art and numbers
body: <p>I'm trying to write code that prints a number input by a user in a right triangle. For example, if <code>8</code> is entered, it should look as below:</p>
  
  <pre><code>*
  **
  * *
  *  *
  *   *
  *    *
  *     *
  ********
  1
  12
  123
  1234
  12345
  123456
  1234567
  123345678
  </code></pre>
  
  <p>I'm trying to get this to work:</p>
  
  <pre><code>puts " Enter a number: "
  number = gets.to_i
  puts "*" * number
  count = 0
  while count &lt; number - 2
    print "*"
    print " " * (number - 2)
    puts "*"
    count += 1
  end
  puts "*" * number
  </code></pre>
  
  <p>The result comes out as a square. This is what I get:</p>
  
  <pre><code>*****
  *   *
  *   *
  *   *
  *****
  </code></pre>
  
  <p>Where am I going wrong?</p>