the RedOrBlueCount program

In this section, I’ll take you through the steps for creating the RedOrBlueCount program from the original RedOrBlue program. You’ll create the two variables and then use them in the program to count the number of red and blue objects.

creating the variables

To create the two variables, follow these steps:

  1. Open the RedOrBlue program.

  2. Select FileSave As from the menu to save the program as RedOrBlueCount.

  3. Select EditDefine Variables from the menu to open the Edit Variables dialog. It should look like this:

    image with no caption
  4. Click the Create button.

  5. Enter the name Total Red, and select Number for the data type. The dialog should look like ...

Get The Art of LEGO MINDSTORMS NXT-G Programming 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.