Created
April 8, 2014 01:38
-
-
Save radcliff/10081339 to your computer and use it in GitHub Desktop.
A simple ruby program that prints an ASCII art triangle.
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
#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