Knowledge Base

Random in Range Block

output-onlinepngtools__231_.png  This block works for both EV3 Robot and Ruby Robot!  output-onlinepngtools__101_.png

 

You can apply some randomness to your program by adding the random in range block. When used in tandem with a numerical data block, this block will generate a number (decimal) between 0 and the value of the numerical data block. 

Example Program

This program prints a random number between 0 and 10 to the console: 

 

Configuration

Parameter Description Compatible Blocks Range
Random in Range

Generates a random number

 

0 to ∞

 

Was this article helpful?
1 out of 1 found this helpful

Comments

Please sign in to leave a comment.