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 not stop selecting numbers unless you wire a Play Sensor block.
  • Note that the output would be in decimal, to avoid this use floor, ceiling, or round operators.

Examples

Either generate -1 or 1: