Skip to content

Instantly share code, notes, and snippets.

@sanakm
Created March 1, 2016 22:15
Show Gist options
  • Save sanakm/24023fb2594f51c179bb to your computer and use it in GitHub Desktop.
Save sanakm/24023fb2594f51c179bb to your computer and use it in GitHub Desktop.
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