Delete

From StarLogo Nova Wiki
Revision as of 18:15, 11 August 2023 by FuzzyBot (talk | contribs) (Updating to match new version of source page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Other languages:
The Delete Block

Deletes itself.

delete is a code block part of the agents drawer.

Usage

Deletes the agent executing the stack of code.

Example

Delete example code

When a prey agent collides with a predator agent (i.e. they have the same x, y, and z coordinates) the prey agent deletes itself. This interaction makes it appear as if the predator eats the prey.

Nuances

delete does not delete all agents of a type. delete deletes only the single agent that runs the block. See related blocks for other code blocks with similar delete functions.

No code may be placed underneath the delete block as there will be no agent available to run the code.

Related Blocks