Create Each Do: Difference between revisions

From StarLogo Nova Wiki
No edit summary
No edit summary
Line 4: Line 4:
<!--T:12-->
<!--T:12-->
[[Category: Agents]]
[[Category: Agents]]
<section begin="icon"/>[[File:Create Each Do.png|alt=The Create Each Do Block|thumb]]<section end="icon"/><p id="tooltip">Creates the specified number of agents of the selected breed. Each newly created agent immediately follows the directions specified in "do".</p>
<section begin=image/>[[File:Create Each Do.png|alt=The Create Each Do Block|thumb]]<section end=image/><p id="tooltip">Creates the specified number of agents of the selected breed. Each newly created agent immediately follows the directions specified in "do".</p>


<!--T:21-->
<!--T:21-->
Line 15: Line 15:
<!--T:14-->
<!--T:14-->
==Syntax==
==Syntax==
<section begin=image/>[[File:Create Each Do Nums1.png|right|alt=The Create Each Do Block|thumb]]<section end=image/>
[[File:Create Each Do Nums1.png|right|alt=The Create Each Do Block|thumb]]
<!-- <code>create [Textbox: Number of Agents to Create] [Dropdown: Type of Agent](s) each do [code]</code> -->
<!-- <code>create [Textbox: Number of Agents to Create] [Dropdown: Type of Agent](s) each do [code]</code> -->



Revision as of 18:58, 10 August 2023

Other languages:
The Create Each Do Block

Creates the specified number of agents of the selected breed. Each newly created agent immediately follows the directions specified in "do".

create [_] [▼](s) each do is a code block part of the agents drawer.

Usage

create [_] [▼](s) each do is used to populate Spaceland with agents and then run a stack of code individually for each agent. This can be useful for making many agents and setting different traits for each.

Syntax

The Create Each Do Block

Inputs in this block:

  1. a number in the socket
  2. a breed from the dropdown menu
  3. relevant code


Nuances

create [_] [▼](s) each do is very similar to create [_] [▼](s). Both create agents, but generally create [_] [▼](s) each do allows for more complex and powerful usages.

Related Blocks

Relevant Video Resources

Relevant Activities