Random To: Difference between revisions

From StarLogo Nova Wiki
(Changed nuances to common uses)
Line 3: Line 3:
<section begin="name" />'''{{Block|random [_] to [_]}}'''<section end="name" /> is a [[code block]] part of the [[Math]] drawer.
<section begin="name" />'''{{Block|random [_] to [_]}}'''<section end="name" /> is a [[code block]] part of the [[Math]] drawer.
==Usage==
==Usage==
{{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 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>


===Syntax===
===Syntax===

Revision as of 18:57, 17 August 2022

The random to block

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 the left by [_] degs combined with the forward[_] block, an agent will wander throughout Spaceland in a random direction.

Related Blocks