Author Topic: working with relative pointers inside DNA !  (Read 3355 times)

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
working with relative pointers inside DNA !
« on: April 09, 2010, 05:29:01 PM »
Hey

In program languages you see often something like ^P+
  • , the pointer to variable p and x offset of that memory adress (basically arrays work like that)

after reading the wiki i came to the conclusion that it should work also inside darwin bots genes

Maybe its something for the wiki page

Here is my sample code which explains it:



def temp0 60
def temp1 61
cond
*.eye5 0 >
start

'Have some code to move
'So that *.up has some valeu, put it in .temp0

*.up .temp0 store
'Now if it is a multibot, get that remote bots speed store it in temp1
*.refvelup .temp1 store
'Depending on multibot or not add 1 or zero to the addres of mem1  (not the valeu stored there but the addres of where it is)
'Then the single * tells the engine to get the previous number as an adres to get value from, and put that in store.

.temp0 *.refmultibot add * .up store
'so here .temp0 acts as a root pointer,  refmultibot acts as a relative position and * gets from there the value
stop