Skip to content

Instantly share code, notes, and snippets.

@Leejojo
Created June 21, 2016 21:38
Show Gist options
  • Save Leejojo/7dc7762eb3b9006db2de9a6cad99060f to your computer and use it in GitHub Desktop.
Save Leejojo/7dc7762eb3b9006db2de9a6cad99060f to your computer and use it in GitHub Desktop.
Shakil the Dog
x = 1
loop do
puts "What would you like to say to Shakil?"
say = gets.chomp.downcase
x = say.length
#If you pretend to be a dog and bark ("woof") at him, he will go a bit nuts and woof back at you three times, pretty loudly: "WOOF WOOF WOOF"
if say == "woof"
puts "WOOF WOOF WOOF"
# #If you explicitly use his name and tell him to stop (either "shakil stop" or "Shakil STOP!") he will not respond back with a bark (enjoy your moment of peace)
elsif say == "shakil stop"
puts ""
#If you pretend to be a cat and "meow" at him, he will go berserk and woof back at you five times: "woof woof woof woof woof"
elsif say == "meow"
puts "woof woof woof woof woof"
#If you say anything else but with the word "treat" thrown into the mix, he won’t bark back, thinking he’ll be getting a treat
elsif say.include? "treat"
puts ""
#If you say anything to him, he will just bark back once ("woof")
elsif say == "go away"
break
else puts "woof"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment