the random block

Now that you know how numbers work in NXT-G, you can move on to some of the other math-related blocks, starting with the Random block. This block is found in the Data group on the Complete Palette, as shown in Figure 14-12. Figure 14-13 shows how the block looks in a program.

The Random block on the Complete Palette

Figure 14-12. The Random block on the Complete Palette

The Random block

Figure 14-13. The Random block

A die is used for the picture on the Random block because in many games a die (or two or more dice) is used to generate a random number. Rolling a standard die will give you a ...

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.