Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: Panda on May 28, 2010, 05:38:39 AM

Title: Inline != (Not equal to)
Post by: Panda on May 28, 2010, 05:38:39 AM
Erm. No matter how hard I try to do an inline !=, or even think about it, well, I just cannot do it. I need some help please.
Title: Inline != (Not equal to)
Post by: peterb on May 28, 2010, 09:55:46 AM
Quote from: Panda
Erm. No matter how hard I try to do an inline !=, or even think about it, well, I just cannot do it. I need some help please.

you need to work with tables

for example you dont want .Amem totbe 5 and then do something
Code: [Select]
*.amem -5  add  sgn abs 1   sub abs   
'       1    -4 -1    1      0      0
'       2    -3 -1    1      0      0
'       5     0  0    0     -1      1
'       7     1  1    1      0      0

>>from here you got valeu 1 to multiply to do something if something equals 5   like 1 x 5 .up store
>> if you want to execute only if it isnt 5 you can do without the last 2 columns (then sgn is the last one)
Title: Inline != (Not equal to)
Post by: ikke on May 28, 2010, 10:47:26 AM
a-a add sgn mult?
Title: Inline != (Not equal to)
Post by: Panda on May 28, 2010, 06:36:14 PM
Quote from: ikke
a-a add sgn mult?

I did
Code: [Select]
*.var -a add sgn abs mult, I think, I may not be completely correct, though.

And thanks peterb, I didn't ever think of doing it like that .
Title: Inline != (Not equal to)
Post by: bacillus on May 29, 2010, 01:18:21 AM
You do know there's a sub command. It subtracts.
Title: Inline != (Not equal to)
Post by: Panda on May 29, 2010, 06:40:27 AM
Quote from: bacillus
You do know there's a sub command. It subtracts.

If I understand what you are saying. Then yeah, I know, "-x add" is a subtraction. I could have done "x sub" but I continued doing what the other person was doing.