Topic: Noob Program Question
Hey guys, I'm new to Ruby and picked up Chris Pine's book as suggested by you guys. Great book. Need some help. Can some one explain why this program I wrote won't work. It's a suggestion from his book to try. I think I'm messing up with the idea of adding integers and strings.
puts 'Hello, do you want to play a game? What\'s your first name?'
first = gets.chomp
puts 'Your name is ' + first + '? Well that\'s an interesting name.'
puts 'Pleased to meet you ' + first + '.'
puts 'Please, next tell me your favorite number:'
number = gets.chomp
puts 'That\'s not a bad number.'
puts 'I would have chose ' + number.to_i + 1 + '.'
Thanks, any info would be great.
Last edited by IsaiahSonjeow (2009-04-05 13:37:05)