Author Topic: Introduction and Condition question  (Read 2904 times)

Offline d-EVO

  • Bot Destroyer
  • ***
  • Posts: 125
    • View Profile
Introduction and Condition question
« on: October 23, 2008, 06:30:07 PM »
hey guys

I am new here so I guess I should ask a newbie question  

Is    >   <   =   !=   %=   %!=   the only available conditions!
Not that you need any more it is just that I would like to use   =>   and   =<   like you can In java.
I want to know because I am writing a DNA that compares the value of each eye and sees which one has the biggest value.
But if a bot intersects 2 or more of the eyes there values become equal and the bot malfunctions.
So I need to check that the value of each eye is bigger than or equal to.

It would be much easier to write my program If I can compare both in one line.
I have already tried to use the =<   and   => conditions and they seem to work.
My bots go totally mental though and they only lock onto there own kind instead of veges (put *.myeye *.refeye != as a condition, doesn't seem to work   )

If These conditions are not available, maby it would be a good idea for a future version.

I will post my DNA if I actually get it to work.

cheers
1:      2 is true
2:      1 is false

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Introduction and Condition question
« Reply #1 on: October 23, 2008, 11:41:04 PM »
These conditions are available, but (I'm pretty sure this is the same in Java, by the way) you put them in the wrong order. Its >= and <=  

If you are interested, look up OCULUS in the forum, it's a piece of algebraic logic that stores a certain eye (version I focuses on the object closest to eye5, version II focuses on the nearest object). This sets .focuseye, then you can read that value through .eyef, this is handy as usually a bot will 'read' through eye5, but OCULUS lets you read through other eyes.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline d-EVO

  • Bot Destroyer
  • ***
  • Posts: 125
    • View Profile
Introduction and Condition question
« Reply #2 on: October 24, 2008, 04:36:13 AM »
Quote from: bacillus
These conditions are available, but (I'm pretty sure this is the same in Java, by the way) you put them in the wrong order. Its >= and <=  

oops   . my bad.
that explains a lot. thanks for the help. for some reason I thought it was =>.
It is just that it was not in the DNAHelp file.

Quote
If you are interested, look up OCULUS in the forum, it's a piece of algebraic logic that stores a certain eye (version I focuses on the object closest to eye5, version II focuses on the nearest object). This sets .focuseye, then you can read that value through .eyef, this is handy as usually a bot will 'read' through eye5, but OCULUS lets you read through other eyes.

I think I will stick to my program. It should also read through other eyes, takes up 9 genes though

Thanks for the help
1:      2 is true
2:      1 is false

Offline d-EVO

  • Bot Destroyer
  • ***
  • Posts: 125
    • View Profile
Introduction and Condition question
« Reply #3 on: October 24, 2008, 04:42:58 AM »
after adding 81 equal signs my program finaly works... well sort of. will lock onto the closest bot but it cant tel friend from foe.
I need to add some other identifier
« Last Edit: October 24, 2008, 05:48:46 AM by d-EVO »
1:      2 is true
2:      1 is false

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Introduction and Condition question
« Reply #4 on: October 26, 2008, 07:11:21 AM »
IMO the syntax isn't far from C (Just with reverse notation and all that)...
You have pointers and you can do all the usual tuff, just with a slightly different syntax.
For instance :
 
def myPointer 110           'Define the memmory adress for our pointers
def mySecondPointer 111

start
.shoot .myPointer store   'Save the adress of shoot in the first pointer
-1 *.mypointer store       'Push -1 into the location our pointer is pointing at

.mySecondPointer .myPointer store    'Save the adress of the second pointer in th first pointer
.shoot .mySecondPointer store           'Save the adress of shoot in the second pointer
-1 *.mypointer * store                       'Push -1 into shoot through both pointers.
stop


So a * in front of a regular adress just gives you the value stored in that adress (If that value is another adress it can be used in that way like in the first part of the example)
And in the last store what we're saying is:
Give me the value stored in the adress of myPointer (The adress of mySecondPointer is stored there), then the second * asks for the value stored in the adress pointed to by the second pointer (Wich is the adress of shoot)... and then finaly we end up saving -1 into .shoot...

And the further I get with this the more I realize how much I suck at explaining this
Either way syntax is close to C in some way... close enough for me to mess up an use reverse notation at times while writing in C