Scatter: Difference between revisions

From StarLogo Nova Wiki
(duplicate file already uploaded)
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#vardefine:Scatter|<code>scatter</code>}}
<languages/>
<translate>


== Usage ==
<!--T:1-->
[[Category:Agents]]
<section begin=image/>[[File:Scatter.png|thumb|180x180px]]<section end=image/><p id="tooltip">Sets its location to a random position in SpaceLand.</p>
 
<!--T:9-->
{{#vardefine:Scatter|<code>scatter</code>}}<section begin=name/>'''<code>scatter</code>'''<section end=name/> is a [[code block]] part of the [[agents]] drawer.
 
<!--T:2-->
==Usage==
<code>scatter</code> is used to scatter an agent to a random location in [[SpaceLand]].
<code>scatter</code> is used to scatter an agent to a random location in [[SpaceLand]].


===Syntax===
<!--T:3-->
==Syntax==
<code>scatter</code>
<code>scatter</code>


==Example== <!--T:10-->
<!--T:11-->
[[File:scatter_example.gif|alt=Scatter example gif|thumb]]
[[File:create_each_do_example.png|alt=Scatter example code|thumb]]
<!--T:12-->
The scatter block assigns a random location to each agent who calls scatter.  Note that this will not assign a random Z value. Note that the ‘delete everyone,’ ‘create each do,’ and ‘set my to’ blocks instruct The World to carry out the desired commands.
<!--T:4-->
==Nuances==
==Nuances==
An important difference between {{#var:Scatter}} and {{#vardefineecho:ScatterEveryone|<code>[[Scatter Everyone|scatter everyone</code>]]}} is that {{#vardefineecho:ScatterEveryone|<code>scatter everyone</code>}} scatters all agents in [[SpaceLand]] to random locations. {{#var:Scatter}} only scatters the agents created by the {{#vardefineecho:Create|<code>[[Create|create [_] [▼](s)</code>]]}} or {{#vardefineecho:cedo|<code>[[Create Each Do|create [_] [▼](s) each do</code>]]}} block in which the {{#var:Scatter}} block was placed.
An important difference between {{#var:Scatter}} and {{#vardefineecho:ScatterEveryone|<code>[[Scatter Everyone|scatter everyone</code>]]}} is that {{#vardefineecho:ScatterEveryone|<code>scatter everyone</code>}} scatters all agents in [[SpaceLand]] to random locations. {{#var:Scatter}} only scatters the agents created by the {{#vardefineecho:Create|<code>[[Create|create [_] [▼](s)</code>]]}} or {{#vardefineecho:cedo|<code>[[Create Each Do|create [_] [▼](s) each do</code>]]}} block in which the {{#var:Scatter}} block was placed.


<!--T:5-->
==Related Blocks==
==Related Blocks==
*{{#var:Scatter Everyone}}
{{#vardefineecho:ScatterEveryone|<code>[[Scatter Everyone|scatter everyone</code>]]}}
 
==Relevant Video Resources== <!--T:6-->
 
<!--T:7-->
==Relevant Activities==
[[Category:Code Block]]
</translate>

Latest revision as of 15:28, 16 August 2023

Other languages:
Scatter.png

Sets its location to a random position in SpaceLand.

scatter is a code block part of the agents drawer.

Usage

scatter is used to scatter an agent to a random location in SpaceLand.

Syntax

scatter

Example

Scatter example gif
Scatter example code

The scatter block assigns a random location to each agent who calls scatter. Note that this will not assign a random Z value. Note that the ‘delete everyone,’ ‘create each do,’ and ‘set my to’ blocks instruct The World to carry out the desired commands.

Nuances

An important difference between scatter and scatter everyone is that scatter everyone scatters all agents in SpaceLand to random locations. scatter only scatters the agents created by the create [_] [▼](s) or create [_] [▼](s) each do block in which the scatter block was placed.

Related Blocks

scatter everyone

Relevant Video Resources

Relevant Activities