Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions lib/deaf_grandma.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#This script is different than FizzBuzz. It should accept user input from the terminal if done correctly. Run it to see what it does then complete the speak method so that it returns & prints the correct thing.
#This script is different than FizzBuzz. It should accept user input from the terminal if done correctly.
#Run it to see what it does then complete the speak method so that it returns & prints the correct thing.

#CAREFUL! This script will not exit. Do you know why? You may have to close it with `Ctrl-C` (Mac) if you do not insert an `exit` into your speak method.
#CAREFUL! This script will not exit. Do you know why? You may have to close it with `Ctrl-C` (Mac)
#if you do not insert an `exit` into your speak method.

class DeafGrandma

def initialize
@bye_counter = 0
@bye_counter = 0
end

def run!
Expand All @@ -17,11 +19,10 @@ def run!
end
end


def speak(input)

#Implement your code here <<<<<<<<<

input = input.gsub(/[[:punct:]]/, '')
puts (input.scan(/[A-Z]/).length < input.split(' ').join.length) ? "SPEAK UP SONNY!" : "NOT SINCE 1964!"
exit
end

private
Expand All @@ -38,4 +39,4 @@ def get_user_input
end

#Uncomment this next line to run your script but BE SURE to comment it, before you try and run your tests.
#DeafGrandma.new.run!
DeafGrandma.new.run!
12 changes: 9 additions & 3 deletions lib/fizzbuzz.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
class SuperFizzBuzz

def run(input)

#Implement your code here

if (input % 3 != 0) and (input % 5 != 0)
input
elsif (input % 3 == 0) and (input % 5 == 0)
"FizzBuzz"
elsif (input % 3 == 0)
"Fizz"
elsif (input % 5 == 0)
"Buzz"
end
end

end
Expand Down