Skip to content

Instantly share code, notes, and snippets.

@LNA
Created January 26, 2014 18:53
Show Gist options
  • Save LNA/8637469 to your computer and use it in GitHub Desktop.
Save LNA/8637469 to your computer and use it in GitHub Desktop.
Multiplying A Range of Numbers Via Nested Iterations
def test
test_numbers = []
(5).downto(1).each do |number|
(number ..5).each do |range_of_numbers|
product = number * range_of_numbers
test_numbers << product
end
end
test_numbers
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment