DarwinBotsManual
Open the app EspañolES

.delgene

Deletes the gene with that number from the bot's own DNA; the classic use is a gene that deletes itself after running.

Facts

Address
340
Name
.delgene
Kind
Command: the bot writes it and the engine reads it and usually consumes it
Group
DNA and viruses
Written by
Your DNA.
Read by
The engine, in the movement phase of the same cycle: if it is greater than 0, it deletes that gene.
Cleared
The engine, after using it. A negative value does nothing and stays written.
Range
−32000 to 32000; only the number of a gene that exists is valid.
Note
No outside attack can write it: memory shots skip it and venom cannot target it.
Mutations
picked as a store target

Write the number of a gene and the engine deletes the whole gene from the DNA in the same cycle, from its cond to its stop. From the next cycle on that code no longer exists: it doesn't run, it costs no upkeep and it isn't passed on to children. The command is cleared when used, and a number that doesn't match any gene does nothing. The numbering is the one in Genes: cond, start, else and stop.

The best-known use is the single-use gene, which deletes itself with .thisgene:

' Startup gene: runs once and disappears
cond
start
 0 .timer store
 *.thisgene .delgene store
stop
cond
start
 10 .up store
stop

This is the pattern of Bestiary bots like Saber (abyaly, 2008). After the first cycle .genes drops from 2 to 1 and .dnalen shrinks.

Remote attacks can't write to .delgene: memory shots skip it and venom can't target it. But two routes remain: a virus whose code does it, and a bot tied to you, which can write it through the tie with 340 .tieloc and the gene number in .tieval (see Ties and multicellular bots).