Darwinbots Forum
Bots and Simulations => DNA - General => The Gene depository => Topic started by: MysticalDumpling on January 20, 2014, 03:12:57 PM
-
def tempdist 110 'or some other memloc
'blah blah blah...
start
*.refxpos *.refypos *.xpos *.ypos dist 2 logx .shootval store
stop
This gene finds the distance between 2 bots and finds the inverse log2, then puts the result into .shootval. It works for me... there might be an error. If so, correct me! :P
-
It does not work for me... there might be an error.
I'll see if this works, but later.
-
Maybe find the distance of x&y separately, then use the Pythagorean theorem to find the distance...
-
I found the error! The log result has to be made negative, so...
*.refxpos *.refypos *.xpos *.ypos dist 2 logx -1 mult .shootval store '?
-
Good Job 8)