Skip to content

Instantly share code, notes, and snippets.

@andrewclk
Forked from nextacademy-private/deaf_aunty.rb
Last active November 30, 2015 21:20
Show Gist options
  • Select an option

  • Save andrewclk/5ce27d54ddf3671189eb to your computer and use it in GitHub Desktop.

Select an option

Save andrewclk/5ce27d54ddf3671189eb to your computer and use it in GitHub Desktop.

Revisions

  1. andrewclk revised this gist Nov 30, 2015. 1 changed file with 9 additions and 11 deletions.
    20 changes: 9 additions & 11 deletions deaf_aunty.rb
    Original file line number Diff line number Diff line change
    @@ -4,27 +4,25 @@ def speak
    deaf_aunty(user_input)
    end
    def deaf_aunty(input)
    if input == input.upcase then
    if input == input.downcase
    puts "HUH?! SPEAK UP, SANDRA!"
    speak

    elsif input == input.upcase then
    puts "NO, WE CAN'T DO THAT!"
    puts "SAY YOU LOVE ME POLITELY IF YOU WANT TO LEAVE!"
    puts "Maybe like - I love ya, aunty, but I've got to go."
    speak
    elsif input == input.downcase then
    puts "HUH?! SPEAK UP, SANDRA!"
    speak
    end

    until input == "I love ya, aunty, but I've got to go." || " "
    elsif input == "I love ya." || input = 2.times{"\n"}
    puts "Thank you Sandra, you may go now. :)"

    else
    puts "HUH?! SPEAK UP, SANDRA!"
    speak
    end

    end
    puts "Hello, Sandra, anything you want?"
    user_input = gets.chomp

    deaf_aunty(user_input)




  2. andrewclk revised this gist Nov 30, 2015. 1 changed file with 13 additions and 9 deletions.
    22 changes: 13 additions & 9 deletions deaf_aunty.rb
    Original file line number Diff line number Diff line change
    @@ -3,24 +3,28 @@ def speak
    user_input = gets.chomp
    deaf_aunty(user_input)
    end

    def deaf_aunty(input)
    if input == input.downcase
    puts "HUH?! SPEAK UP, SANDRA!"
    puts "YOU NEED SHOUT IT OUT, I COULDN'T HEAR YOU!"
    speak
    end
    if input == input.upcase
    if input == input.upcase then
    puts "NO, WE CAN'T DO THAT!"
    puts "SAY YOU LOVE ME POLITELY IF YOU WANT TO LEAVE!"
    puts "Maybe like - I love ya, aunty, but I've got to go."
    speak
    elsif input == input.downcase then
    puts "HUH?! SPEAK UP, SANDRA!"
    speak
    end
    if input == "I love ya, aunty, but I've got to go."
    puts "Thank you Sandra, you may go now. :)"

    until input == "I love ya, aunty, but I've got to go." || " "
    puts "Thank you Sandra, you may go now. :)"

    end

    end
    puts "Hello, Sandra, anything you want?"
    user_input = gets.chomp

    deaf_aunty(user_input)




  3. andrewclk revised this gist Nov 30, 2015. 1 changed file with 23 additions and 11 deletions.
    34 changes: 23 additions & 11 deletions deaf_aunty.rb
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,26 @@
    # Save this file to your computer so you can run it
    # via the command line (Terminal) like so:
    # $ ruby deaf_aunty.rb
    #
    # Your method should wait for user input, which corresponds
    # to you saying something to your Aunty.
    def speak
    puts"NOW TRY AGAIN!"
    user_input = gets.chomp
    deaf_aunty(user_input)
    end

    # You'll probably want to write other methods, but this
    # encapsulates the core Aunty logic
    def deaf_aunty
    def deaf_aunty(input)
    if input == input.downcase
    puts "HUH?! SPEAK UP, SANDRA!"
    puts "YOU NEED SHOUT IT OUT, I COULDN'T HEAR YOU!"
    speak
    end
    if input == input.upcase
    puts "NO, WE CAN'T DO THAT!"
    puts "SAY YOU LOVE ME POLITELY IF YOU WANT TO LEAVE!"
    puts "Maybe like - I love ya, aunty, but I've got to go."
    speak
    end
    if input == "I love ya, aunty, but I've got to go."
    puts "Thank you Sandra, you may go now. :)"
    end
    end
    puts "Hello, Sandra, anything you want?"
    user_input = gets.chomp

    # Run our method
    deaf_aunty
    deaf_aunty(user_input)
  4. code-division renamed this gist Sep 22, 2014. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions deaf_grandma.rb → deaf_aunty.rb
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    # Save this file to your computer so you can run it
    # via the command line (Terminal) like so:
    # $ ruby deaf_grandma.rb
    # $ ruby deaf_aunty.rb
    #
    # Your method should wait for user input, which corresponds
    # to you saying something to your Grandma.
    # to you saying something to your Aunty.

    # You'll probably want to write other methods, but this
    # encapsulates the core Grandma logic
    def deaf_grandma
    # encapsulates the core Aunty logic
    def deaf_aunty
    end

    # Run our method
    deaf_grandma
    deaf_aunty
  5. code-division created this gist Aug 31, 2014.
    14 changes: 14 additions & 0 deletions deaf_grandma.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    # Save this file to your computer so you can run it
    # via the command line (Terminal) like so:
    # $ ruby deaf_grandma.rb
    #
    # Your method should wait for user input, which corresponds
    # to you saying something to your Grandma.

    # You'll probably want to write other methods, but this
    # encapsulates the core Grandma logic
    def deaf_grandma
    end

    # Run our method
    deaf_grandma