Skip to content

Instantly share code, notes, and snippets.

@sidazhang
Created February 21, 2013 10:45
Show Gist options
  • Save sidazhang/5003856 to your computer and use it in GitHub Desktop.
Save sidazhang/5003856 to your computer and use it in GitHub Desktop.
print out a triangle
def print_triangle(rows)
rows.times do |i|
puts "*"*(i+1)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment