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:
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)
This work is licensed under a Creative Commons Attribution-Non Commercial 4.0 International License.
Σχόλια