Skip to content

Instantly share code, notes, and snippets.

@Beyarz
Forked from ph3nx/multiplication_table.rb
Last active June 27, 2019 17:11
Show Gist options
  • Save Beyarz/b6ec3d8cad850c4b4422db7ce4eed98b to your computer and use it in GitHub Desktop.
Save Beyarz/b6ec3d8cad850c4b4422db7ce4eed98b to your computer and use it in GitHub Desktop.
Ruby program that prints a multiplication table (12 x 12 field).
# frozen_string_literal: true
range = 1.upto(12)
range.each do |item|
range.map { |element| print "#{item * element} " } && puts
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment