Created
September 23, 2013 09:14
-
-
Save pahnin/6668220 to your computer and use it in GitHub Desktop.
print diamond in ruby, this might not be the best implementation
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
(-2..2).each do |k| | |
k.abs.times do | |
print " " | |
end | |
(3-(k.abs)).times do | |
print "* " | |
end | |
puts "\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment