Code center > Suggestions

sysvariables to execute thinks for "every" idea

(1/1)

Welwordion:
It would be nice that if I wanted to do the same thing for all 9 eyes if I could write that in one gene instead of nine.  So a gene that executes itself 9 times and changes the numbers in  eyevariables  etc s by inc mod 9 1 add accordingly:

.eye1---> .eye2 .... .eye9---> .eye1  ;    61 store --> 62 store....  69 store --> 61 store

Numsgil:
I'm toying with a foreach operator of some sort for DB3, however the way the language is set up, it's just not all that easy in the current version.  What you really want is a loop, but implementing a raw loop is impossible because bots are designed to implement their entire DNA each cycle.

Gobo:
Well, you can use cycles for imitating the loop.

--- Code: ---*.value .eye1 *.robage 9 mod add store
--- End code ---

Navigation

[0] Message Index

Go to full version