Skip to content

Instantly share code, notes, and snippets.

@hugopeixoto
Created July 13, 2014 03:24
Show Gist options
  • Save hugopeixoto/d6807fef45cb6d4658ff to your computer and use it in GitHub Desktop.
Save hugopeixoto/d6807fef45cb6d4658ff to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
n = ARGV.shift.to_i
puts((n.times.map do |i|
" "*(n-1-i) + "*"*(1+2*i)
end + (n/2).times.map do
" "*(n/2) + "#"*(n-1+(n%2))
end).join("\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment