Author Topic: Idea: Evolving puppeteer genes  (Read 7798 times)

Offline gymsum

  • Bot Destroyer
  • ***
  • Posts: 215
    • View Profile
Idea: Evolving puppeteer genes
« Reply #15 on: May 01, 2008, 12:19:26 AM »
ok got something for you

cond
*.robage 32000 sub 2 mod 1 =
start
....push a variable into a sys var at location
stop

cond
*.robage 32000 sub 3 mod 1 =
start
...read from the location in 1st gene
stop

cond
*.robage mod 1 =
start
..push something into another location, such as tout1, or multi, or whatever
stop


This will let your multibots tie communicate between veggies. Every cycle store say *40 into tout1. Everyother cycle another bot writes to 40. Every three cycles the bot reads from tin1. That gives something for what you want. It could be used so a bot stores something in the veggie, another makes it shoot, and another makes it turn by waht bot a said or read.

Offline Peksa

  • Bot Destroyer
  • ***
  • Posts: 118
    • View Profile
Idea: Evolving puppeteer genes
« Reply #16 on: May 01, 2008, 04:27:31 AM »
I think that mod for negative values returns negative. Ie. -23 5 mod would be -3.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Idea: Evolving puppeteer genes
« Reply #17 on: May 01, 2008, 04:02:15 PM »
Quote from: Peksa
I think that mod for negative values returns negative. Ie. -23 5 mod would be -3.

I always get math modulus and the programming one confused.  Someone should double check and then update the wiki page on mod.

Offline gymsum

  • Bot Destroyer
  • ***
  • Posts: 215
    • View Profile
Idea: Evolving puppeteer genes
« Reply #18 on: May 04, 2008, 09:02:23 PM »
not sure about negative modulous, is there an absolute value function? That would remove any problems.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Idea: Evolving puppeteer genes
« Reply #19 on: May 04, 2008, 09:48:38 PM »
Yes, the command "abs" takes the absolute value of the number on the top of the stack.

Offline gymsum

  • Bot Destroyer
  • ***
  • Posts: 215
    • View Profile
Idea: Evolving puppeteer genes
« Reply #20 on: May 05, 2008, 12:07:02 PM »
Ok I did my research, turns out modulous returns the same values regardless of their sign. With congruent numbers, like 2 mod 4, the results are quite unique.  Any ways mod is a nice function, just used it to create a structured MB.

Offline Peksa

  • Bot Destroyer
  • ***
  • Posts: 118
    • View Profile
Idea: Evolving puppeteer genes
« Reply #21 on: May 05, 2008, 07:04:21 PM »
Hmm.. I remember doing some tests earlier and I got negative values from mod somehow. I'll check this later.