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:
Open the RedOrBlue program.
Select File ▸ Save As from the menu to save the program as RedOrBlueCount.
Select Edit ▸ Define Variables from the menu to open the Edit Variables dialog. It should look like this:
Click the Create button.
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.