Author Topic: help with code  (Read 3154 times)

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
help with code
« on: December 06, 2006, 06:06:19 PM »
Found this bastard in my evosim.  How is he reproducing?

Code: [Select]
pow >
 *.nrg stop
 >
 and
 start
 65 300 *-321 store
 and
 1 4 *-25 angle rnd dec
 7 8 *-386 *296 -17 .aimleft inc
 else
 -- -7 9 2 24 inc
 56 -6 store
 store
 107

I've seen it do it, and not just once - there was a whole colony of them.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
help with code
« Reply #1 on: December 06, 2006, 06:08:01 PM »
BTW, what do these "stores to" and "reads from" negative memory locations do?
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
help with code
« Reply #2 on: December 06, 2006, 07:41:48 PM »
Whoops.  

I thought I was doing abs(n) mod 1000 for stores to negatvie mem locations but I missed a check in another routine.  So, right now, the negative mem location is just dropped.   It does not get put on the stack.  So the line

65 300 *-321 store

is really

65 300 store

or

65 .repro store

As of 2.42.9k, it will instead be

65 300 *321 store
Many beers....

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
help with code
« Reply #3 on: December 06, 2006, 08:35:47 PM »
But that is going to kill my robot!!!! You bastard!!!!

 
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
help with code
« Reply #4 on: December 06, 2006, 09:34:04 PM »
Think of it as a random mutation...  
Many beers....