Oops, try again. It looks like you didn't print each word from the user's text to the console


#1

I''m working on the 'Redacted' exercise and although I see al my words returned in console. It keeps after committing the code, saying that not all words are returned.

I've written code in dutch in english etc but still the message keeps coming up

puts "De tekst om te splitsen: "
tekst = gets.chomp (or text = gets.chomp)

puts "Het te bewerken woord: "
bewerkt = gets.chomp (or redact= gets.chomp)

words = tekst.split (" ")
words.each do |word|
if word == bewerkt (or redact)
print "BEWERKT "
else
print "#{word} "
end
end

I also tried to by pass the error message by coping en pasting the initial code, but it keeps giving me the same message. "Oops, try again. It looks like you didn't print each word from the user's text to the console."

Thank you for you help.


#2

There are several issues with your syntax, what you posted won't run at all

Are you sure you posted the right code?

Are those comments in parentheses? If so someone would have to edit your code before running it, right? Ruby, like most programming languages has syntax for comments, if you want to comment code then use that.

It should be possible to execute your code and observe what you describe

If the comments are there to translate, then you may as well translate the code instead to reduce confusion


#3

Hi Jonathan,
Thanks 4 ur reply. I went further with the exercise Redacted and it run on
the last part of the exercise. I read somewhere that it might be a memory
thing.
The code is adjusted so an.English person can read it. So it runs, that is
why you this message (functional) .

Thanks again!
~ Tenice


#4

I can't tell if you're still looking for help or not.
But a thought is that perhaps your translating to dutch might have made it behave differently from what the instructions ask for.


#5

Hi Jonatan,

I had to leave in a hurry so I'm sorry for my gibberish respond to your
question. The problem has been resolved once I moved up to the last, next
part of the exercise. It ran perfectly!

Let 's hope everything goes smoothly from now on..... but next time I'll
send the exact code that has been executed.

Take care & thanks!
~ Tenice


#6

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