Created
August 7, 2015 09:56
-
-
Save skout23/32724cebd0bb401c3ba7 to your computer and use it in GitHub Desktop.
quick poc to print out the mario half pyramid
This file contains 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
#!/usr/bin/env ruby | |
# | |
# quick poc to print out the mario half pyramid | |
# | |
# | |
def pymid(base) | |
1.upto(base) do |row| | |
str = "#" * row | |
puts "#{str}#\n".rjust($height + 2) | |
end | |
end | |
$height = ARGV[0].to_i | |
pymid($height) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment