Random To/en: Difference between revisions

From StarLogo Nova Wiki
(Updating to match new version of source page)
 
(Updating to match new version of source page)
Line 7: Line 7:
<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>


===Syntax===
==Syntax==
<code>random [number] to [number]</code>
<section begin=image/>[[File:Random To Nums.png|right|alt=The Random to Block|thumb]]<section end=image/>
<!-- <code>random [number] to [number]</code> -->
Inputs in this block:
#defines the lower limit
#defines the upper limit for the range of the generated random number.
 


== Common Uses ==
== Common Uses ==

Revision as of 15:23, 27 July 2023

Other languages:
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

The Random to Block

Inputs in this block:

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

Related Blocks