O'Reilly logo

Ruby For Kids For Dummies by Christopher Haupt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Project 2

Big Numbers

When you installed Ruby, a number of tools were placed on your computer. You’ll use many of these tools time and time again as you learn to program. In this project, I show you how you can use a combination of your terminal program and Interactive Ruby to do quick experiments that let you try new things with Ruby.

You’ll start at the very beginning and explore some of the most basic things you might ask a computer to do by exploring numbers, simple math, and storing results in the computer’s memory using variables.

You probably didn’t think Ruby could be used as a calculator for gigantic numbers, did you?

image

Starting Interactive Ruby

This project is completed entirely within your terminal (or console) program and uses Interactive Ruby (known as IRB or irb).

technicalstuff In this book, I refer to the language Ruby with an initial capital letter (as a name) and lowercase ruby to mean the Ruby command. Likewise, I use IRB to mean the name of the program, and irb to mean the command.

To get ready for this project, locate your terminal program (on the Mac) or the console with Ruby shortcut (on Windows). When that’s running, everything else is the same.

remember I use the term terminal ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required