Created
September 5, 2012 04:35
-
-
Save MelanieS/3630535 to your computer and use it in GitHub Desktop.
Counter
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
puts "Pick a number 1-50" | |
number = gets | |
if number.include? "." | |
puts "I'm getting rid of that decimal. That was a dumb move." | |
end | |
number = number.chomp.to_i | |
while number < 1 || number > 50 | |
puts "I said 1-50, idiot! Try again!" | |
number = gets | |
if number.include? "." | |
puts "I'm getting rid of that decimal. That was a dumb move." | |
end | |
number = number.chomp.to_i | |
end | |
number = number + 1 | |
mark = "*" | |
count = 0 | |
while count != number | |
print mark * count | |
puts | |
count = count + 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment