Random To: Difference between revisions
No edit summary |
No edit summary |
||
Line 13: | Line 13: | ||
<section begin=image/>[[File:Random To.png|right|alt=The Random to Block|thumb]]<section end=image/> | <section begin=image/>[[File:Random To.png|right|alt=The Random to Block|thumb]]<section end=image/> | ||
<!-- <code>random [number] to [number]</code> --> | <!-- <code>random [number] to [number]</code> --> | ||
Inputs in this block: | |||
#Two numbers that define the upper and lower limits of the range of the generated random number. | |||
<!--T:3--> | <!--T:3--> |
Revision as of 16:19, 26 July 2023
random [_] to [_]
is a code block part of the Math drawer.
Usage
random [_] to [_]
defines the upper and lower bounds of a range from which a random number is generated. The number is generated between and including the set limits.
Syntax
Inputs in this block:
- Two numbers that define the upper and lower limits of the range of the generated random number.
Common Uses
- The
random [_] to [_]
block is most commonly used for random movement. When inserted into a Movements block such as theleft by [_] degs
combined with theforward[_]
block, an agent will wander throughout Spaceland in a random direction.