LEGO Engineering

| | | | | | | |
What is the NXT-G Random block for?


20th of April, 2010

(10 )
70% thumbs up 30% thumbs down

The 'Random' block (located under the 'Data' section in the 'complete palette' tab on the left side of the screen) is used to generate a random number between the range specified in its properties. You can use the slider to adjust between 0 and 100 or simply type in the range into the input boxes if different ranges are needed.  

As an example of one use of this feature, the 'Random' block can be used to display a random number on the screen. This program is shown in the attached program, random.rbt. This could be used as a type of die in a game, or numbers can be assigned to events to demonstrate probability.

You can also use this block to make the robot move for random durations of time or have the robot ask math questions to interact with its users.
   :
   :
* :
* :
 


Home | About Us | Contact Us

© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.