Skip to content

Instantly share code, notes, and snippets.

@iamnoobkia
Forked from nextacademy-private/deaf_aunty.rb
Last active April 13, 2016 13:47
Show Gist options
  • Select an option

  • Save iamnoobkia/0cabc080fc0fa166a0b2 to your computer and use it in GitHub Desktop.

Select an option

Save iamnoobkia/0cabc080fc0fa166a0b2 to your computer and use it in GitHub Desktop.

Revisions

  1. iamnoobkia revised this gist Apr 13, 2016. 2 changed files with 22 additions and 17 deletions.
    19 changes: 19 additions & 0 deletions crazy_aunty
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    def crazy_aunty
    puts "Hi Sandra! Say hi to deaf Aunty :)"
    n = 0
    while answer = gets.chomp
    if answer.empty?
    n+=1
    break if n==2
    elsif answer == "I love ya, Aunty, but I've got to go."
    puts "Bye, Sandra!"
    break
    elsif answer == answer.downcase
    puts "HUH?! SPEAK UP, SANDRA"
    else answer == answer.upcase
    puts "NO! WE CANT DO THAT!"
    end
    end
    end

    crazy_aunty
    20 changes: 3 additions & 17 deletions deaf_aunty.rb
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,3 @@
    # Prompt user for sandra_input
    # Loop
    # If input downcase, reply HUH! SPEAK UP, SANDRA!"
    # If input upcase, reply NO, WE CANT DO THAT!
    # Loops end when input == "I love you, aunty, but I've got to go"




    def deaf_aunty
    puts "Hi Sandra! Say hi to deaf Aunty :)"
    sandra_input = gets.chomp
    @@ -16,19 +7,14 @@ def deaf_aunty
    puts "NO, WE CAN'T DO THAT!"
    sandra_input = gets.chomp

    elsif sandra_input == sandra_input.downcase
    else sandra_input == sandra_input.downcase
    puts "HUH?! SPEAK UP, SANDRA"
    sandra_input = gets.chomp

    else
    puts "Bye, Sandra!"
    sandra_input = gets.chomp

    break
    end


    end
    puts "Bye, Sandra!"
    end

    deaf_aunty
    deaf_aunty
  2. iamnoobkia revised this gist Mar 28, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions deaf_aunty.rb
    Original file line number Diff line number Diff line change
    @@ -16,15 +16,15 @@ def deaf_aunty
    puts "NO, WE CAN'T DO THAT!"
    sandra_input = gets.chomp

    elsif sandra_input == sandra_input.downcase
    elsif sandra_input == sandra_input.downcase
    puts "HUH?! SPEAK UP, SANDRA"
    sandra_input = gets.chomp

    else
    else
    puts "Bye, Sandra!"
    sandra_input = gets.chomp

    break
    break
    end


  3. iamnoobkia revised this gist Mar 28, 2016. 1 changed file with 31 additions and 11 deletions.
    42 changes: 31 additions & 11 deletions deaf_aunty.rb
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,34 @@
    # 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.

    # You'll probably want to write other methods, but this
    # encapsulates the core Aunty logic
    # Prompt user for sandra_input
    # Loop
    # If input downcase, reply HUH! SPEAK UP, SANDRA!"
    # If input upcase, reply NO, WE CANT DO THAT!
    # Loops end when input == "I love you, aunty, but I've got to go"




    def deaf_aunty
    puts "Hi Sandra! Say hi to deaf Aunty :)"
    sandra_input = gets.chomp
    while sandra_input != "I love you, aunty, but I've got to go."

    if sandra_input == sandra_input.upcase
    puts "NO, WE CAN'T DO THAT!"
    sandra_input = gets.chomp

    elsif sandra_input == sandra_input.downcase
    puts "HUH?! SPEAK UP, SANDRA"
    sandra_input = gets.chomp

    else
    puts "Bye, Sandra!"
    sandra_input = gets.chomp

    break
    end


    end
    end

    # Run our method
    deaf_aunty
    deaf_aunty
  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