Ruby For Kids For Dummies

Ruby For Kids For Dummies

by Christopher Haupt, Brian Walls


View All Available Formats & Editions
Choose Expedited Shipping at checkout for guaranteed delivery by Wednesday, April 15


The fun way to introduce coding with Ruby to kids

If you don't have the chance to take coding classes at school or in camp—or if you just want to learn on your own—Ruby For Kids gears you up to expand your technology skills and learn this popular programming language. Written in a way that's easy to follow—and keeping the super tech-heavy stuff to a minimum—it quickly and easily shows you how to use Ruby to create web and mobile applications with no experience required.

Ruby is considered one of the best and simplest languages to start with when you're learning coding. This fun and friendly guide makes it even easier. Broken down into simple projects designed to appeal to younger programmers, Ruby For Kids gets you up and running with core coding concepts in no time. Before you know it, you'll be tackling hands-on projects, enjoying the support of a vibrant community, and feeling a sense of accomplishment as you complete projects.

  • Navigate the basics of coding with the Ruby language
  • Use Ruby to create your own applications and games
  • Find help from other Ruby users
  • Offers tips for parents and teachers helping kids learn Ruby

So what are you waiting for? Ruby For Kids has everything you need to get in on one of the most popular topics around!

Product Details

ISBN-13: 9781119055907
Publisher: Wiley
Publication date: 02/01/2016
Series: For Kids For Dummies Series
Pages: 352
Product dimensions: 7.40(w) x 9.00(h) x 0.80(d)
Age Range: 10 - 13 Years

About the Author

Christopher Haupt is a computer scientist, game designer, and startup advisor who loves teaching and mentoring kids. Active in his regional school district and community, he supports STEM programs, science fairs, and other opportunities for kids to creatively explore technology.

Table of Contents

Introduction 1

About This Book 2

Foolish Assumptions 4

Icons Used in This Book 4

Beyond the Book 5

Where to Go from Here 5

Part I The Most Basic Building Blocks 7

Project 1 Getting Started with Ruby 9

What Is Programming? 10

Why Ruby? 12

What Tools Do You Need? 12

If you're on Windows 13

If you're on Mac OS X 23

Project 2 Big Numbers 33

Starting Interactive Ruby 34

Entering Numbers 36

Doing Some Basic Math 37

Supersizing the Math with Huge Numbers 38

Adding Memory by Storing Results in Variables 39

Using Variables to Repeat a Calculation 41

Fixing Things When Something Goes Wrong 42

Trying Some Experiments 45

Project 3 Bigger Hello World 47

Starting Interactive Ruby 48

Knowing How Letters and Words Differ from Numbers 48

Doing Math with Words 50

Doing Other Things with Strings 51

Storing Strings in Variables 53

Making Some Big Letters 54

An easy way to combine words 55

An advanced way to combine strings together 56

Creating the letter H 57

Creating letter E 59

Creating the letter L 61

Creating the letter O 62

Combining the letters into a word 63

Trying Some Experiments 67

Part II Programmers Are Lazy! Stop Typing So Much! 69

Project 4 Shapes 71

Organizing a New Project 72

Printing versus Using puts 75

Getting Input with gets 76

Running the Program on the Command Line 77

Creating Code to Draw a Rectangle 80

A first version of the rectangle 81

A reusable rectangle 84

Creating Code to Draw a Triangle 87

Drawing a House Using Your Two Shapes 90

Testing Your Program 92

Trying Some Experiments 93

Project 5 Simple Adventure 95

Organizing a New Project 96

Planning the Project 97

Looking at the Program Skeleton 98

Creating the Main Game Loop 101

Creating the room description and actions 102

Responding to player actions 104

Creating Game Rules Methods 107

Adding methods needed for the move command 108

Adding methods for handling the fighting monster 111

Adding methods for treasure searches 112

Creating Game Helper Methods 114

Trying Some Experiments 116

Project 6 Number Guessing 117

Organizing a New Project 118

Planning the Project 119

Looking at the Program Skeleton 120

Creating Placeholder Classes 124

Creating an empty Game class 125

Creating an empty Player class 125

Adding the missing initialize to the Game class 127

Adding Player Methods 129

Creating player getter methods 129

Creating player setter methods 131

Adding player utility methods 131

Writing the Game Class Code 133

Coding the Game class getters 133

Setting up the round 134

Running the guessing loop 136

Adding the hint code 137

Scoring the round 139

Showing the player the results 139

Trying Some Experiments 140

Part III Working with Lots of Your Own Data 143

Project 7 Short Straw 145

Organizing a New Project 146

Planning the Project 147

Looking at the Program Skeleton 148

Creating Placeholder Classes 151

Creating an empty Game class 151

Creating an empty Player class 153

Creating an empty Straw class 154

Coding the Straw Methods 155

Creating straw getter methods 155

Creating the straw factory method 156

An array primer 158

Coding the Player Methods 159

Creating player getters and setters 159

Creating player helper methods 161

Coding Game Methods 162

Code initialization and the end condition 162

Code user interface methods 163

Coding the main game logic methods 165

Trying Some Experiments 167

Project 8 Code Breaker 169

Organizing a New Project 170

Planning the Project 170

Seeing how the Caesar cipher works 171

Looking at the program skeleton 173

Creating Placeholder Classes 174

The CodeBreaker class 174

The Caesar class 176

Coding CodeBreaker Methods 176

The CodeBreaker run method 176

User interface methods 177

Encryption and decryption methods 182

Coding Caesar Methods 185

Setup methods 185

A hash primer 189

Encryption and decryption methods 190

Trying Some Experiments 193

Project 9 Acey Deucey 195

Organizing a New Project 196

Planning the Project 196

Looking at the Program Skeleton 200

Creating Classes 203

Creating the card class 203

Creating the deck class 206

Creating the player class 208

Creating the Game class 211

Trying Some Experiments 220

Part IV Using Shared Code to Get Graphical 223

Project 10 A-maze-ing 225

Organizing a New Project 226

Planning the Project 227

Looking at the Program Skeleton 230

Creating Placeholder Classes 232

The Game class 233

The Level class 234

The Tile class 237

The Player class 239

Coding Amazing Methods 240

Coding Game Methods 240

Coding Level Methods 243

Coding Tile Methods 248

Coding Player Methods 251

Trying Some Experiments 252

Project 11 Tower 255

Organizing a New Project 256

Planning the Project 257

Looking at the Program Skeleton 258

Creating Placeholder Classes 260

The Game class 261

The Post class 264

The Disc class 266

Coding Post Methods 268

Coding Disc Methods 272

Coding Game Methods 274

Trying Some Experiments 277

Project 12 Game of Life 281

Organizing a New Project 282

Planning the Project 283

Looking at the Program Skeleton 284

Creating Placeholder Classes 286

The Game class 287

The Grid class 289

The Cell class 292

Coding Cell Methods 294

Coding Grid Methods 295

Coding Game Methods 299

Programming the user interface 299

Writing the game rules 300

Adding more seed patterns 304

Trying Some Experiments 305

Index 307

Customer Reviews