Learn Ruby the Hard Way – Exercise 26 Congratulations, take a test!

I have made it to the halfway point. Exercise 26, boom!

Here is the fixed code for ex26.rb:

ex26.rb.... Part 1.
ex26.rb…. Part 1.
ex26.rb... Part 2.
ex26.rb… Part 2.

And the output:

output from running ex26.rb
output from running ex26.rb

This was not as difficult as I thought it would be… mostly because it is code I have seen in the past two exercises. Also, Sublime Text is helpful with its colors. One thing I unexpectedly missed was the line with escape sequences. With single quotation marks around the string, the escape sequences did not work (no new lines, no tabs). After fixing it to double quotation marks, we get our new lines and tabs.

I really appreciate error messages… they’re so helpful with the specific error type and lines.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s