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