You are viewing a single comment's thread. Return to all comments →
Alternatively you can also use Integer#upto
def staircase(n) 1.upto(n) { |i| puts ('#' * i).rjust(n) } end n = gets.to_i
Seems like cookies are disabled on this browser, please enable them to open this website
Staircase
You are viewing a single comment's thread. Return to all comments →
Alternatively you can also use Integer#upto