Created
March 1, 2016 22:15
-
-
Save sanakm/24023fb2594f51c179bb to your computer and use it in GitHub Desktop.
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
def shakil_the_dog | |
speaking = true | |
while (speaking) | |
puts "What do you want to say to the dog?" | |
say = gets.chomp | |
case say | |
when "woof" | |
puts "WOOF, WOOF, WOOF" | |
when "Shakil stop", "Shakil STOP!" | |
puts "..." | |
when "meow" | |
puts "woof, woof, woof, woof, woof" | |
when /treats/ | |
puts "*waiting for my treat*" | |
when "go away" | |
speaking = false | |
else | |
puts "woof" | |
end | |
end | |
end | |
shakil_the_dog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment