Hey Guys and Girls,
I have completed the Redacted lesson and I want to go on a do the extra challenges.
I am working on a program that takes multiple separate words to redact.
Below is my code, but when I use it it prints "REDACTED" for all the words I input first.
Why is this?
puts "Give me a quote" text = gets.chomp text.downcase! puts "Take away one word" redact = gets.chomp redact.downcase! puts "Do you want to take away another? Yes or No" ans = gets.chomp ans.downcase! if ans == "yes" puts "Ok, just one more then.." redact2 = gets.chomp redact2.downcase! else print "As you wish" end words = text.split (" ") redacts = [redact, redact2] words.each do |word| if redacts.include? (word) == false print word + " " else print "REDACTED " end end