Redacted 6/6


#1

My goal is to create multiple user inputs that will be redacted.
I have a code to request several inputs for the user, however I dont know how to assign variables to each input. How do I do this?

  puts "Type a sentence?" #gets original user sentence
    text = gets.chomp
    
    i=0  #Will loop input 100 times unless broken by user
        while
    i<100
    i+=1 
    puts "Pick words from the original sentence. Enter stop when finished."
    redact = gets.chomp  #assign variable to user input
    if
        redact == "stop"  #stops loop when user inputs "stop""
        break
    end
    end
    words=text.split (" ")
    
    words.each do |letter| # In current state will not work bc redact will always == "stop"
    if letter == redact
       print "REDACTED " 
    else
        print (letter + " ")
    end

#2

What exactly are you trying to do?


#3

I struggled with this course. I wrote my code and got the green Congratulations banner, but my program did not do what it was supposed to. Instead of redacting the word I instructed it to redact it just printed out my text in a string without spaces. Next to that it printed the words separately in quotations, separated by commas, inside brackets.

Any suggestions to what I may have done wrong?