Skip to content

Instantly share code, notes, and snippets.

@bensbigolbeard
Created February 3, 2014 23:13
Show Gist options
  • Save bensbigolbeard/8794362 to your computer and use it in GitHub Desktop.
Save bensbigolbeard/8794362 to your computer and use it in GitHub Desktop.
# grab console args
arg = ARGV[0].to_i
# instantiate counters
outer_counter=0; inner_counter = 0; overall_counter = 1
# instantiate row string
row_str = ""
while outer_counter < arg
while inner_counter <= outer_counter
row_str << overall_counter.to_s + " "
overall_counter += 1; inner_counter += 1
end
puts row_str
row_str = ""; inner_counter = 0
outer_counter += 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment