Chloroplasts and light
The sysvars to buy, remove, count and share chloroplasts, and to know how much light is left in the field.
| Address | Sysvar | Kind | Summary |
|---|---|---|---|
| 920 | .chlr | Sense | How many chloroplasts the bot has, from 0 to 32000, after the cycle's natural loss. |
| 921 | .mkchlr | Command | Buys chloroplasts: adds that amount in the same cycle and charges energy for each one. |
| 922 | .rmchlr | Command | Sheds that amount of chloroplasts in the same cycle, at no cost and recovering nothing. |
| 923 | .light .availability | Sense | How much light is left available in the field, from 0 to 32000: it drops as bots take up more surface. |
| 924 | .sharechlr | Command | In a multicellular organism, shares chloroplasts with each tied bot: the number is the percentage of the total that this bot keeps. |
Chloroplasts let a bot live off the sun: in daytime cycles, a bot with chloroplasts that is inside the lit strip gains energy and body without doing anything. Vegetables are born with them, but any bot can buy them. How that gain is calculated is covered in Chloroplasts and vegetables.
The sysvars in the group are:
.chlr: how many chloroplasts the bot has..mkchlr: buy; costs energy per chloroplast..rmchlr: remove; free, but gives nothing back..light: how much light is left free in the field, which drops when it is full of bots..sharechlr: share chloroplasts with the other bots in an organism.
Before buying, it's worth knowing what comes with them. Chloroplasts are lost on their own a little each cycle (up to half per cycle when there are few, almost nothing when there are thousands), they weigh a lot (each one adds almost 1 to .mass, so the bot barely moves), and they are incompatible with viruses: if a bot with chloroplasts tries to make one with .mkvirus, it loses all of them. On reproduction, the child takes its percentage.
The most common idea is a bot that keeps itself at a fixed level, replacing what is lost as long as its energy allows:
' Keeps about 2000 chloroplasts
cond
*.chlr 2000 <
*.nrg 1000 >
start
100 .mkchlr store
stop