Delete: Difference between revisions

From StarLogo Nova Wiki
No edit summary
(same file already uploaded)
 
(14 intermediate revisions by the same user not shown)
Line 2: Line 2:
<translate>
<translate>


<!--T:18-->
[[Category:Agents]]
[[Category:Agents]]
<section begin=image/>[[File:Delete Block.png|alt=The Delete Block|thumb]]<section end=image/>
<section begin=image/>[[File:Delete Block.png|alt=The Delete Block|thumb]]<section end=image/><p id="tooltip">Deletes itself.</p>
 
<!--T:25-->
<section begin=name/>'''<code>delete</code>'''<section end=name/> is a [[code block]] part of the [[agents]] drawer.
<section begin=name/>'''<code>delete</code>'''<section end=name/> is a [[code block]] part of the [[agents]] drawer.
</translate>


<translate>
==Usage== <!--T:13-->
==Usage==


<!--T:19-->
Deletes the [[agent]] executing the [[stack]] of code.
Deletes the [[agent]] executing the [[stack]] of code.
</translate>


<translate>
==Example== <!--T:26-->
 
<!--T:27-->
[[File:collidee_example.gif|alt=Delete example gif|thumb]]
[[File:delete_example.png|alt=Delete example code|thumb]]
 
<!--T:28-->
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.
 
<!--T:20-->
==Nuances==
==Nuances==
<code>delete</code> does not delete all [[agent]]s of a type. <code>delete</code> deletes only the single agent that runs the block. See [[#Related Blocks|related blocks]] for other code blocks with similar delete functions.
<code>delete</code> does not delete all [[agent]]s of a type. <code>delete</code> deletes only the single agent that runs the block. See [[#Related Blocks|related blocks]] for other code blocks with similar delete functions.


<!--T:21-->
No code may be placed underneath the delete block as there will be no agent available to run the code.
No code may be placed underneath the delete block as there will be no agent available to run the code.
</translate>


<translate>
<!--T:22-->
==Related Blocks==
==Related Blocks==
*<code>[[delete everyone]]</code>
*<code>[[delete everyone]]</code>
*<code>[[delete agent|delete agent [_]]]</code>
*<code>[[delete agent|delete agent [_]]]</code>
</translate>
</translate>

Latest revision as of 15:25, 16 August 2023

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 gif
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