Category:Math

Gets a random integer within the range of the specified minimum and maximum numbers.

This block can be used in place of any number. It works well for randomizing a sprite’s property or location.

Parameters

NameDescription
number (max) The maximum number generated
number (min) The minimum number generated

Tips

  • Negative values for min or max are allowed.
  • If you accidentally make min larger than max it will still return a random number in the range.

Found a bug in the documentation? Let us know at documentation@code.org