Delete/en: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
[[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> | ||
'''<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. | ||
==Usage== | ==Usage== | ||
Deletes the [[agent]] executing the [[stack]] of code. | Deletes the [[agent]] executing the [[stack]] of code. | ||
==Example== | |||
[[File:delete_example.gif|alt=Delete example gif|thumb]] | |||
[[File:delete_example.png|alt=Delete example code|thumb]] | |||
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== | ==Nuances== |
Latest revision as of 18:15, 11 August 2023
Deletes itself.
delete
is a code block part of the agents drawer.
Usage
Deletes the agent executing the stack of code.
Example
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.