top of page

Random Block


The random block has been set in numeric mode (above) and in logic mode (below) respectively

The random block is often used for randomising a decision, usually in games whereby accuracy itself is not the key function of the robot’s primary game behaviour. The random block also serves as a replacement for die (plural: dice). As a result, it is rarely seen in any programmes made specifically for competition purposes, due to the element of unpredictability it introduces to any programme.


In numeric mode, the lower boundary is defined as the minimum value for the output whilst the upper boundary is defined as the maximum value for the output. The output itself will be within the of the minimum and maximum value, and the output will always be in the form of integers, no matter whether your lower boundary or upper boundary contains decimals.


In logic mode, the output is either true or false, with a variable defining the probability of a true outcome.


Sample uses of the random block are shown below:


The timer is reset. The first random block determines the speed of motor rotation (10~50) whereas the second random block determines the number of rotations the motors make before coming to a stop

The timer is rest. The random block then issues a true of false output into the input of a switch, thus deciding which faces are to be displayed upon the EV3 for more than or equal to 5 seconds.

For a better understanding of how a random block functions in relation to a game, feel free to try out Alexandre Campos’ RPS-Game (Rock Paper Scissors)



4 views0 comments

Recent Posts

See All

Σχόλια


bottom of page