Skip to content

Instantly share code, notes, and snippets.

# 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"
[1] pry(main)> my_array = [5, 3, 7, 2]
=> [5, 3, 7, 2]
[2] pry(main)> my_array.sort
=> [2, 3, 5, 7]
[3] pry(main)> an_array = ['Hello', 'nurse', 'and','world']
=> ["Hello", "nurse", "and", "world"]
[4] pry(main)> an_array.each { |word| puts word}
Hello
nurse
and