Re:Zed Shaw: The wonderful Rob Sobers did a great job transl...
by grossvogel on Thursday August 04, 2011 @05:15PM
(#2847813)
When I read exercise 4, I thought, "I can't believe Ruby made the same mistake as Javascript!" Glad to learn this particular type of foot shooting is not possible in Ruby.
Re:Zed Shaw: The wonderful Rob Sobers did a great job transl...
by reaganing on Thursday August 04, 2011 @04:54PM
(#2847720)
Thank you, that makes sense.
Yes, this will throw an error in Ruby because of line 1:
>1 cars = 100
Ruby does not allow the mixing of integers and strings. So, as mentioned, you can invoke the .to_s method. Or you can interpolate the variables as you have done so with #{cars} inside double quotes.