From: Rob Biedenharn Date: 2008-06-11T02:18:27+09:00 Subject: Re: Random Number Stuff On Jun 10, 2008, at 1:02 PM, David Stanislaus wrote: > David A. Black wrote: >> Hi -- >> >> On Tue, 10 Jun 2008, David Stanislaus wrote: >> >>> Something about wrong identifier. >> >> puts "no not since #{1930 + rand(21)}" >> >> You don't need to assign it to a variable (unless you're going to use >> it again), and hanging an assignment off the end of a puts statement >> won't work anyway -- so you might as well just embed it in the string >> you're printing. > > puts "SPEAK up, Sonny, I can't hear you." > talk = gets.chomp > while command != 'bye' > if talk == talk.upcase > puts 'no not since' 1930 + rand(21) > else > puts 'What? Sonny, speak louder! Like THIS.' > end > end > so how would you fix that? Perhaps you could look closely at what David gave you and then make your code look like that. Then, you can look at the difference in Ruby between strings with ' (single quote, aka apostrophe) and with " (double quote) with regard to #{} interpolation. -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com