Exercise 1. A Good First Program
You should have spent a good amount of time in Exercise 0 learning how to install a text editor, run the text editor, run Terminal, and work with both of them. If you haven’t done that, then do not go on. You will not have a good time. This is the only time I’ll start an exercise with a warning that you should not skip or get ahead of yourself.
Type the following text into a single file named
ex1.rb. Ruby works best with files ending in
1 puts "Hello World!" 2 puts "Hello Again" 3 puts "I like typing this." 4 puts "This is fun." 5 puts "Yay! Printing." ...