Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def display_stars(count)
- puts "* "*count
- end
- def display_growing_stars(times)
- [*1..times].each { |t| display_stars(t) }
- end
- irb(main):001:0> display_growing_stars(5)
- *
- * *
- * * *
- * * * *
- * * * * *
- => [1, 2, 3, 4, 5]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement