.repro
Orders an asexual reproduction: the number is the percentage of energy, body and chloroplasts that the child takes.
Facts
- Address
- 300
- Name
.repro- Kind
- Command: the bot writes it and the engine reads it and usually consumes it
- Group
- Reproduction
- Written by
- Your DNA.
- Read by
- The engine, in the actions phase: if it is greater than 0, it requests a child, which is born in the births and deaths phase of the same cycle.
- Cleared
- The engine, only when the child is born. If the birth fails, it stays written and is retried every cycle.
- Range
- −32000 to 32000; the remainder of dividing by 100 is used: the percentage the child takes (100 counts as 0).
- Mutations
- picked as a store target
Write a percentage and, if it can be done, the bot has a child at the end of that same cycle. With 30 .repro store and 3000 energy and 1000 body, the child is born with about 900 energy and 300 body, and the parent keeps about 2100 and 700 (a thousandth is lost in the handover). Chloroplasts and waste are split the same way.
' It splits in two when it gathers energy
cond
*.nrg 6000 >
start
50 .repro store
stopWhat you need to know:
- Modulo 100. The remainder of dividing by 100 is used:
100is 0 (there is never a child) and150is 50. A value of 0 or less does nothing. - It persists until it succeeds. The engine clears
.reproonly when the child is born. If the birth fails, the order stays there and is retried every cycle, even if the gene that wrote it no longer runs. To cancel it, write0 .repro store. - Why it can fail. Either the bot has less than 5 body, or it has no energy, or the spot where the child has to appear is occupied by another bot, occupied by an obstacle, or outside the field. It happens, for example, to a child that wants to reproduce as soon as it is born, while still stuck to its parent.
- Cost. Besides the thousandth that is lost, the birth can charge for the length of the DNA (DNA copy).
If .repro and .mrepro are both set in the same cycle, a coin flip decides which of the two percentages is used. If the bot is fertilized and has .sexrepro written, that cycle it only tries sexual reproduction and the asexual one waits, even if the sexual one ends up failing. The rest of the process is in Reproduction and Reproduction.