First step / Daffy Duckyfier


#1

https://www.codecademy.com/en/courses/learn-ruby/lessons/thith-meanth-war/exercises/what-youll-be-building-1?action=lesson_resume&link_content_target=interstitial_lesson

Hi, I get stuck on the very first step of Thith Meanth War, where I’m only asked to click on RUN but then I have the red crossed ticked in the instruction section without the possibility to move forward. I can see there was the same problem reported by someone else a week ago. I checked the forum and you just said to add “goose/goothe” to the code lines. Which I did. Still getting the red cross. Can someone help me please ?
Many thanks

print "Thtring, pleathe!: goose"
user_input = gets.chomp
user_input.downcase!

if user_input.include? "s"
  user_input.gsub!(/s/, "th")
else
  puts "Nothing to do here!"
end
  
puts "Your string is: goothe". 


#2

Any error message?

Did you try after refreshing your browser?


#3

Yes sure,
No error message, just the red cross


#4

on the final line:

puts "Your string is: goothe". 

you need to show the value of user_input variable, what is if the user enters duck into the gets.chomp prompt? It still shows goothe

duck is just an example, it can be anything, which is why you need to display value of user_input variable (you don’t know what users using your program will enter)


#5

yes, when I replace all “user_input” values by “duck” for example, it works. thanks for the help, but difficult to guess that from the beggining…


#6

that is exactly the wrong way around, we want to prompt the user for input (using gets.chomp), and then display the value they inputted!

but i don’t understand, the code in this exercise should have been given, nothing should have been changed? Press get help in the bottom, and press reset this exercise, it should give you the right code (given this exercise shows what you are going to build)


#7

Actually, I think the exercice is full of bugs. That’s why I wrote you the first time, all I needed to do was to press run without changing anything as the code was written. Didn’t work. Now I get bugs in all following questions, I’m pretty sure to put the right code lines, but get the red cross without justification.
For instance, q3 “downcase!” I enter the following code:

print "make a cake"
user_input = gets.chomp
user_input.downcase!

and apparently it’s not good. Can’t see what I’m doing wrong


#8

can you show a screenshot of the entire exercise? (your code, instructions and output)


#9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.