Exercise 7. More Printing


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!


 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 ...

Get Learn Ruby the Hard Way: A Simple and Idiomatic Introduction to the Imaginative World of Computational Thinking with Code, Third Edition, Video Enhanced Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.