General > Formula 1
Occura Amplificis
abyaly:
You can save a few bp to make the virus develop faster (without changing any behavior)
- (1bp) replace the "1 add" with a "++"
- (1bp) Turn "0 .delgene store" into ".delgene store" (because an empty stack counts as a 0)
- (3bp) Turn
*.nrg 3 div *.body sub .strbody store
*.body *.nrg 3 div sub .fdbody store
into
*.nrg 3 div *.body sub dup .strbody store - .fdbody store
Total savings: 5 bp
PS : What version are you running? On my end Occura (the latest one) has so far been unable to beat pacifist. 6-0
bacillus:
It can now beat Pacifist almost every time!
EDIT => I hope no-one read what was here before, but I destroyed the evidence just in case.
bacillus:
Wait a minute... I just made sense of abyaly's cryptic messages; what exactly does the dup command do?
Commander Keen:
dup duplicates the last variable on the stack.
So "5 dup mult .repro store" for instance, is the same as "5 5 mult .repro store"
If you ever use the same number or variable, duplicating it can save a whole load of code.
So *.nrg 3 div *.body sub dup .strbody store - .fdbody store would do this:
*.nrg 3 div *.body sub - energy / 3 minus body
So that lot resolves to a number, then dup duplicates the number. So the stack has the number twice. Then .strbody store stores the value in strbody, but since there is 3 values on the stack (nrg/3-body, nrg-3/body, .strbody) store only uses two, leaving one of the nrg/3-body 's on the stack, which is used by the next store.
I hope that makes sense...
bacillus:
Thanks for the concise summary. Now I have time to update all my bots before running the league (goodbye spare time)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version