Last active
December 20, 2015 10:59
-
-
Save MrBean83/6120024 to your computer and use it in GitHub Desktop.
"Print out a times table"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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