Skip to content

Instantly share code, notes, and snippets.

@MelanieS
Created September 5, 2012 04:35
Show Gist options
  • Save MelanieS/3630535 to your computer and use it in GitHub Desktop.
Save MelanieS/3630535 to your computer and use it in GitHub Desktop.
Counter
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