Skip to content

Instantly share code, notes, and snippets.

@xiaowl
Created September 27, 2012 03:29
Show Gist options
  • Save xiaowl/3792013 to your computer and use it in GitHub Desktop.
Save xiaowl/3792013 to your computer and use it in GitHub Desktop.
input = gets.chomp
continuous_bye = 0
while true:
if input == "BYE":
continuous_bye += 1
else
#reset the count to 0
continuous_bye = 0
end
if continuous_bye == 3
puts "I'LL BE MISSING YOU!"
# break immediately
break
end
if input != input.upcase
puts "HUH?! SPEAK UP, SONNY!"
else
year = rand(2000)
while !(year>=1930 && year<=1950)
year = rand(2000)
end
puts "NO, NOT SINCE " + year.to_s
end
input = gets.chomp
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment