Author Topic: sysvariables to execute thinks for "every" idea  (Read 2497 times)

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
sysvariables to execute thinks for "every" idea
« on: December 04, 2007, 01:51:14 PM »
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

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
sysvariables to execute thinks for "every" idea
« Reply #1 on: December 04, 2007, 02:56:25 PM »
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.

Offline Gobo

  • Bot Builder
  • **
  • Posts: 67
    • View Profile
sysvariables to execute thinks for "every" idea
« Reply #2 on: December 05, 2007, 02:37:59 AM »
Well, you can use cycles for imitating the loop.
Code: [Select]
*.value .eye1 *.robage 9 mod add store