This site is a preview of the curriculum for our Summer 2018 bootcamp in Burlington, Vermont. As we continue our preparation, courses and lessons will appear and disappear; we will rename, rearrange, clarify, and obfuscate as needed... Please consider this a work in progress and keep checking in.

Learn to Code with Ruby:



There is a magic array named ARGV.

It contains the command line arguments to the program.

If the user types:

ruby hello.rb Alice Bob

then ARGV contains:

["Alice", "Bob"]


ARGV is a historical name. It means "Argument Vector" and has been around since the early 1970s.

Command-Line Hello

Change hello.rb to contain:

puts "Hello, " + ARGV[0]

and run it a few times, e.g.

ruby hello.rb Alice

LAB: Hello, Everyone!

Change hello.rb to say hello to every one of its command line arguments.

For instance:

ruby hello.rb Alice Bob Charlie
Hello, Alice!
Hello, Bob!
Hello, Charlie!

LAB: Add

Write a program named add.rb that adds all of its command line arguments together.


ruby add.rb 1 2 3

Do you remember how to convert a string to an integer?


comments powered by Disqus