Skip to content

Instantly share code, notes, and snippets.

@mehagel
Created May 6, 2013 21:20
Show Gist options
  • Save mehagel/5528294 to your computer and use it in GitHub Desktop.
Save mehagel/5528294 to your computer and use it in GitHub Desktop.
def times_table(rows)
(1..(rows)).each do |r|
line = ""
(1..(rows)).each{ |c| line += "#{r * c}\t"}
puts line
end
end
times_table(100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment