Skip to Content
Ruby For Kids For Dummies
book

Ruby For Kids For Dummies

by Christopher Haupt
January 2016
Beginner
352 pages
5h 16m
English
For Dummies
Content preview from Ruby For Kids For Dummies

Project 4

Shapes

In this project, you’ll begin to use your programmer’s editor to write code and get into the flow of programming, testing, and debugging your software using your terminal program.

You’ll create a simple program that can generate a couple of geometric shapes using ASCII art to draw the outline and fill the shape with a pattern.

You’ll also allow the user of your program to customize the output’s size a bit by learning how to collect simple input from the user.

image

Organizing a New Project

Up until this project, you’ve been using Interactive Ruby (IRB) to write and test your code. The nice thing about IRB is that you can get a feel for what the code is going to do immediately. This works great for small snippets of Ruby, but as you start to create more complicated programs, and as they get longer, IRB isn’t very forgiving if you make typos or want to easily change or save your work.

In this project, you’re going to start using Atom, the programmer’s editor you installed in Project 1 to write and store code in files. You’ll continue to use the terminal program to use a different Ruby command to run and test the code stored in the files you create.

tip Before each project, you’ll want to get organized by keeping all your work for the project together in an easy-to-find ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

The Ruby Workshop

The Ruby Workshop

Akshat Paul, Peter Philips, Dániel Szabó, Cheyne Wallace, Jagdish Narayandasani, Dixit Patel, Pankaj Bagwan
Ruby by Example

Ruby by Example

Kevin C. Baird

Publisher Resources

ISBN: 9781119055907Purchase book