rubilicious

Learn Ruby the Hard Way

by Zed Shaw

Example 0 & 1

Next

Example 0 The Setup

Create a folder/directory and label it learn_ruby_the_hard_way. Put all the examples you create in this file. Name your files ex01.rb, ex02.rb etc.

There are a lot of things that people don't remember were confusing or diffucult when they first started. Don't be afraid to ask questions and google, google, google. DO NOT type the $ sign. This means that you should type whatever follows into your terminal. You run the file by first being in your terminal in the directory where the file you want to run is stored. Then you type in $ ruby ex1.rb

Example 1 A Good 1st Program

This is a great way to get started. #puts is a method that will print a line then return to a new line puts "hello world" puts "hello from jen diamond" #print is a method that prints a line but does not move to a new line print "hello printy" puts 'hello printier' # The octothorpe, pound or hash tag comments out a line # puts "hello again" # puts "i like typing this" # puts 'yay! printing.' # puts "i'd much rather you 'not'." # puts 'i "said" do not touch this.'