Skip to content

Instantly share code, notes, and snippets.

@pahnin
Created September 23, 2013 09:14
Show Gist options
  • Save pahnin/6668220 to your computer and use it in GitHub Desktop.
Save pahnin/6668220 to your computer and use it in GitHub Desktop.
print diamond in ruby, this might not be the best implementation
(-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