Random To: Difference between revisions
No edit summary |
(Marked this version for translation) |
||
Line 2: | Line 2: | ||
<translate> | <translate> | ||
<!--T:1--> | |||
[[Category:Math]] | [[Category:Math]] | ||
<section begin="image"/>[[File:Random To.png|alt=The random to block|thumb]]<section end="image"/> | <section begin="image"/>[[File:Random To.png|alt=The random to block|thumb]]<section end="image"/> | ||
Line 8: | Line 9: | ||
<p id="tooltip">{{Block|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. </p> | <p id="tooltip">{{Block|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. </p> | ||
<!--T:2--> | |||
===Syntax=== | ===Syntax=== | ||
<code>random [number] to [number]</code> | <code>random [number] to [number]</code> | ||
<!--T:3--> | |||
== Common Uses == | == Common Uses == | ||
*The {{Block|random [_] to [_]}} block is most commonly used for random movement. When inserted into a [[Movements]] block such as the {{#vardefineecho:cedol|<code>[[Left By Degs|left by [_] degs</code>]]}} combined with the {{#vardefineecho:cedol|<code>[[Forward|forward[_]</code>]]}} block, an agent will wander throughout [[Spaceland]] in a random direction. | *The {{Block|random [_] to [_]}} block is most commonly used for random movement. When inserted into a [[Movements]] block such as the {{#vardefineecho:cedol|<code>[[Left By Degs|left by [_] degs</code>]]}} combined with the {{#vardefineecho:cedol|<code>[[Forward|forward[_]</code>]]}} block, an agent will wander throughout [[Spaceland]] in a random direction. | ||
<!--T:4--> | |||
==Related Blocks== | ==Related Blocks== | ||
*{{Block|Left By Degs|left by [_] degs}} | *{{Block|Left By Degs|left by [_] degs}} |
Revision as of 19:59, 28 June 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
random [number] to [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.