Day 1.1 Exercise 1 – A Good First Program (Not really…)

My work is posted in GitHub.
Here’s the link to the exercise.

Ex01 Code
Code for Ex01.rb
Ex01 Shell
Output of the code.

I forgot to change the directory. Thats why it shows an error on the first 2 lines of my output.

Study Drills

1. Make your script print another line.
    Line 8 of the code is my work.

2. Make your script print only one of the lines.
I didn’t show it in my work, if you would like to try it, just simply put an # (Zed calls it octothorpe) in front of every lines but one.

3. Put a # (octothorpe) character at the beginning of a line. What did it do? Try to find out what this character does.
The octothorpe in ruby is used for commenting, this is helpful is explaining codes for later references.

Advertisements

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