Skip to content

Instantly share code, notes, and snippets.

@Githerdone
Created April 21, 2013 00:20
Show Gist options
  • Save Githerdone/5427956 to your computer and use it in GitHub Desktop.
Save Githerdone/5427956 to your computer and use it in GitHub Desktop.
times_table working in command line with output showing correct, but does not get the green light.
def times_table(n)
(1..n).each do |row_num|
line = ""
(1..n).each{ |col_num| line += "#{row_num * col_num}\t"}
puts line
end
end
times_table(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment