First step / Daffy Duckyfier


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

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


Any error message?

Did you try after refreshing your browser?


Yes sure,
No error message, just the red cross


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)


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…


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)


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

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


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


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