A complete beginners question

----- “Martin DeMello” [email protected] wrote:

martin
Agreed Martin. I should have chosen a better way to express that the
code could be done more succinctly while at the same time pointing out
what a more experienced ruby developer would do.

Wes

puts ‘What is your favourite number?’
number = gets.chomp
number = number.to_i # converts the number from String to Integer
number+=1
puts ‘Do you not think’ + number + ‘is a better number?’

On Sat, 2010-05-29 at 03:29 +0900, Ant Walliams wrote:

adds 1 to it. But is is coming back with "rb:3:in ‘+’ can’t convert
fixnum into string’

puts ‘What is your favourite number?’
number = gets.chomp
number+=1
puts ‘Do you not think’ + number + ‘is a better number?’

Any help would be appreciated its doing my head in.

Thanks

Regards
A.K.Karthikeyan,
Prop. Mind As Lab
http://mindaslab.in