Scatter: Difference between revisions

From StarLogo Nova Wiki
(updates from Blockument)
(duplicate file already uploaded)
 
(One intermediate revision by the same user not shown)
Line 17: Line 17:
<code>scatter</code>
<code>scatter</code>


==Example==
==Example== <!--T:10-->


<!--T:11-->
[[File:scatter_example.gif|alt=Scatter example gif|thumb]]
[[File:scatter_example.gif|alt=Scatter example gif|thumb]]
[[File:scatter_example.png|alt=Scatter example code|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.
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.



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