From: "David A. Black" Date: 2008-06-10T15:52:23+09:00 Subject: Re: Random Number Stuff Hi -- On Tue, 10 Jun 2008, David Stanislaus wrote: > > puts "SPEAK up, Sonny, I can't hear you." > talk = gets.chomp > while command != 'bye' > if talk == talk.upcase > puts 'no not since' x = 1930 + rand(21) > else > puts 'What? Sonny, speak louder! Like THIS.' > end > end > > > 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. David -- Rails training from David A. Black and Ruby Power and Light: INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin ADVANCING WITH RAILS July 21-24 Edison, NJ See http://www.rubypal.com for details and updates!