O'Reilly logo

Learn Ruby the Hard Way: A Simple and Idiomatic Introduction to the Imaginative World of Computational Thinking with Code, Third Edition, Video Enhanced Edition by Zed A. Shaw

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exercise 7. More Printing

Image

Now we are going to do a bunch of exercises where you just type code in and make it run. I won’t be explaining this exercise because it is more of the same. The purpose is to build up your chops. See you in a few exercises, and do not skip! Do not paste!

ex7.rb

 1    puts "Mary had a little lamb."  2    puts "Its fleece was white as #{'snow'}."  3    puts "And everywhere that Mary went."  4    puts "." * 10 # what'd that do?  5  6    end1 = "C"  7    end2 = "h"  8    end3 = "e"  9    end4 = "e" 10    end5 = "s" 11    end6 = "e" 12    end7 = "B" 13    end8 = "u" 14    end9 = "r" 15    end10 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required