Project 3

Bigger Hello World

In this project, you start to work with letters and words. Programmers often use the term character for a single letter and the term string to mean one or more characters connected together to form words or other patterns.

In this project, you again use Interactive Ruby (IRB) to learn how to manipulate strings in Ruby and how strings are different from numbers. You’ll find out that there are some surprising similarities, too, as you build a program to create a big HELLO!

image

Starting Interactive Ruby

This project will be completed entirely within your terminal program using IRB. Follow these steps:

  1. Start your terminal program.
  2. At the prompt, type irb to get Ruby ready for the project.

remember If you aren’t sure how to start your terminal program or IRB, check out the beginning of Project 1.

Knowing How Letters and Words Differ from Numbers

Programming languages keep track of the different kinds of data that you may want to work with in a program. For each type of data, the language will often provide common and unique capabilities for manipulating that data.

In Ruby, numbers are a type of data. As you saw in Project 1, you can do a variety of things with numbers, including performing the common arithmetic operations on them.

Letters, also know as characters, ...

Get Ruby For Kids For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.