A number randomizer.

Random

Inputs:

  • Min: The minimum amount the block chooses from.
  • Max: The maximum amount the block chooses from.

Outputs:

  • Random: The randomly selected number.

Notes

  • The Min input is included while the Max input is excluded, meaning: if the min and max inputs are 0 and 5 respectively, it may generate a number within 0 to 5, possibly 0, but never 5.
  • The random block will generate a new value every time it is executed. To reuse the same random value, it should be stored in a variable.
  • Note that the output would be in decimal, to avoid this use floor, ceiling, or round operators.
  • The random block behaves inconsistently when used with wire splits.

Examples

Either generate -1 or 1: