Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 12 additions & 1 deletion lib/deaf_grandma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ def run!

def speak(input)

#Implement your code here <<<<<<<<<
if input == "BYE" && @bye_counter == 2
@bye_counter = 0
return "SEE YOU LATER SONNY!"
elsif input == input.upcase
if input == "BYE"
@bye_counter += 1
end
return "NOT SINCE 1964!"
else
return "SPEAK UP SONNY!"
end


end

Expand Down
15 changes: 14 additions & 1 deletion lib/fizzbuzz.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@ class SuperFizzBuzz

def run(input)

#Implement your code here
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the cleanest solution but it works

text = ""
if input % 3 == 0
text << "Fizz"
end

if input % 5 == 0
text << "Buzz"
end

if text == ""
return input
else
return text
end

end

Expand Down
6 changes: 4 additions & 2 deletions spec/deaf_grandma_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
end

it "says 'NOT SINCE 1964!' when we yell" do
#implement your test here
expect(script.speak("HI, GRANDMA")).to eq "NOT SINCE 1964!"
end

it "EXTRA CREDIT: How would you test yelling BYE?" do
#implement your test here
expect(script.speak("BYE")).to eq "NOT SINCE 1964!"
expect(script.speak("BYE")).to eq "NOT SINCE 1964!"
expect(script.speak("BYE")).to eq "SEE YOU LATER SONNY!"
end
end
6 changes: 3 additions & 3 deletions spec/fizzbuzz_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
end

it "returns 'Buzz' when my input is divisible by 5" do
#implement your test here
expect(script.run(5)).to eq "Buzz"
end

it "returns 'FizzBuzz' when input is divisible by 3 & 5" do
#implement your test here
expect(script.run(15)).to eq "FizzBuzz"
end

it "returns the input number when input isn't divisible by 3, 5, or both" do
#implement your test here
expect(script.run(1)).to eq 1
end
end