Skip to content

Instantly share code, notes, and snippets.

@radcliff
Created April 8, 2014 01:38
Show Gist options
  • Save radcliff/10081339 to your computer and use it in GitHub Desktop.
Save radcliff/10081339 to your computer and use it in GitHub Desktop.
A simple ruby program that prints an ASCII art triangle.
#Simple ASCII Art
puts "What character do you want to make the pyramid out of?"
character = gets.chomp
puts "How many rows of #{character}'s do you want?"
row_count = gets.chomp.to_i
character_count = 1
width = 100
row_count.times do
puts (character * character_count).center(width)
character_count += 2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment