Skip to content

Instantly share code, notes, and snippets.

@Olgaliber
Last active May 25, 2016 02:12
Show Gist options
  • Save Olgaliber/3055ade799e151a6c72b3f694d920a13 to your computer and use it in GitHub Desktop.
Save Olgaliber/3055ade799e151a6c72b3f694d920a13 to your computer and use it in GitHub Desktop.
# shakil_the_dog.rb
def shakil_the_dog
puts "give shakil a command"
user_input = gets.chomp
case user_input.downcase
when "woof"
puts "WOOF WOOF WOOF"
when "shakil stop", "shakil stop!"
puts "yey! no more barking!"
when "meow"
puts "woof woof woof woof woof"
when "treat"
puts "shakil is quiet because he is thinks he's getting a treat"
when "go away"
exit
else
puts "this not a command!"
end
end
while true
shakil_the_dog
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment