Created
December 20, 2014 21:10
-
-
Save egrueter-dev/06110335cf3e3f682868 to your computer and use it in GitHub Desktop.
Deaf Grandma
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
puts "Say Something to Grandma" | |
bye = 0 | |
while bye < 3 | |
reply = gets.chomp | |
if reply == "BYE" | |
bye += 1 | |
elsif reply == reply.upcase #condition, not variable put == | |
puts "No, not since #{rand(1930..1950)}" #string interpolation "#{variable}" #Use .. to do numbers inclusive (... exclusive | |
else | |
puts "What?????" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment