Author Topic: and/or  (Read 4059 times)

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
and/or
« on: April 29, 2005, 08:53:44 AM »
I have 4 conditions ina  gene, lets call them for 1,2,3 and 4.
I want 2,3 and 4 to be true if the gene geos on. but I also want it to eb or for 1 so its either 234 or 1 that is true, how do I do?
shall it be like:
Code: [Select]
cond
2
3 and
4 and
1 or
start
? or how shall it be?
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Light

  • Bot Destroyer
  • ***
  • Posts: 245
    • View Profile
and/or
« Reply #1 on: April 29, 2005, 09:29:09 AM »
I think that is right ;)

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
and/or
« Reply #2 on: April 29, 2005, 09:44:23 AM »
Num would be the one to ask since he programmed that section but I think the correct way is to put the "or" bofre the "or'd" condition.

Code: [Select]
cond
2 and
3 and
4 or
1
start

I also don't think you even need to specify the "and" since it is assumed to be the default anyway.

Code: [Select]
cond
2
3
4 or
1
should work just as well

Please correct me if I'm wrong Num. I have never actually tried using these yet.
« Last Edit: April 29, 2005, 09:44:59 AM by PurpleYouko »
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
and/or
« Reply #3 on: April 29, 2005, 11:31:46 AM »
im afrain then the program will think 23 or any of 1/4, so it would be either 123 or 234
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
and/or
« Reply #4 on: April 29, 2005, 11:54:26 AM »
You have to think of it in terms of the stack.

2
3
4 or
1

will not do what you want.  3 and 4 will be ored together, then 2, 3 or 4, and 1 will be anded together.

The way you have it looks right, is it giving you problems Zelos?

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
and/or
« Reply #5 on: April 29, 2005, 01:32:51 PM »
So it works the same way as regular stack entries followed by an operator.
The previous two conditions are "ored" and all others are anded.
Thanks for clearing that up Num. I wasn't sure if you had extended the reverse Polish notation to the condition stack in that way.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
and/or
« Reply #6 on: April 29, 2005, 02:25:00 PM »
I Should make it possible for robots to evolve logic stuff , since now that I know how it works.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
and/or
« Reply #7 on: April 29, 2005, 02:41:09 PM »
Quote
I Should make it possible for robots to evolve logic stuff , since now that I know how it works.

Now there is something that is completely missing from the code.
Right now there is no way for any robot to evolve an "and", "or" or any other logic.
They can be lost (I think) but never added. Delete random value should be able to remove them but even then I am not quite sure since the logical operators use a different "DNA(n).tipo" code than any other kind of value does. It is possible that even this function will utterly ignore them.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D