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
# 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" |
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
[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 |