Project 9

Acey Deucey

As you become more comfortable with thinking like an object-oriented programmer, it becomes second nature to break projects down into objects that represent real-world concepts. You can imagine what the objects look like and how they behave. When you combine your ability to program objects with a rich library of built-in features like Ruby’s, you’ll find that you can create some pretty sophisticated projects without as much work as you might have to do in another programming language.

In this project, you’re going to combine a set of custom objects together with heavy use of Ruby’s array class to build a multiplayer card game called Acey Deucey, which requires you to create a number of objects, such as playing cards, a deck, players, and the game rules.


Organizing a New Project

This projects requires that you use Atom to create and edit your program. This time, you’ll store the project’s source code in multiple Ruby files, one for each object’s class. You’ll continue to use the Terminal program to run, test, and play the game.

remember If you haven’t created a development folder already, refer to Project 2 for instructions on how to do that.

  1. Start your Terminal program and enter the development folder:

    $ cd development

  2. Create a new directory for this project: ...

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.