Author Topic: strange problems: .refxpos and !%=  (Read 3385 times)

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
strange problems: .refxpos and !%=
« on: April 13, 2006, 07:22:48 PM »
Ok, original I wanted to store the coordinates from the bot your own bot sees into the output.
However to mimize energy consumption I wrote following condition

cond
*.out1 *.refxpos !=  (first problems this does not activate it seems *.refxpos always stays 0 regardless of circumstances)

Also I wanted to use  !%= so it would only activate if the difference is more than 10%, however according to the wiki !%=  does not  work so, rather the description sounds quite strange:
It says %= returns" true" if the difference is less than 10% , !%= returns "false" if the difference is more than 10%

WHAT???? This is both the same situation just that you splitted the returno f false or true into two different vasriables which is totally senseless.
How would I need to write the condition so that it is true when .refxpos is more than 10% (1% would be even better) away from the value in .out
« Last Edit: April 13, 2006, 07:24:10 PM by Welwordion »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
strange problems: .refxpos and !%=
« Reply #1 on: April 13, 2006, 07:36:50 PM »
You could do:

*.refxpos *.out1 sub *.refxpos 10 div >=

Personally I'd do:

*.refxpos *.out1 sub abs 120 >=

that way the amount of error you're ignoring is independant of where you are in the world.

%= ~= !~= and !%= aren't used very often.  They tend not to work exactly like you'd like in any given situation.
« Last Edit: April 13, 2006, 07:37:57 PM by Numsgil »

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
strange problems: .refxpos and !%=
« Reply #2 on: April 13, 2006, 09:10:27 PM »
As I remember, calculations do not work within conditions in pre 2.4(thats why I not used them) so your solutions would not really work there, besides it does not solve the riddle why the gene did not activate.
« Last Edit: April 13, 2006, 09:16:44 PM by Welwordion »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
strange problems: .refxpos and !%=
« Reply #3 on: April 13, 2006, 09:28:55 PM »
Those %= etc. commands don't work like you think they would.  The math itself seems fairly easy inside the program, but the effects never seem quite right.

I would also recommend migrating to 2.4 now that it's stable and has at least all the same features as 2.3X.