Created
September 27, 2012 03:29
-
-
Save xiaowl/3792013 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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