Skip to content

Instantly share code, notes, and snippets.

@MrBean83
Last active December 20, 2015 10:59
Show Gist options
  • Save MrBean83/6120024 to your computer and use it in GitHub Desktop.
Save MrBean83/6120024 to your computer and use it in GitHub Desktop.
"Print out a times table"
def times_table(rows)
1.upto(rows).each do |line|
1.upto(rows).each do |num|
print "#{line*num} "
end
print "\n"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment